From 5875d187b6ba5f67595218f0ef6e421a4e755c36 Mon Sep 17 00:00:00 2001
From: Wim Brand
Date: Mon, 17 May 2021 11:16:20 +0200
Subject: [PATCH] Make abuse report window more user friendly
---
.../script/file_viewer/AbuseReportWindow.js | 2 +-
.../file_viewer/viewer_scripts/AbuseViewer.js | 14 +++---
res/include/style/viewer.css | 10 +++++
res/template/file_viewer.html | 38 ++++++++++------
res/template/home.html | 6 ++-
.../admin_abuse_reports/AbuseReport.svelte | 11 +++--
.../admin_abuse_reports/AbuseReports.svelte | 45 ++++++++++++++-----
webcontroller/file_viewer.go | 16 ++-----
8 files changed, 92 insertions(+), 50 deletions(-)
diff --git a/res/include/script/file_viewer/AbuseReportWindow.js b/res/include/script/file_viewer/AbuseReportWindow.js
index ae57748..4eb00bb 100644
--- a/res/include/script/file_viewer/AbuseReportWindow.js
+++ b/res/include/script/file_viewer/AbuseReportWindow.js
@@ -4,7 +4,7 @@ function AbuseReportWindow(viewer) {
this.modal = new Modal(
document.getElementById("file_viewer"),
() => { this.toggle() },
- "Report abuse", "600px", "auto",
+ "Report abuse", "650px", "auto",
)
this.btnReportAbuse = document.getElementById("btn_report_abuse")
diff --git a/res/include/script/file_viewer/viewer_scripts/AbuseViewer.js b/res/include/script/file_viewer/viewer_scripts/AbuseViewer.js
index bcfde20..67fc836 100644
--- a/res/include/script/file_viewer/viewer_scripts/AbuseViewer.js
+++ b/res/include/script/file_viewer/viewer_scripts/AbuseViewer.js
@@ -1,7 +1,7 @@
function AbuseViewer(viewer, file, next) {
this.viewer = viewer
- this.file = file
- this.next = next
+ this.file = file
+ this.next = next
this.container = document.createElement("div")
this.container.classList = "image-container"
@@ -12,17 +12,17 @@ function AbuseViewer(viewer, file, next) {
this.container.appendChild(this.title)
this.description = document.createElement("p")
- this.description.innerText = "This file has received an abuse report and "+
+ this.description.innerText = "This file has received an abuse report and " +
"was taken down."
this.container.appendChild(this.description)
this.description2 = document.createElement("p")
- this.description2.innerText = "Type of abuse: '"+file.abuse_type+"'. "+
- "Reporter: '"+file.abuse_reporter_name+"'."
+ this.description2.innerText = "Type of abuse: " + file.abuse_type + ". " +
+ "Reporter: " + file.abuse_reporter_name + "."
this.container.appendChild(this.description2)
}
-AbuseViewer.prototype.render = function(parent) {
+AbuseViewer.prototype.render = function (parent) {
parent.appendChild(this.container)
// Disable the download button
@@ -30,7 +30,7 @@ AbuseViewer.prototype.render = function(parent) {
this.viewer.toolbar.btnDownload.style.display = "none"
}
-AbuseViewer.prototype.destroy = function(parent) {
+AbuseViewer.prototype.destroy = function (parent) {
// Restore the download button
this.viewer.toolbar.btnDownload.style.display = this.btnDownloadDisplay
}
diff --git a/res/include/style/viewer.css b/res/include/style/viewer.css
index 7cc3654..47d17e9 100644
--- a/res/include/style/viewer.css
+++ b/res/include/style/viewer.css
@@ -265,6 +265,16 @@
table {width: auto !important;}
+/* Abuse report label*/
+.abuse_type_form > label {
+ display: block;
+ border-bottom: 1px var(--layer_2_color_border) solid;
+ padding: 0.5em;
+}
+.abuse_type_form > label:last-of-type {
+ border-bottom: none;
+}
+
/* ====================
|| LIST NAVIGATOR ||
diff --git a/res/template/file_viewer.html b/res/template/file_viewer.html
index c978421..cfd8881 100644
--- a/res/template/file_viewer.html
+++ b/res/template/file_viewer.html
@@ -325,18 +325,30 @@