From 034d1064f93123f7da6440e744088d32d0b7fe52 Mon Sep 17 00:00:00 2001 From: mystyrust Date: Mon, 16 Sep 2024 22:04:04 -0500 Subject: [PATCH 1/5] AO3-6768 update page subtitle in the drafts page --- app/controllers/works_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index 60a733be36..08f05c25a7 100755 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -161,6 +161,8 @@ def drafts redirect_to logged_in? ? user_path(current_user) : new_user_session_path return end + + @page_subtitle = ts("%{username} - Drafts", username: @user.login) if params[:pseud_id] @pseud = @user.pseuds.find_by(name: params[:pseud_id]) From b1e42a34a7f87533e2c1b69aaad3ee39173d89ec Mon Sep 17 00:00:00 2001 From: mystyrust Date: Tue, 17 Sep 2024 22:03:58 -0500 Subject: [PATCH 2/5] AO3-6768 i18n format, reference in cucumber test, single quotes --- app/controllers/works_controller.rb | 2 +- config/locales/controllers/en.yml | 2 ++ features/works/work_drafts.feature | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index 08f05c25a7..aed0444c7f 100755 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -162,7 +162,7 @@ def drafts return end - @page_subtitle = ts("%{username} - Drafts", username: @user.login) + @page_subtitle = t('users.page_subtitle.drafts_page', 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 bc8d7c3a86..cdc8eaf5a4 100644 --- a/config/locales/controllers/en.yml +++ b/config/locales/controllers/en.yml @@ -108,3 +108,5 @@ 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. + page_subtitle: + drafts_page: "%{username} - Drafts" diff --git a/features/works/work_drafts.feature b/features/works/work_drafts.feature index 168daf7753..7fbaa45715 100644 --- a/features/works/work_drafts.feature +++ b/features/works/work_drafts.feature @@ -67,6 +67,7 @@ Feature: Work Drafts And the draft "draft to post" When I am on drafter's works page Then I should see "Drafts (1)" + And the page title should include "drafter - Drafts" When I follow "Drafts (1)" Then I should see "draft to post" And I should see "Post Draft" within "#main .own.work.blurb .actions" From ac7b20d2413995d0e4ac5bd2a42b25e024ffc13e Mon Sep 17 00:00:00 2001 From: mystyrust Date: Wed, 18 Sep 2024 11:56:02 -0500 Subject: [PATCH 3/5] AO3-6768 pr feedback: double quotes, relative pathing for i18n text --- app/controllers/works_controller.rb | 2 +- config/locales/controllers/en.yml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/works_controller.rb b/app/controllers/works_controller.rb index d991f59aa6..d87f5fb059 100755 --- a/app/controllers/works_controller.rb +++ b/app/controllers/works_controller.rb @@ -160,7 +160,7 @@ def drafts return end - @page_subtitle = t('users.page_subtitle.drafts_page', username: @user.login) + @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 cdc8eaf5a4..f2bea47c0c 100644 --- a/config/locales/controllers/en.yml +++ b/config/locales/controllers/en.yml @@ -108,5 +108,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. - page_subtitle: - drafts_page: "%{username} - Drafts" + works: + drafts: + page_title: "%{username} - Drafts" \ No newline at end of file From 5ce52fa728b1066d4ad070749788b56d569c2350 Mon Sep 17 00:00:00 2001 From: mystyrust Date: Wed, 18 Sep 2024 13:06:16 -0500 Subject: [PATCH 4/5] AO3-6768 normalize i18n en file --- config/locales/controllers/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/controllers/en.yml b/config/locales/controllers/en.yml index f2bea47c0c..ea6e70bc90 100644 --- a/config/locales/controllers/en.yml +++ b/config/locales/controllers/en.yml @@ -110,4 +110,4 @@ en: 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" \ No newline at end of file + page_title: "%{username} - Drafts" From 958b4a860a45eec8228509581b69c7ffefe443cc Mon Sep 17 00:00:00 2001 From: mystyrust Date: Wed, 18 Sep 2024 14:12:17 -0500 Subject: [PATCH 5/5] AO3-6768 move cucumber step --- features/works/work_drafts.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/works/work_drafts.feature b/features/works/work_drafts.feature index 7fbaa45715..d3608c9d65 100644 --- a/features/works/work_drafts.feature +++ b/features/works/work_drafts.feature @@ -67,9 +67,9 @@ Feature: Work Drafts And the draft "draft to post" When I am on drafter's works page Then I should see "Drafts (1)" - And the page title should include "drafter - Drafts" 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"