Skip to content

Commit

Permalink
Add context to withdraw content
Browse files Browse the repository at this point in the history
Should content be [withdrawn] this also adds the "context_label" or grey text to the title.
  • Loading branch information
Chris Yoong committed Nov 26, 2021
1 parent b277098 commit 5c3a7b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/presenters/content_item/withdrawable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def withdrawn?
end

def page_title
withdrawn? ? "[Withdrawn] #{title}" : title
withdrawn? ? "[Withdrawn] #{withdrawal_context_title}: #{title}" : title
end

def withdrawal_notice_component
Expand All @@ -29,6 +29,10 @@ def withdrawal_notice_title
"This #{withdrawal_notice_context.downcase} was withdrawn on #{withdrawal_notice_time}".html_safe
end

def withdrawal_context_title
I18n.t("content_item.schema_name.#{document_type}", count: 1, locale: :en)
end

def withdrawal_notice_context
I18n.t("content_item.schema_name.#{schema_name}", count: 1, locale: :en)
end
Expand Down

0 comments on commit 5c3a7b4

Please sign in to comment.