Add option to add description to abuse report

This commit is contained in:
2023-11-01 13:39:53 +01:00
parent c5b6b7d773
commit 611a905da7
3 changed files with 30 additions and 9 deletions

View File

@@ -99,6 +99,14 @@ let set_status = async (action, report_type) => {
{/if}
</td>
</tr>
{#if user_report.description !== ""}
<tr>
<td>Description</td>
<td colspan="4" style="white-space: pre;">
{user_report.description}
</td>
</tr>
{/if}
{/each}
</table>
</div>

View File

@@ -160,9 +160,8 @@ onMount(() => {
<div class="toolbar" style="text-align: left;">
<div>Reports: {reports.length}</div>
<div class="toolbar_spacer"></div>
<div>Start:</div>
<div>Range:</div>
<input type="date" bind:this={startPicker}/>
<div>End:</div>
<input type="date" bind:this={endPicker}/>
<button on:click={get_reports}>Go</button>
</div>

View File

@@ -13,6 +13,7 @@ export let list = {
let abuse_type = ""
let single_or_all = "single"
let description = ""
let loading = false
let results = []
@@ -20,8 +21,10 @@ let submit = async e => {
e.preventDefault()
if (abuse_type === "") {
result_success = false
result_text = "Please select an abuse type"
results = [{success: false, text: "Please select an abuse type"}]
return
} else if (description.length > 300) {
results = [{success: false, text: "Description is too long"}]
return
}
@@ -41,6 +44,7 @@ let submit = async e => {
const form = new FormData()
form.append("type", abuse_type)
form.append("description", description)
results = []
@@ -78,10 +82,7 @@ let submit = async e => {
<p>
If you think this file violates pixeldrain's
<a href="/abuse">content policy</a> you can report it for moderation
with this form. You cannot report copyright abuse with this form, send a
formal DMCA notification to the
<a href="/abuse#copyright-infringement">abuse e-mail address</a>
instead.
with this form.
</p>
<form on:submit={submit} style="width: 100%">
<h3>Abuse type</h3>
@@ -110,11 +111,16 @@ let submit = async e => {
<b>Doxing</b>: Personally identifiable information uploaded without
the consent of the owner.
</label>
<label for="type_malware" style="border-bottom: none;">
<label for="type_malware">
<input type="radio" bind:group={abuse_type} id="type_malware" name="abuse_type" value="malware">
<b>Malware</b>: Software programs designed to cause harm to
computer systems.
</label>
<label for="type_copyright" style="border-bottom: none;">
<input type="radio" bind:group={abuse_type} id="type_copyright" name="abuse_type" value="copyright">
<b>Copyright</b>: Protected content which is shared without constent
from the rightsholder.
</label>
{#if list.id !== ""}
<h3>Report multiple files?</h3>
@@ -128,6 +134,14 @@ let submit = async e => {
</label>
{/if}
<h3>Description</h3>
<p>
Please provide some context for your report, like contact
information in case of copyright abuse, or a password if the file is
encrypted. ({description.length}/300)
</p>
<textarea bind:value={description} placeholder="Context here..." style="width: 100%; height: 5em;"></textarea>
<h3>Send</h3>
{#if loading}
<div class="spinner_container">