{"action":"created","comment":{"url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls/comments/66807932","id":66807932,"diff_hunk":"@@ -0,0 +1,58 @@\n+{% extends \"layout.html\" %}\n+\n+{% block page_title %}\n+  Example - Passing data\n+{% endblock %}\n+\n+{% block content %}\n+<main id=\"content\" role=\"main\">\n+\n+  {% include \"includes/breadcrumb_examples.html\" %}\n+\n+  <div class=\"grid-row\">\n+    <div class=\"column-two-thirds\">\n+\n+      <h1 class=\"heading-xlarge\">\n+        Passing data from page to page\n+      </h1>\n+\n+      <p>\n+        You may want to use or display data a user has entered over a few screens. The kit automatically stores all data entered, so you can show it later.\n+      </p>\n+\n+      <p>\n+        To clear the data (for example at the end of a user research session) click the \"Clear data\" link in the footer.\n+      </p>\n+\n+      <p>\n+        You can see the code for this example here:\n+      </p>\n+\n+      <pre>\n+<div class=\"code\">\n+  /app/views/examples/pass-data\n+  ","path":"app/views/examples/pass-data/index.html","position":34,"original_position":34,"commit_id":"8cea249093c47dae31cf7c2bdaaa94e912d569f8","original_commit_id":"8cea249093c47dae31cf7c2bdaaa94e912d569f8","user":{"login":"edwardhorsford","id":2204224,"avatar_url":"https://avatars.githubusercontent.com/u/2204224?v=3","gravatar_id":"","url":"https://api.github.com/users/edwardhorsford","html_url":"https://github.com/edwardhorsford","followers_url":"https://api.github.com/users/edwardhorsford/followers","following_url":"https://api.github.com/users/edwardhorsford/following{/other_user}","gists_url":"https://api.github.com/users/edwardhorsford/gists{/gist_id}","starred_url":"https://api.github.com/users/edwardhorsford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edwardhorsford/subscriptions","organizations_url":"https://api.github.com/users/edwardhorsford/orgs","repos_url":"https://api.github.com/users/edwardhorsford/repos","events_url":"https://api.github.com/users/edwardhorsford/events{/privacy}","received_events_url":"https://api.github.com/users/edwardhorsford/received_events","type":"User","site_admin":false},"body":"unneeded linebreak","created_at":"2016-06-13T15:04:21Z","updated_at":"2016-06-13T15:04:21Z","html_url":"https://github.com/alphagov/govuk_prototype_kit/pull/214#discussion_r66807932","pull_request_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls/214","_links":{"self":{"href":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls/comments/66807932"},"html":{"href":"https://github.com/alphagov/govuk_prototype_kit/pull/214#discussion_r66807932"},"pull_request":{"href":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls/214"}}},"pull_request":{"url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls/214","id":73082722,"html_url":"https://github.com/alphagov/govuk_prototype_kit/pull/214","diff_url":"https://github.com/alphagov/govuk_prototype_kit/pull/214.diff","patch_url":"https://github.com/alphagov/govuk_prototype_kit/pull/214.patch","issue_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/issues/214","number":214,"state":"open","locked":false,"title":"Auto data session 3","user":{"login":"joelanman","id":1132904,"avatar_url":"https://avatars.githubusercontent.com/u/1132904?v=3","gravatar_id":"","url":"https://api.github.com/users/joelanman","html_url":"https://github.com/joelanman","followers_url":"https://api.github.com/users/joelanman/followers","following_url":"https://api.github.com/users/joelanman/following{/other_user}","gists_url":"https://api.github.com/users/joelanman/gists{/gist_id}","starred_url":"https://api.github.com/users/joelanman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelanman/subscriptions","organizations_url":"https://api.github.com/users/joelanman/orgs","repos_url":"https://api.github.com/users/joelanman/repos","events_url":"https://api.github.com/users/joelanman/events{/privacy}","received_events_url":"https://api.github.com/users/joelanman/received_events","type":"User","site_admin":false},"body":"This version of automatically storing and showing data across pages does not rely on macros, but instead using the `checked` function directly (see examples below). I'm not sure it's as user-friendly as the version with macros, but it may take a while to finalise our approach to macros.\r\n\r\n# Usage\r\n\r\nThis will make the kit automatically store all data from forms, for use later in your prototype.\r\n\r\nFor example if you have an input like this:\r\n\r\n```\r\n<input name=\"firstName\">\r\n```\r\n\r\nYou can put this on the next page, or any other page:\r\n\r\n```\r\n<p>Hello {{firstName}}</p>\r\n```\r\n\r\n## Population\r\n\r\nTo populate a text field with the value a user entered is simple:\r\n\r\n```\r\n<input name=\"firstName\" value=\"{{firstName}}\">\r\n```\r\n\r\nTo set radios or checkboxes use this:\r\n```\r\n{{ checked(name, value) }}\r\n```\r\n\r\nUsing the name and value of the input. For example:\r\n\r\n```\r\n<input type=\"radio\" name=\"over18\" value=\"Yes\" {{checked(\"over18\",\"Yes\")}}>\r\n\r\n<input type=\"checkbox\" name=\"sendSpam\" value=\"No\" {{checked(\"sendSpam\",\"No\")}}>\r\n\r\n```","created_at":"2016-06-08T16:55:18Z","updated_at":"2016-06-13T15:04:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4765f11cd7020f7ffcf1b12e5285bcedcde6ee34","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls/214/commits","review_comments_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls/214/comments","review_comment_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/issues/214/comments","statuses_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/statuses/8cea249093c47dae31cf7c2bdaaa94e912d569f8","head":{"label":"alphagov:auto-data-session-3","ref":"auto-data-session-3","sha":"8cea249093c47dae31cf7c2bdaaa94e912d569f8","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":21242339,"name":"govuk_prototype_kit","full_name":"alphagov/govuk_prototype_kit","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/govuk_prototype_kit","description":"Quick prototyping tool for UK government digital services","fork":false,"url":"https://api.github.com/repos/alphagov/govuk_prototype_kit","forks_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/forks","keys_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/teams","hooks_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/hooks","issue_events_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/events","assignees_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/tags","blobs_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/languages","stargazers_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/stargazers","contributors_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/contributors","subscribers_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/subscribers","subscription_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/subscription","commits_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/merges","archive_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/downloads","issues_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/deployments","created_at":"2014-06-26T13:54:09Z","updated_at":"2016-06-12T07:31:09Z","pushed_at":"2016-06-13T13:21:13Z","git_url":"git://github.com/alphagov/govuk_prototype_kit.git","ssh_url":"git@github.com:alphagov/govuk_prototype_kit.git","clone_url":"https://github.com/alphagov/govuk_prototype_kit.git","svn_url":"https://github.com/alphagov/govuk_prototype_kit","homepage":"","size":13160,"stargazers_count":57,"watchers_count":57,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":30,"forks":53,"open_issues":30,"watchers":57,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"4d476b426e3e9543fd6b436d021383b49d228fe8","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":21242339,"name":"govuk_prototype_kit","full_name":"alphagov/govuk_prototype_kit","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/govuk_prototype_kit","description":"Quick prototyping tool for UK government digital services","fork":false,"url":"https://api.github.com/repos/alphagov/govuk_prototype_kit","forks_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/forks","keys_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/teams","hooks_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/hooks","issue_events_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/events","assignees_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/tags","blobs_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/languages","stargazers_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/stargazers","contributors_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/contributors","subscribers_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/subscribers","subscription_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/subscription","commits_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/merges","archive_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/downloads","issues_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/releases{/id}","deployments_url":"https://api.github.com/repos/alphagov/govuk_prototype_kit/deployments","created_at":"2014-06-26T13:54:09Z","updated_at":"2016-06-12T07:31:09Z","pushed_at":"2016-06-13T13:21:13Z","git_url":"git://github.com/alphagov/govuk_prototype_kit.git","ssh_url":"git@github.com:alphagov/govuk_prototype_kit.git","clone_url":"https://github.com/alphagov/govuk_prototype_kit.git","svn_url":"https://github.com/alphagov/govuk_prototype_kit","homepage":"","size":13160,"stargazers_count":57,"watchers_count":57,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":30,"forks":53,"open_issues":30,"watchers":57,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls/214"},"html":{"href":"https://github.com/alphagov/govuk_prototype_kit/pull/214"},"issue":{"href":"https://api.github.com/repos/alphagov/govuk_prototype_kit/issues/214"},"comments":{"href":"https://api.github.com/repos/alphagov/govuk_prototype_kit/issues/214/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls/214/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alphagov/govuk_prototype_kit/pulls/214/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/govuk_prototype_kit/statuses/8cea249093c47dae31cf7c2bdaaa94e912d569f8"}}}}
{"actor":{"display_login":"edwardhorsford"}}