{"action":"created","comment":{"url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/comments/95008452","pull_request_review_id":15554377,"id":95008452,"diff_hunk":"@@ -0,0 +1,41 @@\n+\n+{# ==========================================================================\n+\n+   Chart\n+\n+   ==========================================================================\n+\n+   Description:\n+\n+   Create a line chart molecule with data.\n+   See [GHE]/flapjack/Modules-V1/wiki/Chart\n+\n+   ========================================================================== #}\n+\n+<div class=\"chart_wrapper block\">\n+    {% if value.title %}\n+        <h3>{{ value.title }}</h3>\n+    {% endif %}\n+\n+\t<div class=\"svg_wrapper\"\n+        id=\"{{ value.element_id }}\"\n+        data-chart-type=\"{{ value.chart_type }}\"\n+        data-source=\"{{ value.data_source }}\"\n+        data-title=\"{{ value.title }}\"\n+        data-market=\"{{ value.market }}\"\n+        data-report-type=\"{{ value.report_type }}\"\n+    ></div>\n+\n+\t<p class=\"block__sub block__border-top block short-desc chart_footnote\">\n+\t\t{% if value.data_source %}\n+        <strong>Source:</strong> <a class=\"icon-link icon-link__download\" href=\"{{ parse_links(value.data_source) | safe }}\"> <span class=\"icon-link_text\">Download CSV file</span> </a><br>","path":"cfgov/jinja2/v1/_includes/molecules/line-chart.html","position":31,"original_position":31,"commit_id":"902e24cbe41164e91bf5a10857c46272ef7c183c","original_commit_id":"902e24cbe41164e91bf5a10857c46272ef7c183c","user":{"login":"chosak","id":654645,"avatar_url":"https://avatars.githubusercontent.com/u/654645?v=3","gravatar_id":"","url":"https://api.github.com/users/chosak","html_url":"https://github.com/chosak","followers_url":"https://api.github.com/users/chosak/followers","following_url":"https://api.github.com/users/chosak/following{/other_user}","gists_url":"https://api.github.com/users/chosak/gists{/gist_id}","starred_url":"https://api.github.com/users/chosak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chosak/subscriptions","organizations_url":"https://api.github.com/users/chosak/orgs","repos_url":"https://api.github.com/users/chosak/repos","events_url":"https://api.github.com/users/chosak/events{/privacy}","received_events_url":"https://api.github.com/users/chosak/received_events","type":"User","site_admin":false},"body":"Why does this need a `parse_links` and `| safe` call, if this is just a URL that's being passed in?","created_at":"2017-01-06T19:51:17Z","updated_at":"2017-01-06T19:52:00Z","html_url":"https://github.com/cfpb/cfgov-refresh/pull/2656#discussion_r95008452","pull_request_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2656","_links":{"self":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/comments/95008452"},"html":{"href":"https://github.com/cfpb/cfgov-refresh/pull/2656#discussion_r95008452"},"pull_request":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2656"}}},"pull_request":{"url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2656","id":100369694,"html_url":"https://github.com/cfpb/cfgov-refresh/pull/2656","diff_url":"https://github.com/cfpb/cfgov-refresh/pull/2656.diff","patch_url":"https://github.com/cfpb/cfgov-refresh/pull/2656.patch","issue_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/2656","number":2656,"state":"open","locked":false,"title":"WIP Feature: add line chart block to Wagtail","user":{"login":"cfarm","id":702526,"avatar_url":"https://avatars.githubusercontent.com/u/702526?v=3","gravatar_id":"","url":"https://api.github.com/users/cfarm","html_url":"https://github.com/cfarm","followers_url":"https://api.github.com/users/cfarm/followers","following_url":"https://api.github.com/users/cfarm/following{/other_user}","gists_url":"https://api.github.com/users/cfarm/gists{/gist_id}","starred_url":"https://api.github.com/users/cfarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfarm/subscriptions","organizations_url":"https://api.github.com/users/cfarm/orgs","repos_url":"https://api.github.com/users/cfarm/repos","events_url":"https://api.github.com/users/cfarm/events{/privacy}","received_events_url":"https://api.github.com/users/cfarm/received_events","type":"User","site_admin":false},"body":"Looking for feedback on this Wagtail code from @cfpb/cfgov-backends! Check out `GHE/CFGOV/data-research/issues/526` for more context.\r\n\r\nThis WIP adds a new Chart Block to the Wagtail admin, for entering metadata to generate d3 charts for the Consumer Credit Trends pages.\r\n\r\nContent entered in the Chart Block fields will replace the metadata that currently powers the charts in this file: https://github.com/cfpb/consumer-credit-trends/blob/master/src/static/js/templates/charts.js\r\n\r\nThis will allow our product owner to enter and manage the content for each chart.\r\n\r\nd3 will render the chart svg on the front end as Mike Bostock intended. I am going to add the necessary JS from the [consumer-credit-trends](https://github.com/cfpb/consumer-credit-trends) next to get this branch showing a functional demo.\r\n\r\n\r\n## Additions\r\n\r\n- new ChartGroup and ChartBlock blocks\r\n- I can't remember why I created ChartGroup; will update once I figure that out :)\r\n- placeholder JS file for loading chart JS only on relevant pages with a chart block on em\r\n\r\n## Removals\r\n\r\n-\r\n\r\n## Changes\r\n\r\n-\r\n\r\n## Testing\r\n\r\n- check out and create a \"Chart Group\" and \"Line Chart\" block to test the fields display on the page.\r\n\r\n\r\n## Todos\r\n\r\nFor this PR, my goals are to:\r\n\r\n- [ ] get the JavaScript for a line chart to render svgs for multiple charts on the page\r\n- [ ] use the data attributes output on the page HTML to target JS for each graph\r\n- [ ] whittle the admin fields for Chart Block so we only use those necessary for charts to render: title, data source, chart type\r\n- [ ] Work with D+R team @contolini and @mistergone to figure out how to transition development into cfgov-refresh for the JS versus in consumer-credit-trends\r\n\r\n\r\n## Checklist\r\n\r\n* [ ] Changes are limited to a single goal (no scope creep)\r\n* [ ] Code can be automatically merged (no conflicts)\r\n* [ ] Code follows the standards laid out in the [front end playbook](https://github.com/cfpb/front-end)\r\n* [ ] Passes all existing automated tests\r\n* [ ] New functions include new tests\r\n* [ ] New functions are documented (with a description, list of inputs, and expected output)\r\n* [ ] Placeholder code is flagged\r\n* [ ] Visually tested in supported browsers and devices\r\n* [ ] Project documentation has been updated (including the \"Unreleased\" section of the CHANGELOG)\r\n* [ ] Reviewers requested with the [Assignee tool](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users/) :arrow_right:\r\n","created_at":"2017-01-05T21:43:29Z","updated_at":"2017-01-06T19:52:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2956d12671caa2b86733c2b2b143919a1d21b208","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2656/commits","review_comments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2656/comments","review_comment_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/2656/comments","statuses_url":"https://api.github.com/repos/cfpb/cfgov-refresh/statuses/902e24cbe41164e91bf5a10857c46272ef7c183c","head":{"label":"cfarm:feature/line-chart","ref":"feature/line-chart","sha":"902e24cbe41164e91bf5a10857c46272ef7c183c","user":{"login":"cfarm","id":702526,"avatar_url":"https://avatars.githubusercontent.com/u/702526?v=3","gravatar_id":"","url":"https://api.github.com/users/cfarm","html_url":"https://github.com/cfarm","followers_url":"https://api.github.com/users/cfarm/followers","following_url":"https://api.github.com/users/cfarm/following{/other_user}","gists_url":"https://api.github.com/users/cfarm/gists{/gist_id}","starred_url":"https://api.github.com/users/cfarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfarm/subscriptions","organizations_url":"https://api.github.com/users/cfarm/orgs","repos_url":"https://api.github.com/users/cfarm/repos","events_url":"https://api.github.com/users/cfarm/events{/privacy}","received_events_url":"https://api.github.com/users/cfarm/received_events","type":"User","site_admin":false},"repo":{"id":58658257,"name":"cfgov-refresh","full_name":"cfarm/cfgov-refresh","owner":{"login":"cfarm","id":702526,"avatar_url":"https://avatars.githubusercontent.com/u/702526?v=3","gravatar_id":"","url":"https://api.github.com/users/cfarm","html_url":"https://github.com/cfarm","followers_url":"https://api.github.com/users/cfarm/followers","following_url":"https://api.github.com/users/cfarm/following{/other_user}","gists_url":"https://api.github.com/users/cfarm/gists{/gist_id}","starred_url":"https://api.github.com/users/cfarm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfarm/subscriptions","organizations_url":"https://api.github.com/users/cfarm/orgs","repos_url":"https://api.github.com/users/cfarm/repos","events_url":"https://api.github.com/users/cfarm/events{/privacy}","received_events_url":"https://api.github.com/users/cfarm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cfarm/cfgov-refresh","description":"In-progress redesign of the consumerfinance.gov website.","fork":true,"url":"https://api.github.com/repos/cfarm/cfgov-refresh","forks_url":"https://api.github.com/repos/cfarm/cfgov-refresh/forks","keys_url":"https://api.github.com/repos/cfarm/cfgov-refresh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfarm/cfgov-refresh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfarm/cfgov-refresh/teams","hooks_url":"https://api.github.com/repos/cfarm/cfgov-refresh/hooks","issue_events_url":"https://api.github.com/repos/cfarm/cfgov-refresh/issues/events{/number}","events_url":"https://api.github.com/repos/cfarm/cfgov-refresh/events","assignees_url":"https://api.github.com/repos/cfarm/cfgov-refresh/assignees{/user}","branches_url":"https://api.github.com/repos/cfarm/cfgov-refresh/branches{/branch}","tags_url":"https://api.github.com/repos/cfarm/cfgov-refresh/tags","blobs_url":"https://api.github.com/repos/cfarm/cfgov-refresh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfarm/cfgov-refresh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfarm/cfgov-refresh/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfarm/cfgov-refresh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfarm/cfgov-refresh/statuses/{sha}","languages_url":"https://api.github.com/repos/cfarm/cfgov-refresh/languages","stargazers_url":"https://api.github.com/repos/cfarm/cfgov-refresh/stargazers","contributors_url":"https://api.github.com/repos/cfarm/cfgov-refresh/contributors","subscribers_url":"https://api.github.com/repos/cfarm/cfgov-refresh/subscribers","subscription_url":"https://api.github.com/repos/cfarm/cfgov-refresh/subscription","commits_url":"https://api.github.com/repos/cfarm/cfgov-refresh/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfarm/cfgov-refresh/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfarm/cfgov-refresh/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfarm/cfgov-refresh/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfarm/cfgov-refresh/contents/{+path}","compare_url":"https://api.github.com/repos/cfarm/cfgov-refresh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfarm/cfgov-refresh/merges","archive_url":"https://api.github.com/repos/cfarm/cfgov-refresh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfarm/cfgov-refresh/downloads","issues_url":"https://api.github.com/repos/cfarm/cfgov-refresh/issues{/number}","pulls_url":"https://api.github.com/repos/cfarm/cfgov-refresh/pulls{/number}","milestones_url":"https://api.github.com/repos/cfarm/cfgov-refresh/milestones{/number}","notifications_url":"https://api.github.com/repos/cfarm/cfgov-refresh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfarm/cfgov-refresh/labels{/name}","releases_url":"https://api.github.com/repos/cfarm/cfgov-refresh/releases{/id}","deployments_url":"https://api.github.com/repos/cfarm/cfgov-refresh/deployments","created_at":"2016-05-12T16:27:05Z","updated_at":"2016-10-07T17:56:02Z","pushed_at":"2017-01-06T18:41:23Z","git_url":"git://github.com/cfarm/cfgov-refresh.git","ssh_url":"git@github.com:cfarm/cfgov-refresh.git","clone_url":"https://github.com/cfarm/cfgov-refresh.git","svn_url":"https://github.com/cfarm/cfgov-refresh","homepage":"","size":62776,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"flapjack"}},"base":{"label":"cfpb:master","ref":"master","sha":"9dd9b2755607fe79753238e3207e859ad62a587f","user":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"repo":{"id":18852566,"name":"cfgov-refresh","full_name":"cfpb/cfgov-refresh","owner":{"login":"cfpb","id":1071563,"avatar_url":"https://avatars.githubusercontent.com/u/1071563?v=3","gravatar_id":"","url":"https://api.github.com/users/cfpb","html_url":"https://github.com/cfpb","followers_url":"https://api.github.com/users/cfpb/followers","following_url":"https://api.github.com/users/cfpb/following{/other_user}","gists_url":"https://api.github.com/users/cfpb/gists{/gist_id}","starred_url":"https://api.github.com/users/cfpb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfpb/subscriptions","organizations_url":"https://api.github.com/users/cfpb/orgs","repos_url":"https://api.github.com/users/cfpb/repos","events_url":"https://api.github.com/users/cfpb/events{/privacy}","received_events_url":"https://api.github.com/users/cfpb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cfpb/cfgov-refresh","description":"Django project that powers the redesigned consumerfinance.gov website.","fork":false,"url":"https://api.github.com/repos/cfpb/cfgov-refresh","forks_url":"https://api.github.com/repos/cfpb/cfgov-refresh/forks","keys_url":"https://api.github.com/repos/cfpb/cfgov-refresh/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfpb/cfgov-refresh/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfpb/cfgov-refresh/teams","hooks_url":"https://api.github.com/repos/cfpb/cfgov-refresh/hooks","issue_events_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/events{/number}","events_url":"https://api.github.com/repos/cfpb/cfgov-refresh/events","assignees_url":"https://api.github.com/repos/cfpb/cfgov-refresh/assignees{/user}","branches_url":"https://api.github.com/repos/cfpb/cfgov-refresh/branches{/branch}","tags_url":"https://api.github.com/repos/cfpb/cfgov-refresh/tags","blobs_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfpb/cfgov-refresh/statuses/{sha}","languages_url":"https://api.github.com/repos/cfpb/cfgov-refresh/languages","stargazers_url":"https://api.github.com/repos/cfpb/cfgov-refresh/stargazers","contributors_url":"https://api.github.com/repos/cfpb/cfgov-refresh/contributors","subscribers_url":"https://api.github.com/repos/cfpb/cfgov-refresh/subscribers","subscription_url":"https://api.github.com/repos/cfpb/cfgov-refresh/subscription","commits_url":"https://api.github.com/repos/cfpb/cfgov-refresh/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfpb/cfgov-refresh/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfpb/cfgov-refresh/contents/{+path}","compare_url":"https://api.github.com/repos/cfpb/cfgov-refresh/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfpb/cfgov-refresh/merges","archive_url":"https://api.github.com/repos/cfpb/cfgov-refresh/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfpb/cfgov-refresh/downloads","issues_url":"https://api.github.com/repos/cfpb/cfgov-refresh/issues{/number}","pulls_url":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls{/number}","milestones_url":"https://api.github.com/repos/cfpb/cfgov-refresh/milestones{/number}","notifications_url":"https://api.github.com/repos/cfpb/cfgov-refresh/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfpb/cfgov-refresh/labels{/name}","releases_url":"https://api.github.com/repos/cfpb/cfgov-refresh/releases{/id}","deployments_url":"https://api.github.com/repos/cfpb/cfgov-refresh/deployments","created_at":"2014-04-16T19:22:03Z","updated_at":"2016-12-02T14:19:03Z","pushed_at":"2017-01-06T18:41:46Z","git_url":"git://github.com/cfpb/cfgov-refresh.git","ssh_url":"git@github.com:cfpb/cfgov-refresh.git","clone_url":"https://github.com/cfpb/cfgov-refresh.git","svn_url":"https://github.com/cfpb/cfgov-refresh","homepage":"http://www.consumerfinance.gov/","size":63508,"stargazers_count":77,"watchers_count":77,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":41,"mirror_url":null,"open_issues_count":98,"forks":41,"open_issues":98,"watchers":77,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2656"},"html":{"href":"https://github.com/cfpb/cfgov-refresh/pull/2656"},"issue":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/2656"},"comments":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/issues/2656/comments"},"review_comments":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2656/comments"},"review_comment":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/pulls/2656/commits"},"statuses":{"href":"https://api.github.com/repos/cfpb/cfgov-refresh/statuses/902e24cbe41164e91bf5a10857c46272ef7c183c"}}}}
{"actor":{"display_login":"chosak"}}