|
1 | 1 | <%# TODO: route_number is hardcoded as 1 here because we know there can be only two conditions. It will need to change in the future %> |
| 2 | +<%# https://trello.com/c/BfkZEIgM/3446-set-route-count-dynamically-instead-of-hard-coding-it %> |
2 | 3 | <% set_page_title(title_with_error_prefix(t('page_titles.routing_page_edit', question_number: condition_input.page.position, route_number: 1), condition_input.errors&.any?)) %> |
3 | 4 | <% content_for :back_link, govuk_back_link_to(show_routes_path(condition_input.form.id, page_id: condition_input.page.id), t(".back_link", question_number: condition_input.page.position)) %> |
4 | 5 |
|
|
30 | 31 | <option value=<%= option.id %> <% if condition_input.record.goto_page_id == option.id || (condition_input.record.skip_to_end? && option.id == "check_your_answers") %>selected<% end %>> |
31 | 32 | <%= option.question_text %> |
32 | 33 | </option> |
33 | | - <% end %> |
34 | | - <% unless condition_input.secondary_skip? %> |
35 | | - <optgroup label="<%= I18n.t("page_conditions.exit_page_label") %>"> |
36 | | - <% if condition_input.record.exit_page? %> |
37 | | - <option value="exit_page" <% if condition_input.record.exit_page? %>selected<% end %>> |
| 34 | + <% end %> |
| 35 | + <% unless condition_input.secondary_skip? %> |
| 36 | + <optgroup label="<%= I18n.t("page_conditions.exit_page_label") %>"> |
| 37 | + <% if condition_input.record.exit_page? %> |
| 38 | + <option value="exit_page" <% if condition_input.record.exit_page? %>selected<% end %>> |
38 | 39 | <%= condition_input.record.exit_page_heading %> |
39 | 40 | </option> |
40 | | - <% else %> |
41 | | - <option value="create_exit_page"> |
42 | | - <%= I18n.t("page_conditions.exit_page") %> |
43 | | - </option> |
| 41 | + <% else %> |
| 42 | + <option value="create_exit_page"> |
| 43 | + <%= I18n.t("page_conditions.exit_page") %> |
| 44 | + </option> |
| 45 | + <% end %> |
| 46 | + </optgroup> |
44 | 47 | <% end %> |
45 | | - </optgroup> |
46 | | - <% end %> |
47 | | - <% end %> |
| 48 | + <% end %> |
48 | 49 |
|
49 | | - <% if condition_input.record.exit_page? %> |
50 | | - <p class="govuk-body"> |
51 | | - <%= govuk_link_to t("page_conditions.edit_exit_page", exit_page_heading: condition_input.record.exit_page_heading), edit_exit_page_path(condition_input.form.id, condition_input.page.id, condition_input.record.id) %> |
52 | | - </p> |
53 | | - <% end %> |
| 50 | + <% if condition_input.record.exit_page? %> |
| 51 | + <p class="govuk-body"> |
| 52 | + <%= govuk_link_to t("page_conditions.edit_exit_page", exit_page_heading: condition_input.record.exit_page_heading), edit_exit_page_path(condition_input.form.id, condition_input.page.id, condition_input.record.id) %> |
| 53 | + </p> |
| 54 | + <% end %> |
54 | 55 |
|
55 | | - <%= f.govuk_submit t("save_and_continue") do |
| 56 | + <%= f.govuk_submit t("save_and_continue") do |
56 | 57 | govuk_button_link_to "Delete route", delete_condition_path(condition_input.form.id, condition_input.page.id, condition_input.record.id), warning: true |
57 | 58 | end %> |
58 | | - <% end %> |
59 | | - </div> |
60 | | -</div> |
| 59 | + <% end %> |
| 60 | + </div> |
| 61 | + </div> |
0 commit comments