about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/domain_policy_controller.rb2
-rw-r--r--app/models/domain_block.rb8
-rw-r--r--app/views/domain_blocks/_domain_block.html.haml32
-rw-r--r--app/views/domain_policy/show.html.haml13
4 files changed, 30 insertions, 25 deletions
diff --git a/app/controllers/domain_policy_controller.rb b/app/controllers/domain_policy_controller.rb
index 4bb0bf6bd..f438eff32 100644
--- a/app/controllers/domain_policy_controller.rb
+++ b/app/controllers/domain_policy_controller.rb
@@ -10,7 +10,7 @@ class DomainPolicyController < ApplicationController
 
   def show
     @hide_navbar = true
-    @domain_policies = DomainBlock.all.reorder('updated_at DESC')
+    @domain_policies = DomainBlock.all.reorder('updated_at DESC').page(params[:page])
   end
 
   private
diff --git a/app/models/domain_block.rb b/app/models/domain_block.rb
index c62ca3d8c..486e2865b 100644
--- a/app/models/domain_block.rb
+++ b/app/models/domain_block.rb
@@ -45,4 +45,12 @@ class DomainBlock < ApplicationRecord
     scope = suspend? ? accounts.where(suspended_at: created_at) : accounts.where(silenced_at: created_at)
     scope.count
   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
diff --git a/app/views/domain_blocks/_domain_block.html.haml b/app/views/domain_blocks/_domain_block.html.haml
index fae707c82..d690773e7 100644
--- a/app/views/domain_blocks/_domain_block.html.haml
+++ b/app/views/domain_blocks/_domain_block.html.haml
@@ -1,14 +1,18 @@
-%tr
-  %td
-    %samp= domain_block.domain
-  %td= domain_block.severity.gsub('_', ' ').capitalize
-  %td
-    %ul
-      -if domain_block.reject_media?
-        %li= "Rejecting media"
-      -if domain_block.force_sensitive?
-        %li= "Media marked sensitive"
-      -if domain_block.reject_reports?
-        %li= "Rejecting reports"
-  %td= "None"
-
+%hr/
+%p
+  %strong= "Domain: "
+  %samp= domain_block.domain
+  %br/
+  %strong= "Policies: "
+  %span= ([domain_block.severity.gsub('_', ' ')] + domain_block.additionals).join(', ')
+  %br/
+  %strong= "Added: "
+  %span= domain_block.created_at
+  - if domain_block.updated_at.to_i != domain_block.created_at.to_i
+    %br/
+    %strong= "Updated: "
+    %span= domain_block.updated_at
+  - if domain_block.reason?
+    %br/
+    %strong= "Notes: "
+    = h(domain_block.reason)
diff --git a/app/views/domain_policy/show.html.haml b/app/views/domain_policy/show.html.haml
index 4b4b121fd..3e04e44f0 100644
--- a/app/views/domain_policy/show.html.haml
+++ b/app/views/domain_policy/show.html.haml
@@ -46,13 +46,6 @@
       .rich-formatting
         %h1= "#{@instance_presenter.site_title} Domain Policies"
 
-        .table-wrapper
-          %table.table
-            %thead
-              %tr
-                %th= "Domain"
-                %th= "Policy"
-                %th= "Additional"
-                %th= "Reason"
-            %tbody
-              = render @domain_policies
+        = render @domain_policies
+
+= paginate @domain_policies