diff --git a/app/admin.rb b/app/admin.rb index 0690228f..058a026f 100644 --- a/app/admin.rb +++ b/app/admin.rb @@ -10,6 +10,8 @@ get '/admin/reports' do @page = params[:page] ? params[:page].to_i : 1 @page = 1 if @page < 1 @per_page = 51 + + @moderation_blur_categories = $config['moderation_blur_categories'] @reports = Report.join(:sites, id: :site_id).where(sites__is_deleted: false, sites__is_banned: false).order(:reports__created_at.desc).select_all(:reports).paginate(@page, @per_page) @pagination_dataset = @reports diff --git a/config.yml.ci b/config.yml.ci index 39b388d8..e6879af9 100644 --- a/config.yml.ci +++ b/config.yml.ci @@ -29,4 +29,5 @@ minfraud_license_key: DERPDERPDERP google_custom_search_key: herpderp google_custom_search_cx: herpderp google_custom_search_query_limit: 69 -support_email: derp@example.com \ No newline at end of file +support_email: derp@example.com +moderation_blur_categories: [ cats, dogs ] \ No newline at end of file diff --git a/config.yml.template b/config.yml.template index 2a00ab14..d22b7c13 100644 --- a/config.yml.template +++ b/config.yml.template @@ -32,6 +32,7 @@ development: google_custom_search_cx: herpderp google_custom_search_query_limit: 69 support_email: derp@example.com + moderation_blur_categories: [ cats, dogs ] test: database: 'postgres://localhost/neocities_test' database_pool: 1 @@ -69,4 +70,5 @@ test: google_custom_search_key: herpderp google_custom_search_cx: herpderp google_custom_search_query_limit: 69 - support_email: derp@example.com \ No newline at end of file + support_email: derp@example.com + moderation_blur_categories: [ cats, dogs ] \ No newline at end of file diff --git a/tests/acceptance/admin_tests.rb b/tests/acceptance/admin_tests.rb index 76ea73b5..ab854f37 100644 --- a/tests/acceptance/admin_tests.rb +++ b/tests/acceptance/admin_tests.rb @@ -242,6 +242,7 @@ describe '/admin' do _(page.body).must_match(/\b1 banned\b/) _(page.body).must_match(/\b1 deleted\b/) end + end describe 'email blasting' do diff --git a/views/admin/reports.erb b/views/admin/reports.erb index 07bdaf82..58ee8110 100644 --- a/views/admin/reports.erb +++ b/views/admin/reports.erb @@ -24,12 +24,14 @@ else screenshot_path = 'index.html' end + + blur_sensitive_screenshot = @moderation_blur_categories.include?(report.type) %>
+ style="width: 100%; height: auto; border: 1px solid #ddd;<%= ' filter: blur(4px);' if blur_sensitive_screenshot %>"> <% if report.type && !report.type.empty? %> @@ -163,4 +165,4 @@ function dismissReport(reportId) { alert('Error: ' + error); }); } - \ No newline at end of file +