diff --git a/app/controllers/settings/mutes_controller.rb b/app/controllers/settings/mutes_controller.rb index 3fd02eab..788890a4 100644 --- a/app/controllers/settings/mutes_controller.rb +++ b/app/controllers/settings/mutes_controller.rb @@ -4,6 +4,7 @@ class Settings::MutesController < ApplicationController before_action :authenticate_user! def index + @users = current_user.muted_users @rules = MuteRule.where(user: current_user) end diff --git a/app/views/settings/mutes/_user.html.haml b/app/views/settings/mutes/_user.html.haml new file mode 100644 index 00000000..955b1339 --- /dev/null +++ b/app/views/settings/mutes/_user.html.haml @@ -0,0 +1,6 @@ +.d-flex.mb-2 + %img.avatar-md.mr-2{ src: user.profile_picture.url(:small), loading: :lazy } + %p.align-self-center.m-0= user_screen_name(user, context_user: current_user) + .ml-auto.d-inline-flex + %button.btn.btn-default.align-self-center{ data: { action: :unmute, target: user.screen_name } } + %span.pe-none= t("voc.unmute") diff --git a/app/views/settings/mutes/index.html.haml b/app/views/settings/mutes/index.html.haml index 9a0bb8d1..aa02c331 100644 --- a/app/views/settings/mutes/index.html.haml +++ b/app/views/settings/mutes/index.html.haml @@ -1,8 +1,18 @@ .card .card-body - %h2= t(".heading") - %p= t(".body") - %p= t(".note") + %h2= t(".users.heading") + %p= t(".users.body") + #users + - @users.each do |user| + = render "settings/mutes/user", user: user + - if @users.empty? + %p.text-muted.text-center= t(".users.none") + +.card + .card-body + %h2= t(".terms.heading") + %p= t(".terms.body") + %p= t(".terms.note") #rules - @rules.each do |rule| = render "settings/mutes/rule", rule: rule diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index 02f0f2ad..6544ceda 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -421,10 +421,15 @@ en: present: "Here's your export from %{time}" mutes: index: - title: "Muted Terms" - heading: "Muted Terms" - body: "Muting words (or longer phrases) will prevent questions containing those to appear in your inbox." - note: "Note: Filtered questions are discarded completely from your inbox, and won't reappear if you remove a filter later on." + title: "Mutes" + users: + heading: "Muted Users" + body: "Muting users will prevent their questions from showing up in your inbox. Additionally, any interaction from them will not generate a notification for you." + none: "You are not muting anyone." + terms: + heading: "Muted Terms" + body: "Muting words (or longer phrases) will prevent questions containing those to appear in your inbox." + note: "Note: Filtered questions are discarded completely from your inbox, and won't reappear if you remove a filter later on." form: placeholder: "Add a new muted term…" privacy: