diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-01-19 14:22:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-19 14:22:59 +0100 |
commit | b209e919bddb4bb72bb4f8589f4b15654f22ef53 (patch) | |
tree | ccd980d2d701c03f9c16358908f20560f2d5be2c /app/views/user_mailer | |
parent | f6acc039ec95c6d1c8cc2e2955f2af31d27e928c (diff) | |
parent | c42938aed4677f52207bbb6389c7edc2772a6f7a (diff) |
Merge pull request #1662 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/views/user_mailer')
-rw-r--r-- | app/views/user_mailer/warning.html.haml | 16 | ||||
-rw-r--r-- | app/views/user_mailer/warning.text.erb | 17 |
2 files changed, 28 insertions, 5 deletions
diff --git a/app/views/user_mailer/warning.html.haml b/app/views/user_mailer/warning.html.haml index 5a2911ecb..bda1fef6c 100644 --- a/app/views/user_mailer/warning.html.haml +++ b/app/views/user_mailer/warning.html.haml @@ -37,16 +37,26 @@ %tr %td.column-cell.text-center - unless @warning.none_action? - %p= t "user_mailer.warning.explanation.#{@warning.action}" + %p= t "user_mailer.warning.explanation.#{@warning.action}", instance: @instance - unless @warning.text.blank? = Formatter.instance.linkify(@warning.text) - - if !@statuses.nil? && !@statuses.empty? + - if @warning.report && !@warning.report.other? + %p + %strong= t('user_mailer.warning.reason') + = t("user_mailer.warning.categories.#{@warning.report.category}") + + - if @warning.report.violation? && @warning.report.rule_ids.present? + %ul.rules-list + - @warning.report.rules.each do |rule| + %li= rule.text + + - unless @statuses.empty? %p %strong= t('user_mailer.warning.statuses') -- if !@statuses.nil? && !@statuses.empty? +- unless @statuses.empty? - @statuses.each_with_index do |status, i| = render 'notification_mailer/status', status: status, i: i + 1, highlighted: true diff --git a/app/views/user_mailer/warning.text.erb b/app/views/user_mailer/warning.text.erb index bb6610c79..31d7308ae 100644 --- a/app/views/user_mailer/warning.text.erb +++ b/app/views/user_mailer/warning.text.erb @@ -3,11 +3,24 @@ === <% unless @warning.none_action? %> -<%= t "user_mailer.warning.explanation.#{@warning.action}" %> +<%= t "user_mailer.warning.explanation.#{@warning.action}", instance: @instance %> <% end %> +<% if @warning.text.present? %> <%= @warning.text %> -<% if !@statuses.nil? && !@statuses.empty? %> + +<% end %> +<% if @warning.report && !@warning.report.other? %> +**<%= t('user_mailer.warning.reason') %>** <%= t("user_mailer.warning.categories.#{@warning.report.category}") %> + +<% if @warning.report.violation? && @warning.report.rule_ids.present? %> +<% @warning.report.rules.each do |rule| %> +- <%= rule.text %> +<% end %> + +<% end %> +<% end %> +<% if !@statuses.empty? %> <%= t('user_mailer.warning.statuses') %> <% @statuses.each do |status| %> |