{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/24488213","id":24488213,"diff_hunk":"@@ -920,8 +926,60 @@ def details(self):\n \n                         if detail_column_infos:\n                             if detail.custom_xml:\n-                                d = load_xmlobject_from_string(detail.custom_xml, xmlclass=Detail)\n+                                d = load_xmlobject_from_string(\n+                                    detail.custom_xml,\n+                                    xmlclass=Detail\n+                                )\n                                 r.append(d)\n+\n+                            elif detail.use_case_tiles:\n+\n+                                template_args = {\n+                                    \"detail_id\": self.id_strings.detail(module, detail_type),\n+                                    \"title_text_id\": self.id_strings.detail_title_locale(\n+                                        module, detail_type\n+                                    )\n+                                }\n+\n+                                # Get field/case property mappings\n+                                for template_field in [\"header\", \"top_left\", \"sex\", \"bottom_left\", \"date\"]:\n+                                    column = None\n+                                    for col in detail.columns:\n+                                        if col.case_tile_field == template_field:\n+                                            column = col\n+                                            break\n+\n+                                    template_args[template_field] = {\n+                                        \"prop_name\": get_column_xpath_generator(\n+                                            self.app, module, detail, column\n+                                        ).xpath,\n+                                        \"locale_id\": self.id_strings.detail_column_header_locale(\n+                                            module, detail_type, column,\n+                                        ),\n+                                        # Just using default language for now\n+                                        # The right thing to do would be to reference the app_strings.txt I think\n+                                        \"prefix\": escape(\n+                                            column.header.get(self.app.default_language, \"\")\n+                                        )\n+                                    }\n+                                    if column.format == \"enum\":\n+                                        template_args[template_field][\"enum_keys\"] = {}\n+                                        for mapping in column.enum:\n+                                            key = mapping.key\n+                                            template_args[template_field][\"enum_keys\"][key] = self.id_strings.detail_column_enum_variable(module, detail_type, column, key)","path":"corehq/apps/app_manager/suite_xml.py","position":108,"original_position":108,"commit_id":"cc1bf4ac331cbe3fb72cd5b32900e75f91ec691b","original_commit_id":"cc1bf4ac331cbe3fb72cd5b32900e75f91ec691b","user":{"login":"dimagimon","id":1179034,"avatar_url":"https://avatars.githubusercontent.com/u/1179034?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagimon","html_url":"https://github.com/dimagimon","followers_url":"https://api.github.com/users/dimagimon/followers","following_url":"https://api.github.com/users/dimagimon/following{/other_user}","gists_url":"https://api.github.com/users/dimagimon/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagimon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagimon/subscriptions","organizations_url":"https://api.github.com/users/dimagimon/orgs","repos_url":"https://api.github.com/users/dimagimon/repos","events_url":"https://api.github.com/users/dimagimon/events{/privacy}","received_events_url":"https://api.github.com/users/dimagimon/received_events","type":"User","site_admin":false},"body":"E501 line too long (171 > 115 characters)","created_at":"2015-02-11T11:24:33Z","updated_at":"2015-02-11T11:24:33Z","html_url":"https://github.com/dimagi/commcare-hq/pull/5507#discussion_r24488213","pull_request_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/5507","_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/24488213"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/5507#discussion_r24488213"},"pull_request":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/5507"}}},"pull_request":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/5507","id":29083497,"html_url":"https://github.com/dimagi/commcare-hq/pull/5507","diff_url":"https://github.com/dimagi/commcare-hq/pull/5507.diff","patch_url":"https://github.com/dimagi/commcare-hq/pull/5507.patch","issue_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/5507","number":5507,"state":"open","locked":false,"title":"Add case tile configuration (limited)","user":{"login":"NoahCarnahan","id":2117127,"avatar_url":"https://avatars.githubusercontent.com/u/2117127?v=3","gravatar_id":"","url":"https://api.github.com/users/NoahCarnahan","html_url":"https://github.com/NoahCarnahan","followers_url":"https://api.github.com/users/NoahCarnahan/followers","following_url":"https://api.github.com/users/NoahCarnahan/following{/other_user}","gists_url":"https://api.github.com/users/NoahCarnahan/gists{/gist_id}","starred_url":"https://api.github.com/users/NoahCarnahan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NoahCarnahan/subscriptions","organizations_url":"https://api.github.com/users/NoahCarnahan/orgs","repos_url":"https://api.github.com/users/NoahCarnahan/repos","events_url":"https://api.github.com/users/NoahCarnahan/events{/privacy}","received_events_url":"https://api.github.com/users/NoahCarnahan/received_events","type":"User","site_admin":false},"body":"Allows case tiles to be used in the case list instead of the standard table layout. This feature is under a flag. It is also a \"minimal\" implementation intended to support TDH's use case only. Users map case properties to tile fields with the interface pictured below. The display text of the case property is used as a prefix to the value on the tile. Users also choose if the case tile will continue to show while filling out forms.\r\n\r\nConfiguration limitations:\r\n- 5 fields on the case tile can be assigned to.\r\n- The `sex` field must be assigned to an ID mapping with keys \"male\" and \"female\".\r\n- The `date` filed must be a date. It will be converted to a string like \"4 jours,\" \"5 moins,\" or \"2 ans\" representing the difference between the current date and the property's value\r\n- There are also images and actions in the case tile that are not configurable\r\n\r\nThe configuration interface:\r\n![screen shot 2015-02-11 at 1 04 33 pm](https://cloud.githubusercontent.com/assets/2117127/6146028/0139f406-b1f1-11e4-83cf-3d2694931eb6.png)\r\nThe tile:\r\n![screenshot_2015-02-10-08-57-56](https://cloud.githubusercontent.com/assets/2117127/6146049/3e306944-b1f1-11e4-842d-8600a6c9e432.png)\r\n\r\n","created_at":"2015-02-11T11:24:15Z","updated_at":"2015-02-11T11:24:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"911c7ad79e3b5571d51149218a7b6d4b8836e3df","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/5507/commits","review_comments_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/5507/comments","review_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/{number}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/5507/comments","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/cc1bf4ac331cbe3fb72cd5b32900e75f91ec691b","head":{"label":"dimagi:tdh-tiles","ref":"tdh-tiles","sha":"cc1bf4ac331cbe3fb72cd5b32900e75f91ec691b","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"name":"commcare-hq","full_name":"dimagi/commcare-hq","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments/{number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","created_at":"2009-07-09T17:00:07Z","updated_at":"2015-02-11T07:16:46Z","pushed_at":"2015-02-11T11:16:45Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"http://www.commcarehq.org","size":197938,"stargazers_count":43,"watchers_count":43,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":57,"mirror_url":null,"open_issues_count":50,"forks":57,"open_issues":50,"watchers":43,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"a63288de15b3613a3e7058aed4e8f606cfae0c10","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":247278,"name":"commcare-hq","full_name":"dimagi/commcare-hq","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/commcare-hq","description":"A server-side tool to help manage community health workers, written in Django","fork":false,"url":"https://api.github.com/repos/dimagi/commcare-hq","forks_url":"https://api.github.com/repos/dimagi/commcare-hq/forks","keys_url":"https://api.github.com/repos/dimagi/commcare-hq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/commcare-hq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/commcare-hq/teams","hooks_url":"https://api.github.com/repos/dimagi/commcare-hq/hooks","issue_events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/commcare-hq/events","assignees_url":"https://api.github.com/repos/dimagi/commcare-hq/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/commcare-hq/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/commcare-hq/tags","blobs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/commcare-hq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/commcare-hq/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/commcare-hq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/commcare-hq/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/commcare-hq/languages","stargazers_url":"https://api.github.com/repos/dimagi/commcare-hq/stargazers","contributors_url":"https://api.github.com/repos/dimagi/commcare-hq/contributors","subscribers_url":"https://api.github.com/repos/dimagi/commcare-hq/subscribers","subscription_url":"https://api.github.com/repos/dimagi/commcare-hq/subscription","commits_url":"https://api.github.com/repos/dimagi/commcare-hq/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/commcare-hq/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments/{number}","contents_url":"https://api.github.com/repos/dimagi/commcare-hq/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/commcare-hq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/commcare-hq/merges","archive_url":"https://api.github.com/repos/dimagi/commcare-hq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/commcare-hq/downloads","issues_url":"https://api.github.com/repos/dimagi/commcare-hq/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/commcare-hq/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/commcare-hq/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/commcare-hq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/commcare-hq/releases{/id}","created_at":"2009-07-09T17:00:07Z","updated_at":"2015-02-11T07:16:46Z","pushed_at":"2015-02-11T11:16:45Z","git_url":"git://github.com/dimagi/commcare-hq.git","ssh_url":"git@github.com:dimagi/commcare-hq.git","clone_url":"https://github.com/dimagi/commcare-hq.git","svn_url":"https://github.com/dimagi/commcare-hq","homepage":"http://www.commcarehq.org","size":197938,"stargazers_count":43,"watchers_count":43,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":57,"mirror_url":null,"open_issues_count":50,"forks":57,"open_issues":50,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/5507"},"html":{"href":"https://github.com/dimagi/commcare-hq/pull/5507"},"issue":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/5507"},"comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/issues/5507/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/5507/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/dimagi/commcare-hq/pulls/5507/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/commcare-hq/statuses/cc1bf4ac331cbe3fb72cd5b32900e75f91ec691b"}}}}