From f68e2e22a32f022421be37c72b7ed425c9e6e6a5 Mon Sep 17 00:00:00 2001 From: mystyrust <91500391+mystyrust@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:19:16 -0600 Subject: [PATCH] AO3-6768 update browser page title in drafts page (#4915) * AO3-6768 update page subtitle in the drafts page * AO3-6768 i18n format, reference in cucumber test, single quotes * AO3-6768 pr feedback: double quotes, relative pathing for i18n text * AO3-6768 normalize i18n en file * AO3-6768 move cucumber step --- app/controllers/works_controller.rb | 2 ++ config/locales/controllers/en.yml | 3 +++ features/works/work_drafts.feature | 1 + 3 files changed, 6 insertions(+) diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index d8c80f14a64..d87f5fb0596 100755 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -159,6 +159,8 @@ def drafts redirect_to logged_in? ? user_path(current_user) : new_user_session_path return end + + @page_subtitle = t(".page_title", username: @user.login) if params[:pseud_id] @pseud = @user.pseuds.find_by(name: params[:pseud_id]) diff --git a/config/locales/controllers/en.yml b/config/locales/controllers/en.yml index 9599cd0cc5d..647293d6d83 100644 --- a/config/locales/controllers/en.yml +++ b/config/locales/controllers/en.yml @@ -117,3 +117,6 @@ en: ban_notice_html: Your account has been banned. You are not permitted to add or edit archive content. Please %{contact_abuse_link} for more information. contact_abuse: contact Abuse suspension_notice_html: Your account has been suspended until %{suspended_until}. You may not add or edit content until your suspension has been resolved. Please %{contact_abuse_link} for more information. + works: + drafts: + page_title: "%{username} - Drafts" diff --git a/features/works/work_drafts.feature b/features/works/work_drafts.feature index 168daf7753d..d3608c9d658 100644 --- a/features/works/work_drafts.feature +++ b/features/works/work_drafts.feature @@ -69,6 +69,7 @@ Feature: Work Drafts Then I should see "Drafts (1)" When I follow "Drafts (1)" Then I should see "draft to post" + And the page title should include "drafter - Drafts" And I should see "Post Draft" within "#main .own.work.blurb .actions" And I should see "Delete Draft" within "#main .own.work.blurb .actions" When I follow "Post Draft"