diff --git a/app/assets/javascripts/discourse/app/templates/user.hbs b/app/assets/javascripts/discourse/app/templates/user.hbs index 6b73db4c03f..056929c85f5 100644 --- a/app/assets/javascripts/discourse/app/templates/user.hbs +++ b/app/assets/javascripts/discourse/app/templates/user.hbs @@ -42,10 +42,12 @@ type="ReviewableFlaggedPost" }} > - {{this.model.number_of_flagged_posts}}{{i18n - "user.staff_counters.flagged_posts" + {{html-safe + (i18n + "user.staff_counters.flagged_posts" + className="flagged-posts" + count=this.model.number_of_flagged_posts + ) }} @@ -60,10 +62,12 @@ type="ReviewableQueuedPost" }} > - {{this.model.number_of_rejected_posts}}{{i18n - "user.staff_counters.rejected_posts" + {{html-safe + (i18n + "user.staff_counters.rejected_posts" + className="flagged-posts" + count=this.model.number_of_rejected_posts + ) }} @@ -72,10 +76,12 @@ {{#if this.model.number_of_deleted_posts}}
- {{this.model.number_of_deleted_posts}}{{i18n - "user.staff_counters.deleted_posts" + {{html-safe + (i18n + "user.staff_counters.deleted_posts" + className="deleted-posts" + count=this.model.number_of_deleted_posts + ) }}
@@ -83,10 +89,12 @@ {{#if this.model.number_of_suspensions}}
- {{this.model.number_of_suspensions}}{{i18n - "user.staff_counters.suspensions" + {{html-safe + (i18n + "user.staff_counters.suspensions" + className="suspensions" + count=this.model.number_of_suspensions + ) }}
@@ -97,10 +105,13 @@ @route="userPrivateMessages.user.warnings" @model={{this.model}} > - {{this.model.warnings_received_count}} - {{i18n "user.staff_counters.warnings_received"}} + {{html-safe + (i18n + "user.staff_counters.warnings_received" + className="warnings-received" + count=this.model.warnings_received_count + ) + }} {{/if}} diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 3ba455d5e44..d2c7bed7ba0 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1284,11 +1284,21 @@ en: flags_given: one: '%{count} helpful flag' other: '%{count} helpful flags' - flagged_posts: "flagged posts" - deleted_posts: "deleted posts" - suspensions: "suspensions" - warnings_received: "warnings" - rejected_posts: "rejected posts" + flagged_posts: + one: '%{count} flagged post' + other: '%{count} flagged posts' + deleted_posts: + one: '%{count} deleted post' + other: '%{count} deleted posts' + suspensions: + one: '%{count} suspension' + other: '%{count} suspensions' + warnings_received: + one: '%{count} warning' + other: '%{count} warnings' + rejected_posts: + one: '%{count} rejected post' + other: '%{count} rejected posts' messages: all: "all inboxes" diff --git a/spec/system/page_objects/pages/user.rb b/spec/system/page_objects/pages/user.rb index ab9d7c18aa1..a596f82db83 100644 --- a/spec/system/page_objects/pages/user.rb +++ b/spec/system/page_objects/pages/user.rb @@ -24,11 +24,9 @@ module PageObjects page.has_current_path?("/u/#{user.username}/messages/warnings") end - def click_staff_info_warnings_link(warnings_count: 0) + def click_staff_info_warnings_link(user, warnings_count: 0) staff_counters = page.find(".staff-counters") - staff_counters.click_link( - "#{warnings_count} #{I18n.t("js.user.staff_counters.warnings_received")}", - ) + staff_counters.find("a[href='/u/#{user.username}/messages/warnings']").click self end end diff --git a/spec/system/user_page/staff_info_spec.rb b/spec/system/user_page/staff_info_spec.rb index 1ffa8ac8273..0171b17746e 100644 --- a/spec/system/user_page/staff_info_spec.rb +++ b/spec/system/user_page/staff_info_spec.rb @@ -12,7 +12,7 @@ describe "Viewing user staff info as an admin", type: :system, js: true do fab!(:user_warning) { UserWarning.create!(user: user, created_by: admin, topic: topic) } it "should display the right link to user's warnings with the right count in text" do - user_page.visit(user).click_staff_info_warnings_link(warnings_count: 1) + user_page.visit(user).click_staff_info_warnings_link(user, warnings_count: 1) expect(user_page).to have_warning_messages_path(user) end