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/show.rss.ruby37
-rw-r--r--app/views/admin/custom_emojis/new.html.haml2
-rw-r--r--app/views/admin/export_domain_allows/new.html.haml10
-rw-r--r--app/views/admin/export_domain_blocks/_domain_block.html.haml27
-rw-r--r--app/views/admin/export_domain_blocks/import.html.haml21
-rw-r--r--app/views/admin/export_domain_blocks/new.html.haml10
-rw-r--r--app/views/admin/instances/index.html.haml4
-rw-r--r--app/views/disputes/strikes/show.html.haml4
-rw-r--r--app/views/statuses/_simple_status.html.haml2
-rw-r--r--app/views/tags/show.rss.ruby35
10 files changed, 148 insertions, 4 deletions
diff --git a/app/views/accounts/show.rss.ruby b/app/views/accounts/show.rss.ruby
new file mode 100644
index 000000000..73c1c51e0
--- /dev/null
+++ b/app/views/accounts/show.rss.ruby
@@ -0,0 +1,37 @@
+RSS::Builder.build do |doc|
+  doc.title(display_name(@account))
+  doc.description(I18n.t('rss.descriptions.account', acct: @account.local_username_and_domain))
+  doc.link(params[:tag].present? ? short_account_tag_url(@account, params[:tag]) : short_account_url(@account))
+  doc.image(full_asset_url(@account.avatar.url(:original)), display_name(@account), params[:tag].present? ? short_account_tag_url(@account, params[:tag]) : short_account_url(@account))
+  doc.last_build_date(@statuses.first.created_at) if @statuses.any?
+  doc.icon(full_asset_url(@account.avatar.url(:original)))
+  doc.logo(full_pack_url('media/images/logo_transparent_white.svg'))
+  doc.generator("Mastodon v#{Mastodon::Version.to_s}")
+
+  @statuses.each do |status|
+    doc.item do |item|
+      item.title(l(status.created_at))
+      item.link(ActivityPub::TagManager.instance.url_for(status))
+      item.pub_date(status.created_at)
+      item.description(rss_status_content_format(status))
+
+      if status.ordered_media_attachments.first&.audio?
+        media = status.ordered_media_attachments.first
+        item.enclosure(full_asset_url(media.file.url(:original, false)), media.file.content_type, media.file.size)
+      end
+
+      status.ordered_media_attachments.each do |media|
+        item.media_content(full_asset_url(media.file.url(:original, false)), media.file.content_type, media.file.size) do |media_content|
+          media_content.medium(media.gifv? ? 'image' : media.type.to_s)
+          media_content.rating(status.sensitive? ? 'adult' : 'nonadult')
+          media_content.description(media.description) if media.description.present?
+          media_content.thumbnail(media.thumbnail.url(:original, false)) if media.thumbnail?
+        end
+      end
+
+      status.tags.each do |tag|
+        item.category(tag.name)
+      end
+    end
+  end
+end
diff --git a/app/views/admin/custom_emojis/new.html.haml b/app/views/admin/custom_emojis/new.html.haml
index 95996dec8..1ea931a2f 100644
--- a/app/views/admin/custom_emojis/new.html.haml
+++ b/app/views/admin/custom_emojis/new.html.haml
@@ -7,7 +7,7 @@
   .fields-group
     = f.input :shortcode, wrapper: :with_label, label: t('admin.custom_emojis.shortcode'), hint: t('admin.custom_emojis.shortcode_hint')
   .fields-group
-    = f.input :image, wrapper: :with_label, input_html: { accept: CustomEmoji::IMAGE_MIME_TYPES.join(' ') }, hint: t('admin.custom_emojis.image_hint', size: number_to_human_size(CustomEmoji::LIMIT))
+    = f.input :image, wrapper: :with_label, input_html: { accept: CustomEmoji::IMAGE_MIME_TYPES.join(' ') }, hint: t('admin.custom_emojis.image_hint', size: number_to_human_size(CustomEmoji::LOCAL_LIMIT))
 
   .actions
     = f.button :button, t('admin.custom_emojis.upload'), type: :submit
diff --git a/app/views/admin/export_domain_allows/new.html.haml b/app/views/admin/export_domain_allows/new.html.haml
new file mode 100644
index 000000000..dc0cf8c52
--- /dev/null
+++ b/app/views/admin/export_domain_allows/new.html.haml
@@ -0,0 +1,10 @@
+- content_for :page_title do
+  = t('.title')
+
+= simple_form_for @import, url: import_admin_export_domain_allows_path, html: { multipart: true } do |f|
+  .fields-row
+    .fields-group.fields-row__column.fields-row__column-6
+      = f.input :data, wrapper: :with_block_label, hint: t('simple_form.hints.imports.data'), as: :file
+
+  .actions
+    = f.button :button, t('imports.upload'), type: :submit
diff --git a/app/views/admin/export_domain_blocks/_domain_block.html.haml b/app/views/admin/export_domain_blocks/_domain_block.html.haml
new file mode 100644
index 000000000..5d4b6c4d0
--- /dev/null
+++ b/app/views/admin/export_domain_blocks/_domain_block.html.haml
@@ -0,0 +1,27 @@
+- existing_relationships ||= false
+
+.batch-table__row{ class: [existing_relationships && 'batch-table__row--attention'] }
+  %label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox
+    = f.check_box :enabled, checked: !existing_relationships
+  .batch-table__row__content.pending-account
+    .pending-account__header
+      %strong
+        = f.object.domain
+      = f.hidden_field :domain
+      = f.hidden_field :severity
+      = f.hidden_field :reject_media
+      = f.hidden_field :reject_reports
+      = f.hidden_field :obfuscate
+      = f.hidden_field :private_comment
+      = f.hidden_field :public_comment
+
+      %br/
+
+      = f.object.policies.map { |policy| t(policy, scope: 'admin.instances.content_policies.policies') }.join(' • ')
+      - if f.object.public_comment.present?
+        •
+        = f.object.public_comment
+      - if existing_relationships
+        •
+        = fa_icon 'warning fw'
+        = t('admin.export_domain_blocks.import.existing_relationships_warning')
diff --git a/app/views/admin/export_domain_blocks/import.html.haml b/app/views/admin/export_domain_blocks/import.html.haml
new file mode 100644
index 000000000..01add232d
--- /dev/null
+++ b/app/views/admin/export_domain_blocks/import.html.haml
@@ -0,0 +1,21 @@
+- content_for :page_title do
+  = t('admin.export_domain_blocks.import.title')
+
+%p= t('admin.export_domain_blocks.import.description_html')
+
+- if defined?(@global_private_comment) && @global_private_comment.present?
+  %p= t('admin.export_domain_blocks.import.private_comment_description_html', comment: @global_private_comment)
+
+= form_for(@form, url: batch_admin_domain_blocks_path) do |f|
+  .batch-table
+    .batch-table__toolbar
+      %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('copy'), t('admin.domain_blocks.import')]), name: :save, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
+    .batch-table__body
+      - if @domain_blocks.empty?
+        = nothing_here 'nothing-here--under-tabs'
+      - else
+        = f.simple_fields_for :domain_blocks, @domain_blocks do |ff|
+          = render 'domain_block', f: ff, existing_relationships: @warning_domains.include?(ff.object.domain)
diff --git a/app/views/admin/export_domain_blocks/new.html.haml b/app/views/admin/export_domain_blocks/new.html.haml
new file mode 100644
index 000000000..0291aeed7
--- /dev/null
+++ b/app/views/admin/export_domain_blocks/new.html.haml
@@ -0,0 +1,10 @@
+- content_for :page_title do
+  = t('.title')
+
+= simple_form_for @import, url: import_admin_export_domain_blocks_path, html: { multipart: true } do |f|
+  .fields-row
+    .fields-group.fields-row__column.fields-row__column-6
+      = f.input :data, wrapper: :with_block_label, hint: t('simple_form.hints.imports.data'), as: :file
+
+  .actions
+    = f.button :button, t('imports.upload'), type: :submit
diff --git a/app/views/admin/instances/index.html.haml b/app/views/admin/instances/index.html.haml
index ee1b3d0ce..abb2d8c0e 100644
--- a/app/views/admin/instances/index.html.haml
+++ b/app/views/admin/instances/index.html.haml
@@ -4,8 +4,12 @@
 - content_for :heading_actions do
   - if whitelist_mode?
     = link_to t('admin.domain_allows.add_new'), new_admin_domain_allow_path, class: 'button', id: 'add-instance-button'
+    = link_to t('admin.domain_allows.export'), export_admin_export_domain_allows_path(format: :csv), class: 'button'
+    = link_to t('admin.domain_allows.import'), new_admin_export_domain_allow_path, class: 'button'
   - else
     = link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path, class: 'button', id: 'add-instance-button'
+    = link_to t('admin.domain_blocks.export'), export_admin_export_domain_blocks_path(format: :csv), class: 'button'
+    = link_to t('admin.domain_blocks.import'), new_admin_export_domain_block_path, class: 'button'
 
 .filters
   .filter-subset
diff --git a/app/views/disputes/strikes/show.html.haml b/app/views/disputes/strikes/show.html.haml
index 0b71e14a3..1be50331a 100644
--- a/app/views/disputes/strikes/show.html.haml
+++ b/app/views/disputes/strikes/show.html.haml
@@ -3,8 +3,8 @@
 
 - content_for :heading_actions do
   - if @appeal.persisted?
-    = link_to t('admin.accounts.approve'), approve_admin_disputes_appeal_path(@appeal), method: :post, class: 'button' if can?(:approve, @appeal)
-    = link_to t('admin.accounts.reject'), reject_admin_disputes_appeal_path(@appeal), method: :post, class: 'button button--destructive' if can?(:reject, @appeal)
+    = link_to t('disputes.strikes.approve_appeal'), approve_admin_disputes_appeal_path(@appeal), method: :post, class: 'button' if can?(:approve, @appeal)
+    = link_to t('disputes.strikes.reject_appeal'), reject_admin_disputes_appeal_path(@appeal), method: :post, class: 'button button--destructive' if can?(:reject, @appeal)
 
 - if @strike.overruled?
   %p.hint
diff --git a/app/views/statuses/_simple_status.html.haml b/app/views/statuses/_simple_status.html.haml
index 7b672bda7..6192f293a 100644
--- a/app/views/statuses/_simple_status.html.haml
+++ b/app/views/statuses/_simple_status.html.haml
@@ -65,6 +65,6 @@
       - elsif status.private_visibility? || status.limited_visibility?
         = fa_icon 'lock fw'
       - else
-        = fa_icon 'envelope fw'
+        = fa_icon 'at fw'
     = link_to remote_interaction_path(status, type: :favourite), class: 'status__action-bar-button icon-button modal-button' do
       = fa_icon 'star fw'
diff --git a/app/views/tags/show.rss.ruby b/app/views/tags/show.rss.ruby
new file mode 100644
index 000000000..f4481b81c
--- /dev/null
+++ b/app/views/tags/show.rss.ruby
@@ -0,0 +1,35 @@
+RSS::Builder.build do |doc|
+  doc.title("##{@tag.name}")
+  doc.description(I18n.t('rss.descriptions.tag', hashtag: @tag.name))
+  doc.link(tag_url(@tag))
+  doc.last_build_date(@statuses.first.created_at) if @statuses.any?
+  doc.logo(full_pack_url('media/images/logo_transparent_white.svg'))
+  doc.generator("Mastodon v#{Mastodon::Version.to_s}")
+
+  @statuses.each do |status|
+    doc.item do |item|
+      item.title(l(status.created_at))
+      item.link(ActivityPub::TagManager.instance.url_for(status))
+      item.pub_date(status.created_at)
+      item.description(rss_status_content_format(status))
+
+      if status.ordered_media_attachments.first&.audio?
+        media = status.ordered_media_attachments.first
+        item.enclosure(full_asset_url(media.file.url(:original, false)), media.file.content_type, media.file.size)
+      end
+
+      status.ordered_media_attachments.each do |media|
+        item.media_content(full_asset_url(media.file.url(:original, false)), media.file.content_type, media.file.size) do |media_content|
+          media_content.medium(media.gifv? ? 'image' : media.type.to_s)
+          media_content.rating(status.sensitive? ? 'adult' : 'nonadult')
+          media_content.description(media.description) if media.description.present?
+          media_content.thumbnail(media.thumbnail.url(:original, false)) if media.thumbnail?
+        end
+      end
+
+      status.tags.each do |tag|
+        item.category(tag.name)
+      end
+    end
+  end
+end