-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit contains the implementation of the front-end of the ticke…
…t. Here we are handling multiple radio buttons and ensuring the data is collected by the form correctly.
- Loading branch information
1 parent
51d2eee
commit fba0bbb
Showing
1 changed file
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<% content_for :page_title, "New document" %> | ||
<% content_for :title, "New document" %> | ||
<% content_for :title_margin_bottom, 6 %> | ||
|
||
<% | ||
new_document_radio_items = [ | ||
{ | ||
value: "call-for-evidence", | ||
text: "Call for evidence", | ||
bold: true, | ||
hint_text: "Use this to request people's views when it is not a consultation.", | ||
}, | ||
{ | ||
value: "case-study", | ||
text: "Case study", | ||
bold: true, | ||
hint_text: "Use this to share real examples that help users understand a process or an important" + | ||
" aspect of government policy covered on GOV.UK.", | ||
}, | ||
{ | ||
value: "consultation", | ||
text: "Consultation", | ||
bold: true, | ||
hint_text: "Use this for documents requiring requiring a collective agreement across government, and requests for people's view on a question with an outcome.", | ||
}, | ||
{ | ||
value: "detailed-guide", | ||
text: "Detailed guide", | ||
bold: true, | ||
hint_text: "Use this to tell users the steps they need to take to complete a clearly defined task. They are usually aimed at specialist or professional audiences." | ||
}, | ||
{ | ||
value: "document-collection", | ||
text: "Document collection", | ||
bold: true, | ||
hint_text: "Use this to group related documents on a single page for a specific audience or around a specific theme.", | ||
}, | ||
{ | ||
value: "fatality-notice", | ||
text: "Fatality notice", | ||
bold: true, | ||
hint_text: "Use this to provide official confirmation of the death of a member of the armed forces while on deployment. Ministry of Defence only.", | ||
}, | ||
{ | ||
value: "news-article", | ||
text: "News article", | ||
bold: true, | ||
hint_text: "Use this for news story, press release, government response, and world news story.", | ||
}, | ||
{ | ||
value: "publication", | ||
text: "Publication", | ||
bold: true, | ||
hint_text: "Use this for standalone government documents, white papers, strategy documents, and reports.", | ||
}, | ||
{ | ||
value: "speech", | ||
text: "Speech", | ||
bold: true, | ||
hint_text: "Use this for speeches by ministers or other named spokespeople, and ministerial statements to Parliament.", | ||
}, | ||
{ | ||
value: "statistical-data-set", | ||
text: "Statistical data set", | ||
bold: true, | ||
hint_text: "Use this for data that you publish monthly or more often without analysis.", | ||
}, | ||
] | ||
%> | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<%= form_with url: admin_new_document_options_path do %> | ||
<%= render "govuk_publishing_components/components/radio", { | ||
name: "new_document_options", | ||
id: "new_document_options", | ||
items: new_document_radio_items, | ||
} %> | ||
<%= render "govuk_publishing_components/components/inset_text", { | ||
text: sanitize("Check the #{link_to("content types guidance", admin_whats_new_path, {class: "govuk-link"})}" + | ||
" if you need more help in choosing a content type.") | ||
} %> | ||
|
||
<div class="govuk-button-group"> | ||
<%= render "govuk_publishing_components/components/button", { | ||
text: "Next", | ||
data_attributes: { | ||
module: "gem-track-click", | ||
"track-category": "form-button", | ||
"track-action": "new-document-radio-options-next-button", | ||
"track-label": "Next", | ||
}, | ||
} %> | ||
|
||
<%= link_to("Cancel", root_path, class: "govuk-link govuk-link--no-visited-state") %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> |