-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathnew.html.erb
More file actions
33 lines (26 loc) · 1.3 KB
/
new.html.erb
File metadata and controls
33 lines (26 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<% set_page_title(title_with_error_prefix(t('page_titles.declaration'), @declaration_input.errors.present?)) %>
<% content_for :back_link, govuk_back_link_to(form_path(@declaration_input.form), t("back_link.form_create")) %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<%= form_with(model: @declaration_input, url: declaration_create_path(@declaration_input.form)) do |f| %>
<% if @declaration_input&.errors&.present? %>
<%= f.govuk_error_summary %>
<% end %>
<h1 class="govuk-heading-l">
<span class="govuk-caption-l"><%= @declaration_input.form.name %></span>
<%= t("page_titles.declaration") %>
</h1>
<%= t("declaration_input.new.body_html") %>
<%= render MarkdownEditorComponent::View.new(:declaration_markdown,
form_builder: f,
render_preview_path: declaration_render_preview_path(@declaration_input.form.id),
preview_html: @preview_html,
form_model: @declaration_input,
label: "Enter a declaration for people to agree to (optional)",
hint: nil,
allow_headings: true) %>
<%= render MarkCompleteComponent::View.new(generate_form: false, form_builder: f, form_model: @declaration_input) %>
<%= f.govuk_submit "Save and continue" %>
<% end %>
</div>
</div>