about summary refs log tree commit diff
path: root/app/views/admin
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/admin')
-rw-r--r--app/views/admin/accounts/index.html.haml2
-rw-r--r--app/views/admin/accounts/show.html.haml14
-rw-r--r--app/views/admin/announcements/_announcement.html.haml19
-rw-r--r--app/views/admin/announcements/edit.html.haml22
-rw-r--r--app/views/admin/announcements/index.html.haml22
-rw-r--r--app/views/admin/announcements/new.html.haml21
-rw-r--r--app/views/admin/custom_emojis/index.html.haml10
-rw-r--r--app/views/admin/email_domain_blocks/index.html.haml23
-rw-r--r--app/views/admin/followers/index.html.haml28
-rw-r--r--app/views/admin/instances/index.html.haml5
-rw-r--r--app/views/admin/relationships/index.html.haml39
-rw-r--r--app/views/admin/reports/_status.html.haml7
-rw-r--r--app/views/admin/reports/index.html.haml5
-rw-r--r--app/views/admin/reports/show.html.haml2
-rw-r--r--app/views/admin/tags/_tag.html.haml5
-rw-r--r--app/views/admin/tags/index.html.haml20
16 files changed, 173 insertions, 71 deletions
diff --git a/app/views/admin/accounts/index.html.haml b/app/views/admin/accounts/index.html.haml
index 7e9adb3ff..3a85324c9 100644
--- a/app/views/admin/accounts/index.html.haml
+++ b/app/views/admin/accounts/index.html.haml
@@ -22,7 +22,7 @@
 
 = form_tag admin_accounts_url, method: 'GET', class: 'simple_form' do
   .fields-group
-    - Admin::FilterHelper::ACCOUNT_FILTERS.each do |key|
+    - AccountFilter::KEYS.each do |key|
       - if params[key].present?
         = hidden_field_tag key, params[key]
 
diff --git a/app/views/admin/accounts/show.html.haml b/app/views/admin/accounts/show.html.haml
index 9f1e3816b..a83f77134 100644
--- a/app/views/admin/accounts/show.html.haml
+++ b/app/views/admin/accounts/show.html.haml
@@ -41,7 +41,7 @@
       .dashboard__counters__num= number_to_human_size @account.media_attachments.sum('file_file_size')
       .dashboard__counters__label= t 'admin.accounts.media_attachments'
   %div
-    = link_to admin_account_followers_path(@account.id) do
+    = link_to admin_account_relationships_path(@account.id, location: 'local', relationship: 'followed_by') do
       .dashboard__counters__num= number_with_delimiter @account.local_followers_count
       .dashboard__counters__label= t 'admin.accounts.followers'
   %div
@@ -139,12 +139,12 @@
               %time.formatted{ datetime: @account.created_at.iso8601, title: l(@account.created_at) }= l @account.created_at
             %td
 
-          %tr
-            %th= t('admin.accounts.most_recent_ip')
-            %td= @account.user_current_sign_in_ip
-            %td
-              - if @account.user_current_sign_in_ip
-                = table_link_to 'search', t('admin.accounts.search_same_ip'), admin_accounts_path(ip: @account.user_current_sign_in_ip)
+          - @account.user.recent_ips.each_with_index do |(_, ip), i|
+            %tr
+              - if i.zero?
+                %th{ rowspan: @account.user.recent_ips.size }= t('admin.accounts.most_recent_ip')
+              %td= ip
+              %td= table_link_to 'search', t('admin.accounts.search_same_ip'), admin_accounts_path(ip: ip)
 
           %tr
             %th= t('admin.accounts.most_recent_activity')
diff --git a/app/views/admin/announcements/_announcement.html.haml b/app/views/admin/announcements/_announcement.html.haml
new file mode 100644
index 000000000..1c7f89ef2
--- /dev/null
+++ b/app/views/admin/announcements/_announcement.html.haml
@@ -0,0 +1,19 @@
+.announcements-list__item
+  = link_to edit_admin_announcement_path(announcement), class: 'announcements-list__item__title' do
+    = truncate(announcement.text)
+
+  .announcements-list__item__action-bar
+    .announcements-list__item__meta
+      - if announcement.scheduled_at.present?
+        = t('admin.announcements.scheduled_for', time: l(announcement.scheduled_at))
+      - else
+        = l(announcement.created_at)
+
+    %div
+      - if can?(:update, announcement)
+        - if announcement.published?
+          = table_link_to 'toggle-off', t('admin.announcements.unpublish'), unpublish_admin_announcement_path(announcement), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
+        - else
+          = table_link_to 'toggle-on', t('admin.announcements.publish'), publish_admin_announcement_path(announcement), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }
+
+      = table_link_to 'trash', t('generic.delete'), admin_announcement_path(announcement), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:destroy, announcement)
diff --git a/app/views/admin/announcements/edit.html.haml b/app/views/admin/announcements/edit.html.haml
new file mode 100644
index 000000000..5f56db5e7
--- /dev/null
+++ b/app/views/admin/announcements/edit.html.haml
@@ -0,0 +1,22 @@
+- content_for :page_title do
+  = t('.title')
+
+= simple_form_for @announcement, url: admin_announcement_path(@announcement) do |f|
+  = render 'shared/error_messages', object: @announcement
+
+  .fields-group
+    = f.input :starts_at, include_blank: true, wrapper: :with_block_label
+    = f.input :ends_at, include_blank: true, wrapper: :with_block_label
+
+  .fields-group
+    = f.input :all_day, as: :boolean, wrapper: :with_label
+
+  .fields-group
+    = f.input :text, wrapper: :with_block_label
+
+  - unless @announcement.published?
+    .fields-group
+      = f.input :scheduled_at, include_blank: true, wrapper: :with_block_label
+
+  .actions
+    = f.button :button, t('generic.save_changes'), type: :submit
diff --git a/app/views/admin/announcements/index.html.haml b/app/views/admin/announcements/index.html.haml
new file mode 100644
index 000000000..40f02b914
--- /dev/null
+++ b/app/views/admin/announcements/index.html.haml
@@ -0,0 +1,22 @@
+- content_for :page_title do
+  = t('admin.announcements.title')
+
+- content_for :heading_actions do
+  = link_to t('admin.announcements.new.title'), new_admin_announcement_path, class: 'button'
+
+.filters
+  .filter-subset
+    %strong= t('admin.relays.status')
+    %ul
+      %li= filter_link_to t('generic.all'), published: nil, unpublished: nil
+      %li= filter_link_to safe_join([t('admin.announcements.live'), "(#{number_with_delimiter(Announcement.published.count)})"], ' '), published: '1', unpublished: nil
+
+- if @announcements.empty?
+  %div.muted-hint.center-text
+    = t 'admin.announcements.empty'
+- else
+  .announcements-list
+    = render partial: 'announcement', collection: @announcements
+
+= paginate @announcements
+
diff --git a/app/views/admin/announcements/new.html.haml b/app/views/admin/announcements/new.html.haml
new file mode 100644
index 000000000..a5298c5f6
--- /dev/null
+++ b/app/views/admin/announcements/new.html.haml
@@ -0,0 +1,21 @@
+- content_for :page_title do
+  = t('.title')
+
+= simple_form_for @announcement, url: admin_announcements_path do |f|
+  = render 'shared/error_messages', object: @announcement
+
+  .fields-group
+    = f.input :starts_at, include_blank: true, wrapper: :with_block_label
+    = f.input :ends_at, include_blank: true, wrapper: :with_block_label
+
+  .fields-group
+    = f.input :all_day, as: :boolean, wrapper: :with_label
+
+  .fields-group
+    = f.input :text, wrapper: :with_block_label
+
+  .fields-group
+    = f.input :scheduled_at, include_blank: true, wrapper: :with_block_label
+
+  .actions
+    = f.button :button, t('.create'), type: :submit
diff --git a/app/views/admin/custom_emojis/index.html.haml b/app/views/admin/custom_emojis/index.html.haml
index 4fbadee90..d3705a36e 100644
--- a/app/views/admin/custom_emojis/index.html.haml
+++ b/app/views/admin/custom_emojis/index.html.haml
@@ -1,6 +1,9 @@
 - content_for :page_title do
   = t('admin.custom_emojis.title')
 
+- content_for :heading_actions do
+  = link_to t('admin.custom_emojis.upload'), new_admin_custom_emoji_path, class: 'button'
+
 .filters
   .filter-subset
     %strong= t('admin.accounts.location.title')
@@ -19,7 +22,7 @@
 
 = form_tag admin_custom_emojis_url, method: 'GET', class: 'simple_form' do
   .fields-group
-    - Admin::FilterHelper::CUSTOM_EMOJI_FILTERS.each do |key|
+    - CustomEmojiFilter::KEYS.each do |key|
       = hidden_field_tag key, params[key] if params[key].present?
 
     - %i(shortcode by_domain).each do |key|
@@ -33,7 +36,7 @@
 = form_for(@form, url: batch_admin_custom_emojis_path) do |f|
   = hidden_field_tag :page, params[:page] || 1
 
-  - Admin::FilterHelper::CUSTOM_EMOJI_FILTERS.each do |key|
+  - CustomEmojiFilter::KEYS.each do |key|
     = hidden_field_tag key, params[key] if params[key].present?
 
   .batch-table
@@ -78,6 +81,3 @@
 
 = paginate @custom_emojis
 
-%hr.spacer/
-
-= link_to t('admin.custom_emojis.upload'), new_admin_custom_emoji_path, class: 'button'
diff --git a/app/views/admin/email_domain_blocks/index.html.haml b/app/views/admin/email_domain_blocks/index.html.haml
index 7bb204e52..6015cfac0 100644
--- a/app/views/admin/email_domain_blocks/index.html.haml
+++ b/app/views/admin/email_domain_blocks/index.html.haml
@@ -1,14 +1,19 @@
 - content_for :page_title do
   = t('admin.email_domain_blocks.title')
 
-.table-wrapper
-  %table.table
-    %thead
-      %tr
-        %th= t('admin.email_domain_blocks.domain')
-        %th
-    %tbody
-      = render @email_domain_blocks
+- content_for :heading_actions do
+  = link_to t('admin.email_domain_blocks.add_new'), new_admin_email_domain_block_path, class: 'button'
+
+- if @email_domain_blocks.empty?
+  %div.muted-hint.center-text=t 'admin.email_domain_blocks.empty'
+- else
+  .table-wrapper
+    %table.table
+      %thead
+        %tr
+          %th= t('admin.email_domain_blocks.domain')
+          %th
+      %tbody
+        = render @email_domain_blocks
 
 = paginate @email_domain_blocks
-= link_to t('admin.email_domain_blocks.add_new'), new_admin_email_domain_block_path, class: 'button'
diff --git a/app/views/admin/followers/index.html.haml b/app/views/admin/followers/index.html.haml
deleted file mode 100644
index 25f1f290f..000000000
--- a/app/views/admin/followers/index.html.haml
+++ /dev/null
@@ -1,28 +0,0 @@
-- content_for :page_title do
-  = t('admin.followers.title', acct: @account.acct)
-
-.filters
-  .filter-subset
-    %strong= t('admin.accounts.location.title')
-    %ul
-      %li= link_to t('admin.accounts.location.local'), admin_account_followers_path(@account.id), class: 'selected'
-  .back-link{ style: 'flex: 1 1 auto; text-align: right' }
-    = link_to admin_account_path(@account.id) do
-      = fa_icon 'chevron-left fw'
-      = t('admin.followers.back_to_account')
-
-%hr.spacer/
-
-.table-wrapper
-  %table.table
-    %thead
-      %tr
-        %th= t('admin.accounts.username')
-        %th= t('admin.accounts.role')
-        %th= t('admin.accounts.most_recent_ip')
-        %th= t('admin.accounts.most_recent_activity')
-        %th
-    %tbody
-      = render partial: 'admin/accounts/account', collection: @followers
-
-= paginate @followers
diff --git a/app/views/admin/instances/index.html.haml b/app/views/admin/instances/index.html.haml
index 1d85aa75e..0b299acc5 100644
--- a/app/views/admin/instances/index.html.haml
+++ b/app/views/admin/instances/index.html.haml
@@ -19,9 +19,8 @@
 - unless whitelist_mode?
   = form_tag admin_instances_url, method: 'GET', class: 'simple_form' do
     .fields-group
-      - Admin::FilterHelper::INSTANCES_FILTERS.each do |key|
-        - if params[key].present?
-          = hidden_field_tag key, params[key]
+      - InstanceFilter::KEYS.each do |key|
+        = hidden_field_tag key, params[key] if params[key].present?
 
       - %i(by_domain).each do |key|
         .input.string.optional
diff --git a/app/views/admin/relationships/index.html.haml b/app/views/admin/relationships/index.html.haml
new file mode 100644
index 000000000..3afaff615
--- /dev/null
+++ b/app/views/admin/relationships/index.html.haml
@@ -0,0 +1,39 @@
+- content_for :page_title do
+  = t('admin.relationships.title', acct: @account.acct)
+
+.filters
+  .filter-subset
+    %strong= t 'relationships.relationship'
+    %ul
+      %li= filter_link_to t('relationships.following'), relationship: nil
+      %li= filter_link_to t('relationships.followers'), relationship: 'followed_by'
+      %li= filter_link_to t('relationships.mutual'), relationship: 'mutual'
+      %li= filter_link_to t('relationships.invited'), relationship: 'invited'
+
+  .filter-subset
+    %strong= t('admin.accounts.location.title')
+    %ul
+      %li= filter_link_to t('admin.accounts.moderation.all'), location: nil
+      %li= filter_link_to t('admin.accounts.location.local'), location: 'local'
+      %li= filter_link_to t('admin.accounts.location.remote'), location: 'remote'
+
+  .back-link{ style: 'flex: 1 1 auto; text-align: right' }
+    = link_to admin_account_path(@account.id) do
+      = fa_icon 'chevron-left fw'
+      = t('admin.statuses.back_to_account')
+
+%hr.spacer/
+
+.table-wrapper
+  %table.table
+    %thead
+      %tr
+        %th= t('admin.accounts.username')
+        %th= t('admin.accounts.role')
+        %th= t('admin.accounts.most_recent_ip')
+        %th= t('admin.accounts.most_recent_activity')
+        %th
+    %tbody
+      = render partial: 'admin/accounts/account', collection: @accounts
+
+= paginate @accounts
diff --git a/app/views/admin/reports/_status.html.haml b/app/views/admin/reports/_status.html.haml
index 425d315e1..fa15796d2 100644
--- a/app/views/admin/reports/_status.html.haml
+++ b/app/views/admin/reports/_status.html.haml
@@ -14,9 +14,12 @@
     - unless status.proper.media_attachments.empty?
       - if status.proper.media_attachments.first.video?
         - video = status.proper.media_attachments.first
-        = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), sensitive: !current_account&.user&.show_all_media? && status.proper.sensitive? || current_account&.user&.hide_all_media?, width: 610, height: 343, inline: true, alt: video.description
+        = react_component :video, src: video.file.url(:original), preview: video.file.url(:small), blurhash: video.blurhash, sensitive: status.proper.sensitive?, visible: false, width: 610, height: 343, inline: true, alt: video.description
+      - elsif status.proper.media_attachments.first.audio?
+        - audio = status.proper.media_attachments.first
+        = react_component :audio, src: audio.file.url(:original), height: 110, alt: audio.description, duration: audio.file.meta.dig(:original, :duration)
       - else
-        = react_component :media_gallery, height: 343, sensitive: !current_account&.user&.show_all_media? && status.proper.sensitive? || current_account&.user&.hide_all_media?, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, media: status.proper.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }
+        = react_component :media_gallery, height: 343, sensitive: status.proper.sensitive?, visible: false, media: status.proper.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }
 
     .detailed-status__meta
       = link_to ActivityPub::TagManager.instance.url_for(status), class: 'detailed-status__datetime', target: stream_link_target, rel: 'noopener noreferrer' do
diff --git a/app/views/admin/reports/index.html.haml b/app/views/admin/reports/index.html.haml
index 30c7549b0..0263b80fb 100644
--- a/app/views/admin/reports/index.html.haml
+++ b/app/views/admin/reports/index.html.haml
@@ -10,9 +10,8 @@
 
 = form_tag admin_reports_url, method: 'GET', class: 'simple_form' do
   .fields-group
-    - Admin::FilterHelper::REPORT_FILTERS.each do |key|
-      - if params[key].present?
-        = hidden_field_tag key, params[key]
+    - ReportFilter::KEYS.each do |key|
+      = hidden_field_tag key, params[key] if params[key].present?
 
     - %i(by_target_domain).each do |key|
       .input.string.optional
diff --git a/app/views/admin/reports/show.html.haml b/app/views/admin/reports/show.html.haml
index 4321bb199..b12ea4270 100644
--- a/app/views/admin/reports/show.html.haml
+++ b/app/views/admin/reports/show.html.haml
@@ -1,7 +1,7 @@
 - content_for :page_title do
   = t('admin.reports.report', id: @report.id)
 
-- content_for :page_heading_actions do
+- content_for :heading_actions do
   - if @report.unresolved?
     = link_to t('admin.reports.mark_as_resolved'), resolve_admin_report_path(@report), method: :post, class: 'button'
   - else
diff --git a/app/views/admin/tags/_tag.html.haml b/app/views/admin/tags/_tag.html.haml
index 670f3bc05..287d28e53 100644
--- a/app/views/admin/tags/_tag.html.haml
+++ b/app/views/admin/tags/_tag.html.haml
@@ -1,6 +1,7 @@
 .batch-table__row
-  %label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox
-    = f.check_box :tag_ids, { multiple: true, include_hidden: false }, tag.id
+  - if batch_available
+    %label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox
+      = f.check_box :tag_ids, { multiple: true, include_hidden: false }, tag.id
 
   .directory__tag
     = link_to admin_tag_path(tag.id) do
diff --git a/app/views/admin/tags/index.html.haml b/app/views/admin/tags/index.html.haml
index 298ac59e9..d20ed80f8 100644
--- a/app/views/admin/tags/index.html.haml
+++ b/app/views/admin/tags/index.html.haml
@@ -25,7 +25,7 @@
 
 = form_tag admin_tags_url, method: 'GET', class: 'simple_form' do
   .fields-group
-    - Admin::FilterHelper::TAGS_FILTERS.each do |key|
+    - TagFilter::KEYS.each do |key|
       = hidden_field_tag key, params[key] if params[key].present?
 
     - %i(name).each do |key|
@@ -40,32 +40,32 @@
 
 = form_for(@form, url: batch_admin_tags_path) do |f|
   = hidden_field_tag :page, params[:page] || 1
-  = hidden_field_tag :name, params[:name] if params[:name].present?
 
-  - Admin::FilterHelper::TAGS_FILTERS.each do |key|
+  - TagFilter::KEYS.each do |key|
     = hidden_field_tag key, params[key] if params[key].present?
 
   .batch-table.optional
     .batch-table__toolbar
-      %label.batch-table__toolbar__select.batch-checkbox-all
-        = check_box_tag :batch_checkbox_all, nil, false
-      .batch-table__toolbar__actions
-        - if params[:pending_review] == '1'
+      - if params[:pending_review] == '1' || params[:unreviewed] == '1'
+        %label.batch-table__toolbar__select.batch-checkbox-all
+          = check_box_tag :batch_checkbox_all, nil, false
+        .batch-table__toolbar__actions
           = f.button safe_join([fa_icon('check'), t('admin.accounts.approve')]), name: :approve, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
 
           = f.button safe_join([fa_icon('times'), t('admin.accounts.reject')]), name: :reject, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
-        - else
+      - else
+        .batch-table__toolbar__actions
           %span.neutral-hint= t('generic.no_batch_actions_available')
 
     .batch-table__body
       - if @tags.empty?
         = nothing_here 'nothing-here--under-tabs'
       - else
-        = render partial: 'tag', collection: @tags, locals: { f: f }
+        = render partial: 'tag', collection: @tags, locals: { f: f, batch_available: params[:pending_review] == '1' || params[:unreviewed] == '1' }
 
 = paginate @tags
 
-- if params[:pending_review] == '1'
+- if params[:pending_review] == '1' || params[:unreviewed] == '1'
   %hr.spacer/
 
   %div{ style: 'overflow: hidden' }