{% extends "base.html" %}

{% block title -%}
	{{ _("Report") }}
{%- endblock %}

{% from "macros/forms.html" import render_field, render_submit_field, render_checkbox_field, easymde_scripts %}
{% block scriptextra %}
	{{ easymde_scripts() }}
{% endblock %}

{% block content %}

<h1>{{ self.title() }}</h1>

{% if not form %}

<p>
	{{ _("Due to spam, we no longer accept reports from anonymous users on this form.") }}
	{{ _("Please sign in or contact the admin using the link below.") }}
</p>
<p>
	<a href="{{ url_for('users.login') }}" class="btn btn-primary me-2">Login</a>
	<a href="{{ admin_contact_url }}" class="btn btn-secondary">Contact the admin</a>
</p>

{% else %}

<p class="text-muted">
	{{ _("The full report will be visible to all ContentDB staff members, including editors and moderators.") }}
	{{ _("If you are reporting something by another user, we may discuss the report with them but will not disclose who reported it.") }}
	{{ _("If you are reporting something by an editor or moderator, then you should email the admin or a moderator directly to hide your identity.") }}
</p>

<form method="POST" action="" enctype="multipart/form-data">
	{{ form.hidden_tag() }}
	{{ render_field(form.category) }}
	{{ render_field(form.url) }}
	{{ render_field(form.title) }}
	{{ render_field(form.message, class_="m-0", fieldclass="form-control markdown", data_enter_submit="1") }}
	{{ render_field(form.file_upload, accept="image/png,image/jpeg,image/webp", hint=_("Optional, usually not required")) }}
	{{ render_submit_field(form.submit) }}
	<p class="alert alert-info mt-5">
		{{ _("Found a bug? Please report on the package's issue tracker or in a thread instead.") }}
	</p>
</form>

{% endif %}

{% endblock %}
