{% end block %}
{% block container %}
- <section class="hero">
+ <section class="hero is-fullheight-with-navbar">
<div class="hero-body">
<div class="container">
- <nav class="breadcrumb" aria-label="breadcrumbs">
- <ul>
- <li>
- <a href="/dbl">
- {{ _("IPFire DBL") }}
- </a>
- </li>
+ <div class="columns is-centered">
+ <div class="column is-half">
+ <h4 class="title is-4">
+ {{ _("Report") }}
+ </h4>
- <li>
- <a href="/dbl/lists">
- {{ _("Lists") }}
- </a>
- </li>
+ <h6 class="subtitle is-6">
+ {{ _("Submitted %s") % \
+ locale.format_date(report.reported_at, shorter=True) }}
+ </h6>
- <li>
- <a href="/dbl/lists/{{ list.slug }}">
- {{ list.name }}
- </a>
- </li>
+ <nav class="panel">
+ <div class="panel-block is-block p-4">
+ {% set args = {
+ "name" : report.name,
+ "list" : list,
+ } %}
- <li>
- <a href="/dbl/lists/{{ list.slug }}/reports">
- {{ _("Reports") }}
- </a>
- </li>
+ {% if report.block %}
+ <h5 class="title is-5">
+ {{ _("%(name)s should be BLOCKED on %(list)s") % args }}
+ </h5>
+ {% else %}
+ <h5 class="title is-5">
+ {{ _("%(name)s should be ALLOWED on %(list)s") % args }}
+ </h5>
+ {% end %}
- <li class="is-active">
- <a href="#" aria-current="page">{{ report }}</a>
- </li>
- </ul>
- </nav>
+ <div class="columns is-vcentered">
+ <div class="column is-2 is-flex is-justify-content-center">
+ <a href="/users/{{ report.reported_by }}">
+ {% if reporter %}
+ <figure class="image is-64x64">
+ <img class="is-rounded" src="{{ reporter.avatar_url(size=128) }}">
+ </figure>
+ {% else %}
+ <i class="fas fa-user" aria-hidden="true"></i>
+ {% end %}
+ </a>
+ </div>
- <div class="card">
- <div class="card-content">
- <div class="content">
- <p class="title is-4">
- {{ report.name }}
- </p>
+ {# Comment #}
+ <div class="column">
+ {% if report.comment %}
+ <div class="content">
+ <h6 class="title is-6 mb-1">
+ {{ _("%s commented:") % (reporter or report.reported_by) }}
+ </h6>
- <p class="subtitle is-6">
- {{ _("Submitted %(when)s by %(who)s") % {
- "when" : locale.format_date(report.reported_at),
- "who" : report.reported_by,
- } }}
- </p>
-
- {# Comment #}
- {% if report.comment %}
- <pre>{{ report.comment }}</pre>
- {% end %}
+ {% module Markdown(report.comment) %}
+ </div>
+ {% else %}
+ <div class="notification">
+ {{ _("%s did not leave a comment") % (reporter or report.reported_by) }}
+ </div>
+ {% end %}
+ </div>
+ </div>
+ </div>
{# Status #}
{% if status %}
- <h5 class="title is-5">
- {{ _("Status") }}
- </h5>
+ {% for l, s in sorted(status.items()) %}
+ <a class="panel-block" href="/dbl/lists/{{ l.slug }}/domains/{{ s.domain }}">
+ <span class="panel-icon">
+ {% if s.status == "ALLOWED" %}
+ <i class="fa-solid fa-check has-text-success" aria-hidden="true"></i>
+ {% elif s.status == "BLOCKED" %}
+ <i class="fa-solid fa-ban has-text-danger" aria-hidden="true"></i>
+ {% end %}
+ </span>
- <ul>
- {% for l, s in sorted(status.items()) %}
- <li>
- <a href="/dbl/lists/{{ l.slug }}/domains/{{ s.domain }}">
- {% if s.status == "ALLOWED" %}
- {{ _("%(name)s is currently allowed on %(list)s") % {
- "name" : report.name,
- "list" : l,
- } }}
- {% elif s.status == "BLOCKED" %}
- {{ _("%(name)s is currently blocked on %(list)s") % {
- "name" : report.name,
- "list" : l,
- } }}
- {% end %}
- </a>
- </li>
- {% end %}
- </ul>
+ {% if s.status == "ALLOWED" %}
+ {{ _("%(name)s is currently allowed on %(list)s") % {
+ "name" : report.name,
+ "list" : l,
+ } }}
+ {% elif s.status == "BLOCKED" %}
+ {{ _("%(name)s is currently blocked on %(list)s") % {
+ "name" : report.name,
+ "list" : l,
+ } }}
+ {% end %}
+ </a>
+ {% end %}
{% end %}
- </div>
+ </nav>
+
+ {% if current_user and current_user.is_dbl_moderator() %}
+ <div class="block">
+ <form method="POST" action="/dbl/reports/{{ report.id }}/approve">
+ {% raw xsrf_form_html() %}
+
+ <button class="button is-success is-fullwidth">
+ {{ _("Approve") }}
+ </button>
+ </form>
+ </div>
+
+ <div class="block">
+ <form method="POST" action="/dbl/reports/{{ report.id }}/reject">
+ {% raw xsrf_form_html() %}
+
+ <button class="button is-link is-outlined is-fullwidth">
+ {{ _("Reject") }}
+ </button>
+ </form>
+ </div>
+ {% end %}
</div>
</div>
</div>
# Fetch the list
list = await report.get_list()
+ # Fetch the reporter
+ reporter = self.backend.accounts.get_by_uid(report.reported_by)
+
# Fetch the domain status
if report.is_closed():
status = None
else:
status = await self.backend.dbl.search(report.name)
- self.render("dbl/reports/show.html", report=report, list=list, status=status)
+ self.render("dbl/reports/show.html", report=report,
+ list=list, reporter=reporter, status=status)
class SearchHandler(base.AnalyticsMixin, BaseHandler):