-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Update Important Note functionality
- Add cancel link and important note information. - Add hidden field tag for note type. - Conditionally render _important_note partial if note exists - Include original important note text in update important note text area
- Loading branch information
1 parent
dcfa5c9
commit 9c7f484
Showing
8 changed files
with
143 additions
and
2 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
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,6 @@ | ||
<%= render "govuk_publishing_components/components/notice", { | ||
description_govspeak: sanitize("<p class='govuk-body govuk-!-font-weight-bold govuk-!-text-break-word'>#{h(@edition.important_note&.comment)}</p>") + | ||
sanitize("<p class='govuk-body-m'>#{h(User.find_by(id: @edition.important_note&.requester_id)&.name)} added an important note on | ||
#{h(@edition.important_note&.created_at&.strftime("%d %B %Y"))}</p>"), | ||
show_banner_title: true | ||
} %> |
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
33 changes: 33 additions & 0 deletions
33
app/views/editions/secondary_nav_tabs/update_important_note.html.erb
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,33 @@ | ||
<% @edition = @resource %> | ||
<% content_for :title_context, @edition.title %> | ||
<% content_for :page_title, "Update important note" %> | ||
<% content_for :title, "Update important note" %> | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<p class="govuk-body">Add important notes that anyone who works on this edition needs to see, eg “(Doesn’t) need fact check, don’t publish.”. | ||
Each edition can have only one important note at a time.</p> | ||
|
||
<%= form_for(:note, :url=> notes_path) do |f| %> | ||
<%= hidden_field_tag :edition_id, resource.id %> | ||
<%= hidden_field_tag "note[type]", Action::IMPORTANT_NOTE %> | ||
|
||
<%= render "govuk_publishing_components/components/textarea", { | ||
label: { | ||
heading_size: "m", | ||
text: "Important note", | ||
}, | ||
name: "note[comment]", | ||
rows: 14, | ||
value: @edition.important_note&.comment, | ||
} %> | ||
|
||
<div class="govuk-button-group"> | ||
<%= render "govuk_publishing_components/components/button", { | ||
text: "Save", | ||
} %> | ||
<%= link_to("Cancel", history_edition_path, class: "govuk-link govuk-link--no-visited-state") %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> |
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
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
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
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