]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'main' into glitch-soc/merge-upstream
authorClaire <claire.github-309c@sitedethib.com>
Thu, 25 Nov 2021 22:49:17 +0000 (23:49 +0100)
committerClaire <claire.github-309c@sitedethib.com>
Thu, 25 Nov 2021 22:50:35 +0000 (23:50 +0100)
Conflicts:
- `app/views/admin/tags/index.html.haml`:
  Removed upstream while it had changes in glitch-soc to accomodate for the
  theming system.

Additional changes to accomodate for the theming system:
- `app/views/admin/trends/links/preview_card_providers/index.html.haml`
- `app/views/admin/trends/links/index.html.haml`
- `app/views/admin/trends/tags/index.html.haml`
- `app/views/admin/tags/show.html.haml`

12 files changed:
1  2 
app/lib/activitypub/activity/create.rb
app/services/post_status_service.rb
app/services/reblog_service.rb
app/views/admin/dashboard/index.html.haml
app/views/admin/tags/show.html.haml
app/views/admin/trends/links/index.html.haml
app/views/admin/trends/links/preview_card_providers/index.html.haml
app/views/admin/trends/tags/index.html.haml
config/navigation.rb
config/routes.rb
db/schema.rb
spec/services/notify_service_spec.rb

index bc32580253c3848e9681d8c53930ca43744f3481,294ae43eb2f9b72a9c8a4434c806b180c4d056b5..9d26e0f5bf0c0cbf61ad22fde178de71ce46efd9
@@@ -100,9 -91,10 +100,10 @@@ class PostStatusService < BaseServic
    end
  
    def postprocess_status!
-     LinkCrawlWorker.perform_async(@status.id) unless @status.spoiler_text?
+     Trends.tags.register(@status)
+     LinkCrawlWorker.perform_async(@status.id)
      DistributionWorker.perform_async(@status.id)
 -    ActivityPub::DistributionWorker.perform_async(@status.id)
 +    ActivityPub::DistributionWorker.perform_async(@status.id) unless @status.local_only?
      PollExpirationNotifyWorker.perform_at(@status.poll.expires_at, @status.poll.id) if @status.poll
    end
  
index f41276de042123a6005c98767cb783c5faef92cb,ece91847a8a27410ad4cca28450cf8da29cd8d6c..42f8b9512b0b2de4489620158764d30141c9af43
@@@ -30,8 -30,10 +30,10 @@@ class ReblogService < BaseServic
  
      reblog = account.statuses.create!(reblog: reblogged_status, text: '', visibility: visibility, rate_limit: options[:with_rate_limit])
  
+     Trends.tags.register(reblog)
+     Trends.links.register(reblog)
      DistributionWorker.perform_async(reblog.id)
 -    ActivityPub::DistributionWorker.perform_async(reblog.id)
 +    ActivityPub::DistributionWorker.perform_async(reblog.id) unless reblogged_status.local_only?
  
      create_notification(reblog)
      bump_potential_friendship(account, reblog)
Simple merge
index 0000000000000000000000000000000000000000,240ae722b5802c1e8e345ccb5b8bd3bbe4fcddf2..acd2b0466e731d0229e954341d13813659554c76
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,41 +1,38 @@@
 -- content_for :header_tags do
 -  = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous'
 -
+ - content_for :page_title do
+   = t('admin.trends.links.title')
+ .filters
+   .filter-subset
+     %strong= t('admin.trends.trending')
+     %ul
+       %li= filter_link_to t('generic.all'), trending: nil
+       %li= filter_link_to t('admin.trends.only_allowed'), trending: 'allowed'
+   .back-link
+     = link_to admin_trends_links_preview_card_providers_path do
+       = t('admin.trends.preview_card_providers.title')
+       = fa_icon 'chevron-right fw'
+ %hr.spacer/
+ = form_for(@form, url: batch_admin_trends_links_path) do |f|
+   = hidden_field_tag :page, params[:page] || 1
+   - PreviewCardFilter::KEYS.each do |key|
+     = hidden_field_tag key, params[key] if params[key].present?
+   .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('check'), t('admin.trends.links.allow')]), name: :approve, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
+         = f.button safe_join([fa_icon('check'), t('admin.trends.links.allow_provider')]), name: :approve_all, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
+         = f.button safe_join([fa_icon('times'), t('admin.trends.links.disallow')]), name: :reject, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
+         = f.button safe_join([fa_icon('times'), t('admin.trends.links.disallow_provider')]), name: :reject_all, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
+     .batch-table__body
+       - if @preview_cards.empty?
+         = nothing_here 'nothing-here--under-tabs'
+       - else
+         = render partial: 'preview_card', collection: @preview_cards, locals: { f: f }
+ = paginate @preview_cards
index 0000000000000000000000000000000000000000,eac6e641fe52aa3482bf12f4bd6c811a5c51abee..df54f58bae80c4f079daccb8fdfa0efd9eb0b5ed
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,43 +1,40 @@@
 -- content_for :header_tags do
 -  = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous'
 -
+ - content_for :page_title do
+   = t('admin.trends.preview_card_providers.title')
+ .filters
+   .filter-subset
+     %strong= t('admin.tags.review')
+     %ul
+       %li= filter_link_to t('generic.all'), status: nil
+       %li= filter_link_to t('admin.trends.approved'), status: 'approved'
+       %li= filter_link_to t('admin.trends.rejected'), status: 'rejected'
+       %li= filter_link_to safe_join([t('admin.accounts.moderation.pending'), "(#{PreviewCardProvider.pending_review.count})"], ' '), status: 'pending_review'
+   .back-link
+     = link_to admin_trends_links_path do
+       = fa_icon 'chevron-left fw'
+       = t('admin.trends.links.title')
+ %hr.spacer/
+ = form_for(@form, url: batch_admin_trends_links_preview_card_providers_path) do |f|
+   = hidden_field_tag :page, params[:page] || 1
+   - PreviewCardProviderFilter::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
+         = f.button safe_join([fa_icon('check'), t('admin.trends.allow')]), 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.trends.disallow')]), name: :reject, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
+     .batch-table__body
+       - if @preview_card_providers.empty?
+         = nothing_here 'nothing-here--under-tabs'
+       - else
+         = render partial: 'preview_card_provider', collection: @preview_card_providers, locals: { f: f }
+ = paginate @preview_card_providers
index 0000000000000000000000000000000000000000,8df0a9920b4fc9f6829c5312f16b0dc7750eee38..99ad5490f5ac8a46a1c25fa4a1b0524c20b83b40
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,38 +1,35 @@@
 -- content_for :header_tags do
 -  = javascript_pack_tag 'admin', async: true, crossorigin: 'anonymous'
 -
+ - content_for :page_title do
+   = t('admin.trends.tags.title')
+ .filters
+   .filter-subset
+     %strong= t('admin.tags.review')
+     %ul
+       %li= filter_link_to t('generic.all'), status: nil
+       %li= filter_link_to t('admin.trends.approved'), status: 'approved'
+       %li= filter_link_to t('admin.trends.rejected'), status: 'rejected'
+       %li= filter_link_to safe_join([t('admin.accounts.moderation.pending'), "(#{Tag.pending_review.count})"], ' '), status: 'pending_review'
+ %hr.spacer/
+ = form_for(@form, url: batch_admin_trends_tags_path) do |f|
+   = hidden_field_tag :page, params[:page] || 1
+   - 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
+         = f.button safe_join([fa_icon('check'), t('admin.trends.allow')]), 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.trends.disallow')]), name: :reject, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
+     .batch-table__body
+       - if @tags.empty?
+         = nothing_here 'nothing-here--under-tabs'
+       - else
+         = render partial: 'tag', collection: @tags, locals: { f: f }
+ = paginate @tags
Simple merge
Simple merge
diff --cc db/schema.rb
Simple merge
Simple merge