{"action":"created","comment":{"url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/comments/193050549","pull_request_review_id":125942594,"id":193050549,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MzA1MDU0OQ==","diff_hunk":"@@ -703,14 +703,19 @@ def _get_front_end_navigation(answer_store, current_location, metadata, routing_\n     return None\n \n \n-def get_page_title_for_location(schema, current_location):\n+def _get_question_title_for_page(first_question, context):\n+    return first_question['title'] if first_question.get('title') is not None else context['question_titles'][first_question['id']]","path":"app/views/questionnaire.py","position":6,"original_position":6,"commit_id":"79c4a6ac3463782386ccd68937769df287dbf7be","original_commit_id":"79c4a6ac3463782386ccd68937769df287dbf7be","user":{"login":"shahi645","id":22025926,"node_id":"MDQ6VXNlcjIyMDI1OTI2","avatar_url":"https://avatars0.githubusercontent.com/u/22025926?v=4","gravatar_id":"","url":"https://api.github.com/users/shahi645","html_url":"https://github.com/shahi645","followers_url":"https://api.github.com/users/shahi645/followers","following_url":"https://api.github.com/users/shahi645/following{/other_user}","gists_url":"https://api.github.com/users/shahi645/gists{/gist_id}","starred_url":"https://api.github.com/users/shahi645/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shahi645/subscriptions","organizations_url":"https://api.github.com/users/shahi645/orgs","repos_url":"https://api.github.com/users/shahi645/repos","events_url":"https://api.github.com/users/shahi645/events{/privacy}","received_events_url":"https://api.github.com/users/shahi645/received_events","type":"User","site_admin":false},"body":"its tested in `test_questionnaire`\r\n","created_at":"2018-06-05T12:20:44Z","updated_at":"2018-06-05T12:20:44Z","html_url":"https://github.com/ONSdigital/eq-survey-runner/pull/1606#discussion_r193050549","pull_request_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/1606","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/comments/193050549"},"html":{"href":"https://github.com/ONSdigital/eq-survey-runner/pull/1606#discussion_r193050549"},"pull_request":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/1606"}},"in_reply_to_id":193039707},"pull_request":{"url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/1606","id":190568030,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwNTY4MDMw","html_url":"https://github.com/ONSdigital/eq-survey-runner/pull/1606","diff_url":"https://github.com/ONSdigital/eq-survey-runner/pull/1606.diff","patch_url":"https://github.com/ONSdigital/eq-survey-runner/pull/1606.patch","issue_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/1606","number":1606,"state":"open","locked":false,"title":"Allow for different versions of a question title depending on a conditional question","user":{"login":"shahi645","id":22025926,"node_id":"MDQ6VXNlcjIyMDI1OTI2","avatar_url":"https://avatars0.githubusercontent.com/u/22025926?v=4","gravatar_id":"","url":"https://api.github.com/users/shahi645","html_url":"https://github.com/shahi645","followers_url":"https://api.github.com/users/shahi645/followers","following_url":"https://api.github.com/users/shahi645/following{/other_user}","gists_url":"https://api.github.com/users/shahi645/gists{/gist_id}","starred_url":"https://api.github.com/users/shahi645/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shahi645/subscriptions","organizations_url":"https://api.github.com/users/shahi645/orgs","repos_url":"https://api.github.com/users/shahi645/repos","events_url":"https://api.github.com/users/shahi645/events{/privacy}","received_events_url":"https://api.github.com/users/shahi645/received_events","type":"User","site_admin":false},"body":"### What is the context of this PR?\r\nWe have a use case in SR where the user answers a proxy question, e.g. \"Who are you answering on behalf of?\". This means that we want subsequent questions to be asked differently depending on the users answers. Previously this meant using routing rules and having a lot of excess schema.\r\nThis PR introduces a `titles` object to question, this can be used instead of a single `title` value. The titles object consists of a `default value` with is a single title, with optional extra `titles` that are accompanied with a `when` rule (`when` functionality already exists in routing rules, so we have re-used that code). When the question title is rendered each `when clause` is evaluated and if true returns its given `title`. If no `when clauses` evaluate true then the `default title` is returned and rendered.\r\n\r\n**UPDATE**\r\nWe have added changes that now mean all getting of question titles are handled by our templating utils and template logic on selecting the question title is handled in our jinja filters.\r\n\r\n\r\n***NOTE***\r\nCurrently we have a bug with repeating groups that are as follows: \r\n- The summary only renders the latest group instance of a repeating group. (existing bug)\r\n\r\n- When evaluating a `when` clause in a repeating group greater than `group_instance` **0** it defaults to 0 `group_instance` for summary rendering, as summary has no knowledge of which group instance the question/answer has come from.\r\n\r\n### How to review \r\nRun our test_schemas created and see if the changes are correct. \r\nAlso does the code changes make sense as to where they are. \r\n","created_at":"2018-05-25T12:06:02Z","updated_at":"2018-06-05T12:20:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d2f82f82e10ee376cbbbaf6699524c4ecc89375","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/1606/commits","review_comments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/1606/comments","review_comment_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/1606/comments","statuses_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/statuses/79c4a6ac3463782386ccd68937769df287dbf7be","head":{"label":"ONSdigital:eq-1990-different-versions-of-question-titles","ref":"eq-1990-different-versions-of-question-titles","sha":"79c4a6ac3463782386ccd68937769df287dbf7be","user":{"login":"ONSdigital","id":6865137,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMzc=","avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":49205589,"node_id":"MDEwOlJlcG9zaXRvcnk0OTIwNTU4OQ==","name":"eq-survey-runner","full_name":"ONSdigital/eq-survey-runner","owner":{"login":"ONSdigital","id":6865137,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMzc=","avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/eq-survey-runner","description":"eQ Survey Runner","fork":false,"url":"https://api.github.com/repos/ONSdigital/eq-survey-runner","forks_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/forks","keys_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/teams","hooks_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/events","assignees_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/tags","blobs_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/subscription","commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/merges","archive_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/downloads","issues_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/deployments","created_at":"2016-01-07T13:15:26Z","updated_at":"2018-06-05T08:58:40Z","pushed_at":"2018-06-05T11:05:05Z","git_url":"git://github.com/ONSdigital/eq-survey-runner.git","ssh_url":"git@github.com:ONSdigital/eq-survey-runner.git","clone_url":"https://github.com/ONSdigital/eq-survey-runner.git","svn_url":"https://github.com/ONSdigital/eq-survey-runner","homepage":null,"size":14175,"stargazers_count":10,"watchers_count":10,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":23,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":23,"watchers":10,"default_branch":"master"}},"base":{"label":"ONSdigital:master","ref":"master","sha":"3adc7490ae100ac3fc37897da57dc5543cc77cb7","user":{"login":"ONSdigital","id":6865137,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMzc=","avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":49205589,"node_id":"MDEwOlJlcG9zaXRvcnk0OTIwNTU4OQ==","name":"eq-survey-runner","full_name":"ONSdigital/eq-survey-runner","owner":{"login":"ONSdigital","id":6865137,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NjUxMzc=","avatar_url":"https://avatars0.githubusercontent.com/u/6865137?v=4","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/eq-survey-runner","description":"eQ Survey Runner","fork":false,"url":"https://api.github.com/repos/ONSdigital/eq-survey-runner","forks_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/forks","keys_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/teams","hooks_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/events","assignees_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/tags","blobs_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/subscription","commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/merges","archive_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/downloads","issues_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/deployments","created_at":"2016-01-07T13:15:26Z","updated_at":"2018-06-05T08:58:40Z","pushed_at":"2018-06-05T11:05:05Z","git_url":"git://github.com/ONSdigital/eq-survey-runner.git","ssh_url":"git@github.com:ONSdigital/eq-survey-runner.git","clone_url":"https://github.com/ONSdigital/eq-survey-runner.git","svn_url":"https://github.com/ONSdigital/eq-survey-runner","homepage":null,"size":14175,"stargazers_count":10,"watchers_count":10,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":23,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":4,"open_issues":23,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/1606"},"html":{"href":"https://github.com/ONSdigital/eq-survey-runner/pull/1606"},"issue":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/1606"},"comments":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/1606/comments"},"review_comments":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/1606/comments"},"review_comment":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/1606/commits"},"statuses":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/statuses/79c4a6ac3463782386ccd68937769df287dbf7be"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"shahi645"}}