about summary refs log tree commit diff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/accounts/_header.html.haml4
-rw-r--r--app/views/admin/account_actions/new.html.haml26
-rw-r--r--app/views/admin/account_warnings/_account_warning.html.haml6
-rw-r--r--app/views/admin/accounts/show.html.haml14
-rw-r--r--app/views/admin/reports/show.html.haml17
-rw-r--r--app/views/admin/settings/edit.html.haml3
-rw-r--r--app/views/admin/suspensions/new.html.haml25
-rw-r--r--app/views/admin/warning_presets/edit.html.haml11
-rw-r--r--app/views/admin/warning_presets/index.html.haml30
-rw-r--r--app/views/directories/index.html.haml10
-rw-r--r--app/views/layouts/error.html.haml2
-rw-r--r--app/views/layouts/public.html.haml6
-rw-r--r--app/views/settings/preferences/show.html.haml4
-rw-r--r--app/views/user_mailer/warning.html.haml63
-rw-r--r--app/views/user_mailer/warning.text.erb9
-rw-r--r--app/views/user_mailer/welcome.html.haml2
-rw-r--r--app/views/user_mailer/welcome.text.erb3
17 files changed, 180 insertions, 55 deletions
diff --git a/app/views/accounts/_header.html.haml b/app/views/accounts/_header.html.haml
index 370e7e470..a40ecb0d4 100644
--- a/app/views/accounts/_header.html.haml
+++ b/app/views/accounts/_header.html.haml
@@ -24,8 +24,8 @@
               %span.counter-label= t('accounts.following', count: account.following_count)
 
           .counter{ class: active_nav_class(account_followers_url(account)) }
-            = link_to account_followers_url(account), title: number_with_delimiter(account.followers_count) do
-              %span.counter-number= number_to_human account.followers_count, strip_insignificant_zeros: true
+            = link_to account_followers_url(account), title: hide_followers_count(account) ? nil : number_with_delimiter(account.followers_count) do
+              %span.counter-number= hide_followers_count(account) ? '-' : (number_to_human account.followers_count, strip_insignificant_zeros: true)
               %span.counter-label= t('accounts.followers', count: account.followers_count)
         .spacer
         .public-account-header__tabs__tabs__buttons
diff --git a/app/views/admin/account_actions/new.html.haml b/app/views/admin/account_actions/new.html.haml
new file mode 100644
index 000000000..97286c8e5
--- /dev/null
+++ b/app/views/admin/account_actions/new.html.haml
@@ -0,0 +1,26 @@
+- content_for :page_title do
+  = t('admin.account_actions.title', acct: @account.acct)
+
+= simple_form_for @account_action, url: admin_account_action_path(@account.id) do |f|
+  = f.input :report_id, as: :hidden
+
+  .fields-group
+    = f.input :type, collection: Admin::AccountAction.types_for_account(@account), include_blank: false, wrapper: :with_block_label, label_method: ->(type) { I18n.t("simple_form.labels.admin_account_action.types.#{type}")}, hint: t('simple_form.hints.admin_account_action.type_html', acct: @account.acct)
+
+  - if @account.local?
+    %hr.spacer/
+
+    .fields-group
+      = f.input :send_email_notification, as: :boolean, wrapper: :with_label
+
+    %hr.spacer/
+
+    - unless @warning_presets.empty?
+      .fields-group
+        = f.input :warning_preset_id, collection: @warning_presets, label_method: :text, wrapper: :with_block_label
+
+    .fields-group
+      = f.input :text, as: :text, wrapper: :with_block_label, hint: t('simple_form.hints.admin_account_action.text_html', path: admin_warning_presets_path)
+
+  .actions
+    = f.button :button, t('admin.account_actions.action'), type: :submit
diff --git a/app/views/admin/account_warnings/_account_warning.html.haml b/app/views/admin/account_warnings/_account_warning.html.haml
new file mode 100644
index 000000000..8c9c9679c
--- /dev/null
+++ b/app/views/admin/account_warnings/_account_warning.html.haml
@@ -0,0 +1,6 @@
+.speech-bubble.warning
+  .speech-bubble__bubble
+    = Formatter.instance.linkify(account_warning.text)
+  .speech-bubble__owner
+    = admin_account_link_to account_warning.account
+    %time.formatted{ datetime: account_warning.created_at.iso8601 }= l account_warning.created_at
diff --git a/app/views/admin/accounts/show.html.haml b/app/views/admin/accounts/show.html.haml
index e9f765107..226aef732 100644
--- a/app/views/admin/accounts/show.html.haml
+++ b/app/views/admin/accounts/show.html.haml
@@ -64,7 +64,7 @@
               = table_link_to 'unlock', t('admin.accounts.enable'), enable_admin_account_path(@account.id), method: :post if can?(:enable, @account.user)
             - else
               = t('admin.accounts.enabled')
-              = table_link_to 'lock', t('admin.accounts.disable'), disable_admin_account_path(@account.id), method: :post if can?(:disable, @account.user)
+              = table_link_to 'lock', t('admin.accounts.disable'), new_admin_account_action_path(@account.id, type: 'disable') if can?(:disable, @account.user)
         %tr
           %th= t('admin.accounts.most_recent_ip')
           %td= @account.user_current_sign_in_ip
@@ -119,18 +119,18 @@
 
   %div{ style: 'float: left' }
     - if @account.silenced?
-      = link_to t('admin.accounts.undo_silenced'), admin_account_silence_path(@account.id), method: :delete, class: 'button' if can?(:unsilence, @account)
+      = link_to t('admin.accounts.undo_silenced'), unsilence_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsilence, @account)
     - else
-      = link_to t('admin.accounts.silence'), admin_account_silence_path(@account.id), method: :post, class: 'button button--destructive' if can?(:silence, @account)
+      = link_to t('admin.accounts.silence'), new_admin_account_action_path(@account.id, type: 'silence'), class: 'button button--destructive' if can?(:silence, @account)
 
     - if @account.local?
       - unless @account.user_confirmed?
         = link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button' if can?(:confirm, @account.user)
 
     - if @account.suspended?
-      = link_to t('admin.accounts.undo_suspension'), admin_account_suspension_path(@account.id), method: :delete, class: 'button' if can?(:unsuspend, @account)
+      = link_to t('admin.accounts.undo_suspension'), unsuspend_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsuspend, @account)
     - else
-      = link_to t('admin.accounts.perform_full_suspension'), new_admin_account_suspension_path(@account.id), class: 'button button--destructive' if can?(:suspend, @account)
+      = link_to t('admin.accounts.perform_full_suspension'), new_admin_account_action_path(@account.id, type: 'suspend'), class: 'button button--destructive' if can?(:suspend, @account)
 
 - if !@account.local? && @account.hub_url.present?
   %hr.spacer/
@@ -184,6 +184,10 @@
 
 %hr.spacer/
 
+= render @warnings
+
+%hr.spacer/
+
 = render @moderation_notes
 
 = simple_form_for @account_moderation_note, url: admin_account_moderation_notes_path do |f|
diff --git a/app/views/admin/reports/show.html.haml b/app/views/admin/reports/show.html.haml
index 133ca4eca..fc430e19e 100644
--- a/app/views/admin/reports/show.html.haml
+++ b/app/views/admin/reports/show.html.haml
@@ -5,13 +5,14 @@
   - if @report.unresolved?
     %div{ style: 'float: right' }
       - if @report.target_account.local?
-        = link_to t('admin.accounts.disable'), admin_report_path(@report, outcome: 'disable'), method: :put, class: 'button button--destructive'
-      = link_to t('admin.accounts.silence'), admin_report_path(@report, outcome: 'silence'), method: :put, class: 'button button--destructive'
-      = link_to t('admin.accounts.perform_full_suspension'), new_admin_account_suspension_path(@report.target_account_id, report_id: @report.id), class: 'button button--destructive'
+        = link_to t('admin.accounts.warn'), new_admin_account_action_path(@report.target_account_id, type: 'none', report_id: @report.id), class: 'button'
+        = link_to t('admin.accounts.disable'), new_admin_account_action_path(@report.target_account_id, type: 'disable', report_id: @report.id), class: 'button button--destructive'
+      = link_to t('admin.accounts.silence'), new_admin_account_action_path(@report.target_account_id, type: 'silence', report_id: @report.id), class: 'button button--destructive'
+      = link_to t('admin.accounts.perform_full_suspension'), new_admin_account_action_path(@report.target_account_id, type: 'suspend', report_id: @report.id), class: 'button button--destructive'
     %div{ style: 'float: left' }
-      = link_to t('admin.reports.mark_as_resolved'), admin_report_path(@report, outcome: 'resolve'), method: :put, class: 'button'
+      = link_to t('admin.reports.mark_as_resolved'), resolve_admin_report_path(@report), method: :post, class: 'button'
   - else
-    = link_to t('admin.reports.mark_as_unresolved'), admin_report_path(@report, outcome: 'reopen'), method: :put, class: 'button'
+    = link_to t('admin.reports.mark_as_unresolved'), reopen_admin_report_path(@report), method: :post, class: 'button'
 
 %hr.spacer
 
@@ -64,10 +65,10 @@
               = admin_account_link_to @report.assigned_account
           %td
             - if @report.assigned_account != current_user.account
-              = table_link_to 'user', t('admin.reports.assign_to_self'), admin_report_path(@report, outcome: 'assign_to_self'), method: :put
+              = table_link_to 'user', t('admin.reports.assign_to_self'), assign_to_self_admin_report_path(@report), method: :post
           %td
             - if !@report.assigned_account.nil?
-              = table_link_to 'trash', t('admin.reports.unassign'), admin_report_path(@report, outcome: 'unassign'), method: :put
+              = table_link_to 'trash', t('admin.reports.unassign'), unassign_admin_report_path(@report), method: :post
 
 %hr.spacer
 
@@ -101,7 +102,7 @@
 - @report_notes.each do |item|
   - if item.is_a?(Admin::ActionLog)
     = render partial: 'action_log', locals: { action_log: item }
-  - elsif item.is_a?(ReportNote)
+  - else
     = render item
 
 = simple_form_for @report_note, url: admin_report_notes_path do |f|
diff --git a/app/views/admin/settings/edit.html.haml b/app/views/admin/settings/edit.html.haml
index bcf57aac0..e3ceb4344 100644
--- a/app/views/admin/settings/edit.html.haml
+++ b/app/views/admin/settings/edit.html.haml
@@ -65,6 +65,9 @@
   .fields-group
     = f.input :profile_directory, as: :boolean, wrapper: :with_label, label: t('admin.settings.profile_directory.title'), hint: t('admin.settings.profile_directory.desc_html')
 
+  .fields-group
+    = f.input :hide_followers_count, as: :boolean, wrapper: :with_label, label: t('admin.settings.hide_followers_count.title'), hint: t('admin.settings.hide_followers_count.desc_html')
+
   %hr.spacer/
 
   .fields-group
diff --git a/app/views/admin/suspensions/new.html.haml b/app/views/admin/suspensions/new.html.haml
deleted file mode 100644
index f03ecacc3..000000000
--- a/app/views/admin/suspensions/new.html.haml
+++ /dev/null
@@ -1,25 +0,0 @@
-- content_for :page_title do
-  = t('admin.suspensions.title', acct: @account.acct)
-
-= simple_form_for @suspension, url: admin_account_suspension_path(@account.id), method: :post do |f|
-  %p.hint= t('admin.suspensions.warning_html')
-
-  .fields-group
-    %ul
-      %li.negative-hint
-        = number_to_human @account.statuses_count, strip_insignificant_zeros: true
-        = t('accounts.posts', count: @account.statuses_count)
-      %li.negative-hint
-        = number_to_human @account.following_count, strip_insignificant_zeros: true
-        = t('accounts.following', count: @account.following_count)
-      %li.negative-hint
-        = number_to_human @account.followers_count, strip_insignificant_zeros: true
-        = t('accounts.followers', count: @account.followers_count)
-
-  %p.hint= t('admin.suspensions.hint_html', value: content_tag(:code, @account.acct))
-
-  = f.input :acct
-  = f.input_field :report_id, as: :hidden
-
-  .actions
-    = f.button :button, t('admin.suspensions.proceed'), type: :submit, class: 'negative'
diff --git a/app/views/admin/warning_presets/edit.html.haml b/app/views/admin/warning_presets/edit.html.haml
new file mode 100644
index 000000000..9522746cd
--- /dev/null
+++ b/app/views/admin/warning_presets/edit.html.haml
@@ -0,0 +1,11 @@
+- content_for :page_title do
+  = t('admin.warning_presets.edit_preset')
+
+= simple_form_for @warning_preset, url: admin_warning_preset_path(@warning_preset) do |f|
+  = render 'shared/error_messages', object: @warning_preset
+
+  .fields-group
+    = f.input :text, wrapper: :with_block_label
+
+  .actions
+    = f.button :button, t('generic.save_changes'), type: :submit
diff --git a/app/views/admin/warning_presets/index.html.haml b/app/views/admin/warning_presets/index.html.haml
new file mode 100644
index 000000000..45913ef73
--- /dev/null
+++ b/app/views/admin/warning_presets/index.html.haml
@@ -0,0 +1,30 @@
+- content_for :page_title do
+  = t('admin.warning_presets.title')
+
+- if can? :create, :account_warning_preset
+  = simple_form_for @warning_preset, url: admin_warning_presets_path do |f|
+    = render 'shared/error_messages', object: @warning_preset
+
+    .fields-group
+      = f.input :text, wrapper: :with_block_label
+
+    .actions
+      = f.button :button, t('admin.warning_presets.add_new'), type: :submit
+
+  %hr.spacer/
+
+- unless @warning_presets.empty?
+  .table-wrapper
+    %table.table
+      %thead
+        %tr
+          %th= t('simple_form.labels.account_warning_preset.text')
+          %th
+      %tbody
+        - @warning_presets.each do |preset|
+          %tr
+            %td
+              = Formatter.instance.linkify(preset.text)
+            %td
+              = table_link_to 'pencil', t('admin.warning_presets.edit'), edit_admin_warning_preset_path(preset)
+              = table_link_to 'trash', t('admin.warning_presets.delete'), admin_warning_preset_path(preset), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }
diff --git a/app/views/directories/index.html.haml b/app/views/directories/index.html.haml
index f70eb964a..4189ce897 100644
--- a/app/views/directories/index.html.haml
+++ b/app/views/directories/index.html.haml
@@ -16,10 +16,6 @@
 
 .grid
   .column-0
-    .account__section-headline
-      = active_link_to t('directories.most_recently_active'), @tag ? explore_hashtag_path(@tag) : explore_path
-      = active_link_to t('directories.most_popular'), @tag ? explore_hashtag_popular_path(@tag) : explore_popular_path
-
     - if @accounts.empty?
       = nothing_here
     - else
@@ -29,11 +25,11 @@
             - @accounts.each do |account|
               %tr
                 %td= account_link_to account
-                %td.accounts-table__count
+                %td.accounts-table__count.optional
                   = number_to_human account.statuses_count, strip_insignificant_zeros: true
                   %small= t('accounts.posts', count: account.statuses_count).downcase
-                %td.accounts-table__count
-                  = number_to_human account.followers_count, strip_insignificant_zeros: true
+                %td.accounts-table__count.optional
+                  = hide_followers_count(account) ? '-' : (number_to_human account.followers_count, strip_insignificant_zeros: true)
                   %small= t('accounts.followers', count: account.followers_count).downcase
                 %td.accounts-table__count
                   - if account.last_status_at.present?
diff --git a/app/views/layouts/error.html.haml b/app/views/layouts/error.html.haml
index be3e9f105..d662d85e2 100644
--- a/app/views/layouts/error.html.haml
+++ b/app/views/layouts/error.html.haml
@@ -9,6 +9,6 @@
     = render partial: 'layouts/theme', object: (@theme || { pack: 'common', flavour: 'glitch', skin: 'default' })
   %body.error
     .dialog
-      %img{ alt: Setting.default_settings['site_title'], src: '/oops.gif' }/
+      %img{ alt: Setting.default_settings['site_title'], src: current_user&.setting_auto_play_gif ? '/oops.gif' : '/oops.png' }/
       %div
         %h1= yield :content
diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml
index 5545df54c..c1c0f4b87 100644
--- a/app/views/layouts/public.html.haml
+++ b/app/views/layouts/public.html.haml
@@ -7,9 +7,9 @@
             = image_tag asset_pack_path('logo_full.svg'), alt: 'Mastodon'
 
           - if Setting.profile_directory
-            = link_to t('directories.directory'), explore_path, class: 'nav-link'
-          = link_to t('about.about_this'), about_more_path, class: 'nav-link'
-          = link_to t('about.apps'), 'https://joinmastodon.org/apps', class: 'nav-link'
+            = link_to t('directories.directory'), explore_path, class: 'nav-link optional'
+          = link_to t('about.about_this'), about_more_path, class: 'nav-link optional'
+          = link_to t('about.apps'), 'https://joinmastodon.org/apps', class: 'nav-link optional'
         .nav-center
         .nav-right
           - if user_signed_in?
diff --git a/app/views/settings/preferences/show.html.haml b/app/views/settings/preferences/show.html.haml
index 53390b6d1..6510e0560 100644
--- a/app/views/settings/preferences/show.html.haml
+++ b/app/views/settings/preferences/show.html.haml
@@ -34,6 +34,10 @@
   .fields-group
     = f.input :setting_hide_network, as: :boolean, wrapper: :with_label
 
+  - unless Setting.hide_followers_count
+    .fields-group
+      = f.input :setting_hide_followers_count, as: :boolean, wrapper: :with_label
+
   %hr#settings_web/
 
   .fields-group
diff --git a/app/views/user_mailer/warning.html.haml b/app/views/user_mailer/warning.html.haml
new file mode 100644
index 000000000..c5e1f5a28
--- /dev/null
+++ b/app/views/user_mailer/warning.html.haml
@@ -0,0 +1,63 @@
+%table.email-table{ cellspacing: 0, cellpadding: 0 }
+  %tbody
+    %tr
+      %td.email-body
+        .email-container
+          %table.content-section{ cellspacing: 0, cellpadding: 0 }
+            %tbody
+              %tr
+                %td.content-cell.hero
+                  .email-row
+                    .col-6
+                      %table.column{ cellspacing: 0, cellpadding: 0 }
+                        %tbody
+                          %tr
+                            %td.column-cell.text-center.padded
+                              %table.hero-icon.alert-icon{ align: 'center', cellspacing: 0, cellpadding: 0 }
+                                %tbody
+                                  %tr
+                                    %td
+                                      = image_tag full_pack_url('icon_warning.png'), alt: ''
+
+                              %h1= t "user_mailer.warning.title.#{@warning.action}"
+
+%table.email-table{ cellspacing: 0, cellpadding: 0 }
+  %tbody
+    %tr
+      %td.email-body
+        .email-container
+          %table.content-section{ cellspacing: 0, cellpadding: 0 }
+            %tbody
+              %tr
+                %td.content-cell.content-start
+                  .email-row
+                    .col-6
+                      %table.column{ cellspacing: 0, cellpadding: 0 }
+                        %tbody
+                          %tr
+                            %td.column-cell.text-center
+                              - unless @warning.none_action?
+                                %p= t "user_mailer.warning.explanation.#{@warning.action}"
+
+                              - unless @warning.text.blank?
+                                = Formatter.instance.linkify(@warning.text)
+
+%table.email-table{ cellspacing: 0, cellpadding: 0 }
+  %tbody
+    %tr
+      %td.email-body
+        .email-container
+          %table.content-section{ cellspacing: 0, cellpadding: 0 }
+            %tbody
+              %tr
+                %td.content-cell
+                  %table.column{ cellspacing: 0, cellpadding: 0 }
+                    %tbody
+                      %tr
+                        %td.column-cell.button-cell
+                          %table.button{ align: 'center', cellspacing: 0, cellpadding: 0 }
+                            %tbody
+                              %tr
+                                %td.button-primary
+                                  = link_to about_more_url do
+                                    %span= t 'user_mailer.warning.review_server_policies'
diff --git a/app/views/user_mailer/warning.text.erb b/app/views/user_mailer/warning.text.erb
new file mode 100644
index 000000000..b4f2402cb
--- /dev/null
+++ b/app/views/user_mailer/warning.text.erb
@@ -0,0 +1,9 @@
+<%= t "user_mailer.warning.title.#{@warning.action}" %>
+
+===
+
+<% unless @warning.none_action? %>
+<%= t "user_mailer.warning.explanation.#{@warning.action}" %>
+
+<% end %>
+<%= @warning.text %>
diff --git a/app/views/user_mailer/welcome.html.haml b/app/views/user_mailer/welcome.html.haml
index d734da67d..4a5788bf6 100644
--- a/app/views/user_mailer/welcome.html.haml
+++ b/app/views/user_mailer/welcome.html.haml
@@ -137,8 +137,6 @@
                                 %li
                                   %span= t 'user_mailer.welcome.tip_mobile_webapp'
                                 %li
-                                  %span= t 'user_mailer.welcome.tip_bridge_html', bridge_url: 'https://bridge.joinmastodon.org'
-                                %li
                                   %span= t 'user_mailer.welcome.tip_following'
                                 %li
                                   %span= t 'user_mailer.welcome.tip_local_timeline', instance: @instance
diff --git a/app/views/user_mailer/welcome.text.erb b/app/views/user_mailer/welcome.text.erb
index 5bd0cab2a..e310d7ca6 100644
--- a/app/views/user_mailer/welcome.text.erb
+++ b/app/views/user_mailer/welcome.text.erb
@@ -2,7 +2,7 @@
 
 ===
 
-<%= t 'user_mailer.welcome.full_handle' %> (<%= "@#{@resource.account.username}@#{@instance}" %>)
+<%= t 'user_mailer.welcome.full_handle' %> (<%= "@#{@resource.account.local_username_and_domain}" %>)
 <%= t 'user_mailer.welcome.full_handle_hint', instance: @instance %>
 
 ---
@@ -24,7 +24,6 @@
 <%= t 'user_mailer.welcome.tips' %>
 
 * <%= t 'user_mailer.welcome.tip_mobile_webapp' %>
-* <%= strip_tags(t('user_mailer.welcome.tip_bridge_html')) %> (https://bridge.joinmastodon.org)
 * <%= t 'user_mailer.welcome.tip_following' %>
 * <%= t 'user_mailer.welcome.tip_local_timeline', instance: @instance %>
 * <%= t 'user_mailer.welcome.tip_federated_timeline' %>