{"action":"created","comment":{"url":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls/comments/45012206","id":45012206,"diff_hunk":"@@ -0,0 +1,127 @@\n+{% extends 'layouts/base.html' %}\n+{% import 'macros/form_macros.html' as f %}\n+\n+{% block content %}\n+    <div class=\"ui grid container\">\n+        <div class=\"eight wide computer sixteen wide mobile centered column\">\n+            <h2 class=\"ui dividing header\">Add a resource</h2>\n+\n+            {% set flashes = {\n+                'error':   get_flashed_messages(category_filter=['form-error']),\n+                'warning': get_flashed_messages(category_filter=['form-check-email']),\n+                'info':    get_flashed_messages(category_filter=['form-info']),\n+                'success': get_flashed_messages(category_filter=['form-success'])\n+            } %}\n+\n+            {{ f.begin_form(form, flashes) }}\n+\n+                <div class=\"two fields\">\n+                    {{ f.render_form_field(form.name) }}\n+                    {{ f.render_form_field(form.website) }}\n+                </div>\n+\n+                {{ f.render_form_field(form.description) }}\n+\n+                {{ f.render_form_field(form.address_autocomplete) }}\n+\n+                <div class=\"two fields\">\n+                    {{ f.render_form_field(form.street_number) }}\n+                    {{ f.render_form_field(form.route) }}\n+                </div>\n+\n+                {{ f.render_form_field(form.locality) }}\n+\n+                <div class=\"two fields\">\n+                    {{ f.render_form_field(form.administrative_area_level_1) }}\n+                    {{ f.render_form_field(form.postal_code) }}\n+                </div>\n+\n+                {{ f.render_form_field(form.submit) }}\n+\n+                {{ f.form_message(flashes['error'], header='Something went wrong.', class='error') }}\n+                {{ f.form_message(flashes['warning'], header='Check your email.', class='warning') }}\n+                {{ f.form_message(flashes['info'], header='Information', class='info') }}\n+                {{ f.form_message(flashes['success'], header='Success!', class='success') }}\n+\n+            {{ f.end_form(form) }}\n+        </div>\n+    </div>\n+\n+    <script>\n+        // Set onFocus attribute for autocomplete field and disabled attribute for address fields.\n+        $( document ).ready(function() {\n+            $(\"#address_autocomplete\").focus(geolocate())\n+\n+            for (var component in componentForm) {\n+                document.getElementById(component).disabled = true;\n+            }\n+        })\n+\n+\n+        // https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform\n+        // This example displays an address form, using the autocomplete feature\n+        // of the Google Places API to help users fill in the information.\n+\n+        var placeSearch, autocomplete;\n+        var componentForm = {\n+            street_number: 'short_name',\n+            route: 'long_name',\n+            locality: 'short_name',\n+            administrative_area_level_1: 'short_name',\n+            postal_code: 'short_name'\n+        };\n+\n+        function initAutocomplete() {\n+            // Create the autocomplete object, restricting the search to geographical\n+            // location types.\n+            autocomplete = new google.maps.places.Autocomplete(\n+                /** @type {!HTMLInputElement} */(document.getElementById('address_autocomplete')),\n+                {types: ['geocode']});\n+\n+            // When the user selects an address from the dropdown, populate the address\n+            // fields in the form.\n+            autocomplete.addListener('place_changed', fillInAddress);\n+        }\n+\n+        function fillInAddress() {\n+            // Get the place details from the autocomplete object.\n+            var place = autocomplete.getPlace();\n+\n+            for (var component in componentForm) {\n+                document.getElementById(component).value = '';\n+                document.getElementById(component).disabled = false;\n+            }\n+\n+            // Get each component of the address from the place details\n+            // and fill the corresponding field on the form.\n+            for (var i = 0; i < place.address_components.length; i++) {\n+            var addressType = place.address_components[i].types[0];\n+            if (componentForm[addressType]) {\n+                var val = place.address_components[i][componentForm[addressType]];\n+                document.getElementById(addressType).value = val;\n+            }\n+            }\n+        }\n+\n+        // Bias the autocomplete object to the user's geographical location,\n+        // as supplied by the browser's 'navigator.geolocation' object.\n+        function geolocate() {\n+            if (navigator.geolocation) {\n+            navigator.geolocation.getCurrentPosition(function(position) {","path":"app/templates/resources/add.html","position":110,"original_position":110,"commit_id":"62087d5e1e07247fe2517307761fe0871052d0d9","original_commit_id":"73f0962313fa3e6ac0fe3bb05796dd0f4654a89f","user":{"login":"aharelick","id":3924168,"avatar_url":"https://avatars.githubusercontent.com/u/3924168?v=3","gravatar_id":"","url":"https://api.github.com/users/aharelick","html_url":"https://github.com/aharelick","followers_url":"https://api.github.com/users/aharelick/followers","following_url":"https://api.github.com/users/aharelick/following{/other_user}","gists_url":"https://api.github.com/users/aharelick/gists{/gist_id}","starred_url":"https://api.github.com/users/aharelick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aharelick/subscriptions","organizations_url":"https://api.github.com/users/aharelick/orgs","repos_url":"https://api.github.com/users/aharelick/repos","events_url":"https://api.github.com/users/aharelick/events{/privacy}","received_events_url":"https://api.github.com/users/aharelick/received_events","type":"User","site_admin":false},"body":"indent this line","created_at":"2015-11-17T01:37:18Z","updated_at":"2015-11-17T01:37:18Z","html_url":"https://github.com/hack4impact/women-veterans-rock/pull/20#discussion_r45012206","pull_request_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls/20","_links":{"self":{"href":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls/comments/45012206"},"html":{"href":"https://github.com/hack4impact/women-veterans-rock/pull/20#discussion_r45012206"},"pull_request":{"href":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls/20","id":50665890,"html_url":"https://github.com/hack4impact/women-veterans-rock/pull/20","diff_url":"https://github.com/hack4impact/women-veterans-rock/pull/20.diff","patch_url":"https://github.com/hack4impact/women-veterans-rock/pull/20.patch","issue_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/issues/20","number":20,"state":"open","locked":false,"title":"Address autocomplete when adding resources","user":{"login":"yoninachmany","id":4250521,"avatar_url":"https://avatars.githubusercontent.com/u/4250521?v=3","gravatar_id":"","url":"https://api.github.com/users/yoninachmany","html_url":"https://github.com/yoninachmany","followers_url":"https://api.github.com/users/yoninachmany/followers","following_url":"https://api.github.com/users/yoninachmany/following{/other_user}","gists_url":"https://api.github.com/users/yoninachmany/gists{/gist_id}","starred_url":"https://api.github.com/users/yoninachmany/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoninachmany/subscriptions","organizations_url":"https://api.github.com/users/yoninachmany/orgs","repos_url":"https://api.github.com/users/yoninachmany/repos","events_url":"https://api.github.com/users/yoninachmany/events{/privacy}","received_events_url":"https://api.github.com/users/yoninachmany/received_events","type":"User","site_admin":false},"body":"r @aharelick @anoshaminai \r\n\r\n- Added Google Maps Place Autocomplete JS to template with API key from my account\r\n- Had to change form field names to match the schema of Google Maps\r\n- Had to alter the queries in the view file to reflect different form fields\r\n- Improved /resources/resource/<int:id> page fields\r\n- Potential issue: document.onLoad disables fields, but that can be annoying for users if they submit invalid form the first time\r\n<img width=\"1280\" alt=\"screen shot 2015-11-13 at 9 24 10 am\" src=\"https://cloud.githubusercontent.com/assets/4250521/11149568/9dc3308e-89f1-11e5-858a-1183101aa510.png\">\r\n<img width=\"1258\" alt=\"screen shot 2015-11-13 at 9 36 02 am\" src=\"https://cloud.githubusercontent.com/assets/4250521/11152232/5dfb0acc-89ff-11e5-9635-1dc55a44ce05.png\">\r\n<img width=\"1258\" alt=\"screen shot 2015-11-13 at 9 36 12 am\" src=\"https://cloud.githubusercontent.com/assets/4250521/11152231/5df875f0-89ff-11e5-9453-890f940fee60.png\">\r\n<img width=\"1257\" alt=\"screen shot 2015-11-13 at 9 54 56 am\" src=\"https://cloud.githubusercontent.com/assets/4250521/11152233/5ee7a3c8-89ff-11e5-83ad-88ad1ec69dc1.png\">\r\n\r\n\r\n\r\n","created_at":"2015-11-13T17:09:49Z","updated_at":"2015-11-17T01:37:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8b49ddd6f5fcba557d627f62c46a9135ba5db33","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls/20/commits","review_comments_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls/20/comments","review_comment_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/issues/20/comments","statuses_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/statuses/62087d5e1e07247fe2517307761fe0871052d0d9","head":{"label":"hack4impact:yoni-place-autocomplete","ref":"yoni-place-autocomplete","sha":"62087d5e1e07247fe2517307761fe0871052d0d9","user":{"login":"hack4impact","id":9021093,"avatar_url":"https://avatars.githubusercontent.com/u/9021093?v=3","gravatar_id":"","url":"https://api.github.com/users/hack4impact","html_url":"https://github.com/hack4impact","followers_url":"https://api.github.com/users/hack4impact/followers","following_url":"https://api.github.com/users/hack4impact/following{/other_user}","gists_url":"https://api.github.com/users/hack4impact/gists{/gist_id}","starred_url":"https://api.github.com/users/hack4impact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hack4impact/subscriptions","organizations_url":"https://api.github.com/users/hack4impact/orgs","repos_url":"https://api.github.com/users/hack4impact/repos","events_url":"https://api.github.com/users/hack4impact/events{/privacy}","received_events_url":"https://api.github.com/users/hack4impact/received_events","type":"Organization","site_admin":false},"repo":{"id":43617101,"name":"women-veterans-rock","full_name":"hack4impact/women-veterans-rock","owner":{"login":"hack4impact","id":9021093,"avatar_url":"https://avatars.githubusercontent.com/u/9021093?v=3","gravatar_id":"","url":"https://api.github.com/users/hack4impact","html_url":"https://github.com/hack4impact","followers_url":"https://api.github.com/users/hack4impact/followers","following_url":"https://api.github.com/users/hack4impact/following{/other_user}","gists_url":"https://api.github.com/users/hack4impact/gists{/gist_id}","starred_url":"https://api.github.com/users/hack4impact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hack4impact/subscriptions","organizations_url":"https://api.github.com/users/hack4impact/orgs","repos_url":"https://api.github.com/users/hack4impact/repos","events_url":"https://api.github.com/users/hack4impact/events{/privacy}","received_events_url":"https://api.github.com/users/hack4impact/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hack4impact/women-veterans-rock","description":"","fork":false,"url":"https://api.github.com/repos/hack4impact/women-veterans-rock","forks_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/forks","keys_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/teams","hooks_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/hooks","issue_events_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/issues/events{/number}","events_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/events","assignees_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/assignees{/user}","branches_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/branches{/branch}","tags_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/tags","blobs_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/git/refs{/sha}","trees_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/statuses/{sha}","languages_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/languages","stargazers_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/stargazers","contributors_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/contributors","subscribers_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/subscribers","subscription_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/subscription","commits_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/commits{/sha}","git_commits_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/git/commits{/sha}","comments_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/comments{/number}","issue_comment_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/issues/comments{/number}","contents_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/contents/{+path}","compare_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/merges","archive_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/downloads","issues_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/issues{/number}","pulls_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls{/number}","milestones_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/milestones{/number}","notifications_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/labels{/name}","releases_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/releases{/id}","created_at":"2015-10-03T22:21:16Z","updated_at":"2015-11-13T18:13:53Z","pushed_at":"2015-11-17T01:36:45Z","git_url":"git://github.com/hack4impact/women-veterans-rock.git","ssh_url":"git@github.com:hack4impact/women-veterans-rock.git","clone_url":"https://github.com/hack4impact/women-veterans-rock.git","svn_url":"https://github.com/hack4impact/women-veterans-rock","homepage":null,"size":812,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":9,"forks":1,"open_issues":9,"watchers":3,"default_branch":"master"}},"base":{"label":"hack4impact:yoni-add-review","ref":"yoni-add-review","sha":"7f5f63aba8297fff01a5911a009be3bbe1c21076","user":{"login":"hack4impact","id":9021093,"avatar_url":"https://avatars.githubusercontent.com/u/9021093?v=3","gravatar_id":"","url":"https://api.github.com/users/hack4impact","html_url":"https://github.com/hack4impact","followers_url":"https://api.github.com/users/hack4impact/followers","following_url":"https://api.github.com/users/hack4impact/following{/other_user}","gists_url":"https://api.github.com/users/hack4impact/gists{/gist_id}","starred_url":"https://api.github.com/users/hack4impact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hack4impact/subscriptions","organizations_url":"https://api.github.com/users/hack4impact/orgs","repos_url":"https://api.github.com/users/hack4impact/repos","events_url":"https://api.github.com/users/hack4impact/events{/privacy}","received_events_url":"https://api.github.com/users/hack4impact/received_events","type":"Organization","site_admin":false},"repo":{"id":43617101,"name":"women-veterans-rock","full_name":"hack4impact/women-veterans-rock","owner":{"login":"hack4impact","id":9021093,"avatar_url":"https://avatars.githubusercontent.com/u/9021093?v=3","gravatar_id":"","url":"https://api.github.com/users/hack4impact","html_url":"https://github.com/hack4impact","followers_url":"https://api.github.com/users/hack4impact/followers","following_url":"https://api.github.com/users/hack4impact/following{/other_user}","gists_url":"https://api.github.com/users/hack4impact/gists{/gist_id}","starred_url":"https://api.github.com/users/hack4impact/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hack4impact/subscriptions","organizations_url":"https://api.github.com/users/hack4impact/orgs","repos_url":"https://api.github.com/users/hack4impact/repos","events_url":"https://api.github.com/users/hack4impact/events{/privacy}","received_events_url":"https://api.github.com/users/hack4impact/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hack4impact/women-veterans-rock","description":"","fork":false,"url":"https://api.github.com/repos/hack4impact/women-veterans-rock","forks_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/forks","keys_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/teams","hooks_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/hooks","issue_events_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/issues/events{/number}","events_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/events","assignees_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/assignees{/user}","branches_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/branches{/branch}","tags_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/tags","blobs_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/git/refs{/sha}","trees_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/statuses/{sha}","languages_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/languages","stargazers_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/stargazers","contributors_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/contributors","subscribers_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/subscribers","subscription_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/subscription","commits_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/commits{/sha}","git_commits_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/git/commits{/sha}","comments_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/comments{/number}","issue_comment_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/issues/comments{/number}","contents_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/contents/{+path}","compare_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/merges","archive_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/downloads","issues_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/issues{/number}","pulls_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls{/number}","milestones_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/milestones{/number}","notifications_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/labels{/name}","releases_url":"https://api.github.com/repos/hack4impact/women-veterans-rock/releases{/id}","created_at":"2015-10-03T22:21:16Z","updated_at":"2015-11-13T18:13:53Z","pushed_at":"2015-11-17T01:36:45Z","git_url":"git://github.com/hack4impact/women-veterans-rock.git","ssh_url":"git@github.com:hack4impact/women-veterans-rock.git","clone_url":"https://github.com/hack4impact/women-veterans-rock.git","svn_url":"https://github.com/hack4impact/women-veterans-rock","homepage":null,"size":812,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":9,"forks":1,"open_issues":9,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls/20"},"html":{"href":"https://github.com/hack4impact/women-veterans-rock/pull/20"},"issue":{"href":"https://api.github.com/repos/hack4impact/women-veterans-rock/issues/20"},"comments":{"href":"https://api.github.com/repos/hack4impact/women-veterans-rock/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hack4impact/women-veterans-rock/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/hack4impact/women-veterans-rock/statuses/62087d5e1e07247fe2517307761fe0871052d0d9"}}}}