-
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.
Merge pull request #2549 from alphagov/557-History-notes-tab_Update-i…
…mportant-note 557 history notes tab update important note https://trello.com/c/8Mrwt4nG The changes have added an Update Important Note function with button, to the side bar, visible from the History and Notes tab
- Loading branch information
Showing
10 changed files
with
267 additions
and
11 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
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,9 @@ | ||
<% note_author_name = User.find_by(id: @edition.important_note&.requester_id).name %> | ||
<% note_date = @edition.important_note&.created_at&.strftime("%d %B %Y") %> | ||
<% note_details = @edition.important_note&.comment %> | ||
<%= render "govuk_publishing_components/components/notice", { | ||
description_govspeak: | ||
sanitize("<p class='govuk-body govuk-!-font-weight-bold govuk-!-text-break-word'>#{h(note_details)}</p>") + | ||
sanitize("<p class='govuk-body-m'>#{h(note_author_name)} added an important note on #{h(note_date)}</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
38 changes: 38 additions & 0 deletions
38
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,38 @@ | ||
<% @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> | ||
<p class="govuk-body"> | ||
To delete the important note, clear any comments and select ‘Save’. | ||
</p> | ||
|
||
<%= form_for(:note, :url=> notes_path) do %> | ||
<%= hidden_field_tag :edition_id, @edition.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
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