use a non-tabular domain policy list layout & paginate
parent
85aec06845
commit
a5ce8eddb4
|
@ -10,7 +10,7 @@ class DomainPolicyController < ApplicationController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@hide_navbar = true
|
@hide_navbar = true
|
||||||
@domain_policies = DomainBlock.all.reorder('updated_at DESC')
|
@domain_policies = DomainBlock.all.reorder('updated_at DESC').page(params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -45,4 +45,12 @@ class DomainBlock < ApplicationRecord
|
||||||
scope = suspend? ? accounts.where(suspended_at: created_at) : accounts.where(silenced_at: created_at)
|
scope = suspend? ? accounts.where(suspended_at: created_at) : accounts.where(silenced_at: created_at)
|
||||||
scope.count
|
scope.count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def additionals
|
||||||
|
additionals = []
|
||||||
|
additionals << "force sensitive media" if force_sensitive?
|
||||||
|
additionals << "reject media" if reject_media?
|
||||||
|
additionals << "reject reports" if reject_reports?
|
||||||
|
additionals
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
%tr
|
%hr/
|
||||||
%td
|
%p
|
||||||
%samp= domain_block.domain
|
%strong= "Domain: "
|
||||||
%td= domain_block.severity.gsub('_', ' ').capitalize
|
%samp= domain_block.domain
|
||||||
%td
|
%br/
|
||||||
%ul
|
%strong= "Policies: "
|
||||||
-if domain_block.reject_media?
|
%span= ([domain_block.severity.gsub('_', ' ')] + domain_block.additionals).join(', ')
|
||||||
%li= "Rejecting media"
|
%br/
|
||||||
-if domain_block.force_sensitive?
|
%strong= "Added: "
|
||||||
%li= "Media marked sensitive"
|
%span= domain_block.created_at
|
||||||
-if domain_block.reject_reports?
|
- if domain_block.updated_at.to_i != domain_block.created_at.to_i
|
||||||
%li= "Rejecting reports"
|
%br/
|
||||||
%td= "None"
|
%strong= "Updated: "
|
||||||
|
%span= domain_block.updated_at
|
||||||
|
- if domain_block.reason?
|
||||||
|
%br/
|
||||||
|
%strong= "Notes: "
|
||||||
|
= h(domain_block.reason)
|
||||||
|
|
|
@ -46,13 +46,6 @@
|
||||||
.rich-formatting
|
.rich-formatting
|
||||||
%h1= "#{@instance_presenter.site_title} Domain Policies"
|
%h1= "#{@instance_presenter.site_title} Domain Policies"
|
||||||
|
|
||||||
.table-wrapper
|
= render @domain_policies
|
||||||
%table.table
|
|
||||||
%thead
|
= paginate @domain_policies
|
||||||
%tr
|
|
||||||
%th= "Domain"
|
|
||||||
%th= "Policy"
|
|
||||||
%th= "Additional"
|
|
||||||
%th= "Reason"
|
|
||||||
%tbody
|
|
||||||
= render @domain_policies
|
|
||||||
|
|
Loading…
Reference in New Issue