about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2018-06-03 23:10:59 -0500
committerDavid Yip <yipdw@member.fsf.org>2018-06-04 02:51:28 -0500
commit97d2df77aae687c983c1294ebcd3962e4f9d985c (patch)
tree7dfef8cbc3bc9ca91fa4712e3da72f088507abc1 /app
parentcf28049f0ac1bf9610039cd95ee485b0dcef7ea2 (diff)
Add apply-to-mentions option to keyword mute UI. #454.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/settings/keyword_mutes_controller.rb2
-rw-r--r--app/views/settings/keyword_mutes/_fields.html.haml3
-rw-r--r--app/views/settings/keyword_mutes/_keyword_mute.html.haml3
-rw-r--r--app/views/settings/keyword_mutes/index.html.haml1
4 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/settings/keyword_mutes_controller.rb b/app/controllers/settings/keyword_mutes_controller.rb
index 699b8a3ef..cf364a903 100644
--- a/app/controllers/settings/keyword_mutes_controller.rb
+++ b/app/controllers/settings/keyword_mutes_controller.rb
@@ -52,7 +52,7 @@ class Settings::KeywordMutesController < Settings::BaseController
   end
 
   def keyword_mute_params
-    params.require(:keyword_mute).permit(:keyword, :whole_word)
+    params.require(:keyword_mute).permit(:keyword, :whole_word, :apply_to_mentions)
   end
 
   def paginated_keyword_mutes_for_account
diff --git a/app/views/settings/keyword_mutes/_fields.html.haml b/app/views/settings/keyword_mutes/_fields.html.haml
index 892676f18..843e9366a 100644
--- a/app/views/settings/keyword_mutes/_fields.html.haml
+++ b/app/views/settings/keyword_mutes/_fields.html.haml
@@ -2,6 +2,9 @@
   = f.input :keyword
   = f.check_box :whole_word
   = f.label :whole_word, t('keyword_mutes.match_whole_word')
+  %br
+  = f.check_box :apply_to_mentions
+  = f.label :apply_to_mentions, t('keyword_mutes.apply_to_mentions')
 
 .actions
   - if f.object.persisted?
diff --git a/app/views/settings/keyword_mutes/_keyword_mute.html.haml b/app/views/settings/keyword_mutes/_keyword_mute.html.haml
index c45cc64fb..f9f6e3eb6 100644
--- a/app/views/settings/keyword_mutes/_keyword_mute.html.haml
+++ b/app/views/settings/keyword_mutes/_keyword_mute.html.haml
@@ -5,6 +5,9 @@
     - if keyword_mute.whole_word
       %i.fa.fa-check
   %td
+    - if keyword_mute.apply_to_mentions
+      %i.fa.fa-check
+  %td
     = table_link_to 'edit', t('keyword_mutes.edit'), edit_settings_keyword_mute_path(keyword_mute)
   %td
     = table_link_to 'times', t('keyword_mutes.remove'), settings_keyword_mute_path(keyword_mute), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }
diff --git a/app/views/settings/keyword_mutes/index.html.haml b/app/views/settings/keyword_mutes/index.html.haml
index 9ef8d55bc..7255f57b3 100644
--- a/app/views/settings/keyword_mutes/index.html.haml
+++ b/app/views/settings/keyword_mutes/index.html.haml
@@ -7,6 +7,7 @@
       %tr
         %th= t('keyword_mutes.keyword')
         %th= t('keyword_mutes.match_whole_word')
+        %th= t('keyword_mutes.apply_to_mentions')
         %th
         %th
       %tbody