{"action":"created","comment":{"url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls/comments/30709686","id":30709686,"diff_hunk":"@@ -0,0 +1,65 @@\n+# -*- coding: utf-8 -*-\n+\n+from __future__ import unicode_literals\n+\n+from django.conf import settings\n+\n+from cms.utils.i18n import get_current_language\n+from cms.utils.urlutils import admin_reverse\n+\n+\n+class AllTranslationsMixin(object):\n+    class Media:\n+        css = {'all': ('css/admin/all-translations-mixin.css', ), }\n+\n+    def all_translations(self, obj):\n+        \"\"\"\n+        Adds a property to the list_display that lists all translations with\n+        links directly to their change forms. Includes CSS to style the links to\n+        looks like tags with color indicating current language, active and\n+        inactive translations.\n+\n+        A similar capability is in HVAD, and now there is this for\n+        Parler-based projects.\n+        \"\"\"\n+        available = list(obj.get_available_languages())\n+        current = get_current_language()\n+        langs = []\n+        for code, title in settings.LANGUAGES:\n+            classes = [\"lang-code\", ]","path":"aldryn_translation_tools/admin.py","position":29,"original_position":29,"commit_id":"cc32d398b1b002052d95ef1aa7effe65ade88a1c","original_commit_id":"cc32d398b1b002052d95ef1aa7effe65ade88a1c","user":{"login":"mkoistinen","id":615759,"avatar_url":"https://avatars.githubusercontent.com/u/615759?v=3","gravatar_id":"","url":"https://api.github.com/users/mkoistinen","html_url":"https://github.com/mkoistinen","followers_url":"https://api.github.com/users/mkoistinen/followers","following_url":"https://api.github.com/users/mkoistinen/following{/other_user}","gists_url":"https://api.github.com/users/mkoistinen/gists{/gist_id}","starred_url":"https://api.github.com/users/mkoistinen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkoistinen/subscriptions","organizations_url":"https://api.github.com/users/mkoistinen/orgs","repos_url":"https://api.github.com/users/mkoistinen/repos","events_url":"https://api.github.com/users/mkoistinen/events{/privacy}","received_events_url":"https://api.github.com/users/mkoistinen/received_events","type":"User","site_admin":false},"body":"Its a habit I actively reinforce. Keeps me out of trouble with a number of list and tuple-related issues. Is it bad practice?","created_at":"2015-05-20T14:47:33Z","updated_at":"2015-05-20T14:47:33Z","html_url":"https://github.com/aldryn/aldryn-translation-tools/pull/1#discussion_r30709686","pull_request_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls/comments/30709686"},"html":{"href":"https://github.com/aldryn/aldryn-translation-tools/pull/1#discussion_r30709686"},"pull_request":{"href":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls/1","id":35825949,"html_url":"https://github.com/aldryn/aldryn-translation-tools/pull/1","diff_url":"https://github.com/aldryn/aldryn-translation-tools/pull/1.diff","patch_url":"https://github.com/aldryn/aldryn-translation-tools/pull/1.patch","issue_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/issues/1","number":1,"state":"open","locked":false,"title":"Adds a list of language \"tags\" in the changelist view","user":{"login":"mkoistinen","id":615759,"avatar_url":"https://avatars.githubusercontent.com/u/615759?v=3","gravatar_id":"","url":"https://api.github.com/users/mkoistinen","html_url":"https://github.com/mkoistinen","followers_url":"https://api.github.com/users/mkoistinen/followers","following_url":"https://api.github.com/users/mkoistinen/following{/other_user}","gists_url":"https://api.github.com/users/mkoistinen/gists{/gist_id}","starred_url":"https://api.github.com/users/mkoistinen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkoistinen/subscriptions","organizations_url":"https://api.github.com/users/mkoistinen/orgs","repos_url":"https://api.github.com/users/mkoistinen/repos","events_url":"https://api.github.com/users/mkoistinen/events{/privacy}","received_events_url":"https://api.github.com/users/mkoistinen/received_events","type":"User","site_admin":false},"body":"Adds a list of language \"tags\" in the changelist. Color indicates the state of translation for that object. Grey meaning untranslated, blue meaning translated. Darker versions of each are used to indicate the current language.\r\n\r\nEach is linked to the change form of the object and the specific language clicked.\r\n\r\nA similar capability is in HVAD, and now there is this for Parler-based projects.\r\n\r\nPreview:\r\n![all_translations](https://cloud.githubusercontent.com/assets/615759/7727430/5889f0e0-ff11-11e4-930a-2bfc80bef426.jpg)\r\n","created_at":"2015-05-20T12:24:23Z","updated_at":"2015-05-20T14:47:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1727aa2a153cc91eb3406b35b5c77e95527e37a7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls/1/commits","review_comments_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls/1/comments","review_comment_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/issues/1/comments","statuses_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/statuses/cc32d398b1b002052d95ef1aa7effe65ade88a1c","head":{"label":"aldryn:features/add_changelist_langs_display","ref":"features/add_changelist_langs_display","sha":"cc32d398b1b002052d95ef1aa7effe65ade88a1c","user":{"login":"aldryn","id":4201738,"avatar_url":"https://avatars.githubusercontent.com/u/4201738?v=3","gravatar_id":"","url":"https://api.github.com/users/aldryn","html_url":"https://github.com/aldryn","followers_url":"https://api.github.com/users/aldryn/followers","following_url":"https://api.github.com/users/aldryn/following{/other_user}","gists_url":"https://api.github.com/users/aldryn/gists{/gist_id}","starred_url":"https://api.github.com/users/aldryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldryn/subscriptions","organizations_url":"https://api.github.com/users/aldryn/orgs","repos_url":"https://api.github.com/users/aldryn/repos","events_url":"https://api.github.com/users/aldryn/events{/privacy}","received_events_url":"https://api.github.com/users/aldryn/received_events","type":"Organization","site_admin":false},"repo":{"id":34165184,"name":"aldryn-translation-tools","full_name":"aldryn/aldryn-translation-tools","owner":{"login":"aldryn","id":4201738,"avatar_url":"https://avatars.githubusercontent.com/u/4201738?v=3","gravatar_id":"","url":"https://api.github.com/users/aldryn","html_url":"https://github.com/aldryn","followers_url":"https://api.github.com/users/aldryn/followers","following_url":"https://api.github.com/users/aldryn/following{/other_user}","gists_url":"https://api.github.com/users/aldryn/gists{/gist_id}","starred_url":"https://api.github.com/users/aldryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldryn/subscriptions","organizations_url":"https://api.github.com/users/aldryn/orgs","repos_url":"https://api.github.com/users/aldryn/repos","events_url":"https://api.github.com/users/aldryn/events{/privacy}","received_events_url":"https://api.github.com/users/aldryn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aldryn/aldryn-translation-tools","description":"Collection of translation helpers and mixins","fork":true,"url":"https://api.github.com/repos/aldryn/aldryn-translation-tools","forks_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/forks","keys_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/teams","hooks_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/hooks","issue_events_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/issues/events{/number}","events_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/events","assignees_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/assignees{/user}","branches_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/branches{/branch}","tags_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/tags","blobs_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/languages","stargazers_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/stargazers","contributors_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/contributors","subscribers_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/subscribers","subscription_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/subscription","commits_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/contents/{+path}","compare_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/merges","archive_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/downloads","issues_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/issues{/number}","pulls_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/labels{/name}","releases_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/releases{/id}","created_at":"2015-04-18T12:32:59Z","updated_at":"2015-05-13T15:37:46Z","pushed_at":"2015-05-20T14:05:03Z","git_url":"git://github.com/aldryn/aldryn-translation-tools.git","ssh_url":"git@github.com:aldryn/aldryn-translation-tools.git","clone_url":"https://github.com/aldryn/aldryn-translation-tools.git","svn_url":"https://github.com/aldryn/aldryn-translation-tools","homepage":null,"size":120,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"aldryn:master","ref":"master","sha":"f7bb3401e04a79e68b24891fdb788f4f89f1e553","user":{"login":"aldryn","id":4201738,"avatar_url":"https://avatars.githubusercontent.com/u/4201738?v=3","gravatar_id":"","url":"https://api.github.com/users/aldryn","html_url":"https://github.com/aldryn","followers_url":"https://api.github.com/users/aldryn/followers","following_url":"https://api.github.com/users/aldryn/following{/other_user}","gists_url":"https://api.github.com/users/aldryn/gists{/gist_id}","starred_url":"https://api.github.com/users/aldryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldryn/subscriptions","organizations_url":"https://api.github.com/users/aldryn/orgs","repos_url":"https://api.github.com/users/aldryn/repos","events_url":"https://api.github.com/users/aldryn/events{/privacy}","received_events_url":"https://api.github.com/users/aldryn/received_events","type":"Organization","site_admin":false},"repo":{"id":34165184,"name":"aldryn-translation-tools","full_name":"aldryn/aldryn-translation-tools","owner":{"login":"aldryn","id":4201738,"avatar_url":"https://avatars.githubusercontent.com/u/4201738?v=3","gravatar_id":"","url":"https://api.github.com/users/aldryn","html_url":"https://github.com/aldryn","followers_url":"https://api.github.com/users/aldryn/followers","following_url":"https://api.github.com/users/aldryn/following{/other_user}","gists_url":"https://api.github.com/users/aldryn/gists{/gist_id}","starred_url":"https://api.github.com/users/aldryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldryn/subscriptions","organizations_url":"https://api.github.com/users/aldryn/orgs","repos_url":"https://api.github.com/users/aldryn/repos","events_url":"https://api.github.com/users/aldryn/events{/privacy}","received_events_url":"https://api.github.com/users/aldryn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aldryn/aldryn-translation-tools","description":"Collection of translation helpers and mixins","fork":true,"url":"https://api.github.com/repos/aldryn/aldryn-translation-tools","forks_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/forks","keys_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/teams","hooks_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/hooks","issue_events_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/issues/events{/number}","events_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/events","assignees_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/assignees{/user}","branches_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/branches{/branch}","tags_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/tags","blobs_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/languages","stargazers_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/stargazers","contributors_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/contributors","subscribers_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/subscribers","subscription_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/subscription","commits_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/contents/{+path}","compare_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/merges","archive_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/downloads","issues_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/issues{/number}","pulls_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/labels{/name}","releases_url":"https://api.github.com/repos/aldryn/aldryn-translation-tools/releases{/id}","created_at":"2015-04-18T12:32:59Z","updated_at":"2015-05-13T15:37:46Z","pushed_at":"2015-05-20T14:05:03Z","git_url":"git://github.com/aldryn/aldryn-translation-tools.git","ssh_url":"git@github.com:aldryn/aldryn-translation-tools.git","clone_url":"https://github.com/aldryn/aldryn-translation-tools.git","svn_url":"https://github.com/aldryn/aldryn-translation-tools","homepage":null,"size":120,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls/1"},"html":{"href":"https://github.com/aldryn/aldryn-translation-tools/pull/1"},"issue":{"href":"https://api.github.com/repos/aldryn/aldryn-translation-tools/issues/1"},"comments":{"href":"https://api.github.com/repos/aldryn/aldryn-translation-tools/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aldryn/aldryn-translation-tools/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/aldryn/aldryn-translation-tools/statuses/cc32d398b1b002052d95ef1aa7effe65ade88a1c"}}}}