Properly format templates
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load hy %}
|
||||
{% block content %}
|
||||
<script src="{% static 'js/chart.js' %}"></script>
|
||||
<script>
|
||||
@@ -104,7 +105,7 @@
|
||||
<div class="column is-3">
|
||||
<div class="nowrap-parent">
|
||||
<div
|
||||
_="on click toggle .is-hidden on #options"
|
||||
{{ hy }} = "on click toggle .is-hidden on #options"
|
||||
class="button is-light has-text-link is-right nowrap-child">
|
||||
Options
|
||||
</div>
|
||||
|
||||
@@ -4,25 +4,24 @@
|
||||
{% if results %}
|
||||
<div style="display: none" id="jsonData" data-json="{{ data }}">
|
||||
</div>
|
||||
|
||||
<div class="has-text-grey-light nowrap-parent">
|
||||
<div class="nowrap-child block">
|
||||
<i class="fa-solid fa-chart-mixed"></i>
|
||||
</div>
|
||||
<div class="nowrap-child">
|
||||
<p>fetched {{ results|length }} of {{ card }} hits in {{ took }}ms</p>
|
||||
</div>
|
||||
{% if exemption is not None %}
|
||||
<div class="nowrap-child block">
|
||||
<i class="fa-solid fa-chart-mixed"></i>
|
||||
</div>
|
||||
<div class="nowrap-child">
|
||||
<p>fetched {{ results|length }} of {{ card }} hits in {{ took }}ms</p>
|
||||
</div>
|
||||
{% if exemption is not None %}
|
||||
<div class="nowrap-child">
|
||||
<i class="fa-solid fa-book-bible"></i>
|
||||
</div>
|
||||
{% else %}
|
||||
{% if redacted != 0 %}
|
||||
{% else %}
|
||||
{% if redacted != 0 %}
|
||||
<div class="nowrap-child">
|
||||
<p>{{ redacted }} redacted</p>
|
||||
<p>{{ redacted }} redacted</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="box">
|
||||
<div style="height: 30rem">
|
||||
@@ -48,24 +47,23 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in results %}
|
||||
{% if item.exemption == True %}
|
||||
<tr class="has-background-grey-lighter">
|
||||
{% elif item.type == 'join' %}
|
||||
<tr class="has-background-success-light">
|
||||
{% elif item.type == 'quit' %}
|
||||
<tr class="has-background-danger-light">
|
||||
{% elif item.type == 'kick' %}
|
||||
<tr class="has-background-danger-light">
|
||||
{% elif item.type == 'part' %}
|
||||
<tr class="has-background-warning-light">
|
||||
{% elif item.type == 'mode' %}
|
||||
<tr class="has-background-info-light">
|
||||
{% else %}
|
||||
<tr>
|
||||
{% endif %}
|
||||
{# Workaround for curlylint #}
|
||||
<tr class="{% if item.exemption == True %}
|
||||
has-background-grey-lighter
|
||||
{% elif item.type == 'join' %}
|
||||
has-background-success-light
|
||||
{% elif item.type == 'quit' %}
|
||||
has-background-danger-light
|
||||
{% elif item.type == 'kick' %}
|
||||
has-background-danger-light
|
||||
{% elif item.type == 'part' %}
|
||||
has-background-warning-light
|
||||
{% elif item.type == 'mode' %}
|
||||
has-background-info-light
|
||||
{% endif %}">
|
||||
<td>
|
||||
<a class="has-text-link is-underlined"
|
||||
onclick="toggleTag('src', '{{ item.src|escapejs }}')">
|
||||
onclick="toggleTag('src', '{{ item.src|escapejs }}')">
|
||||
{% if item.src == 'irc' %}
|
||||
<span class="icon" data-tooltip="IRC">
|
||||
<i class="fa-solid fa-hashtag" aria-hidden="true"></i>
|
||||
@@ -79,7 +77,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<a class="has-text-link is-underlined"
|
||||
onclick="toggleTag('type', '{{ item.type|escapejs }}')">
|
||||
onclick="toggleTag('type', '{{ item.type|escapejs }}')">
|
||||
{% if item.type == 'msg' %}
|
||||
<span class="icon" data-tooltip="Message">
|
||||
<i class="fa-solid fa-message"></i>
|
||||
@@ -124,7 +122,7 @@
|
||||
<td style="max-width: 10em" class="wrap">{{ item.msg }}</td>
|
||||
<td>
|
||||
<a class="has-text-link is-underlined"
|
||||
onclick="toggleTag('host', '{{ item.host|escapejs }}')">
|
||||
onclick="toggleTag('host', '{{ item.host|escapejs }}')">
|
||||
{{ item.host }}
|
||||
</a>
|
||||
</td>
|
||||
@@ -148,13 +146,13 @@
|
||||
<a class="nowrap-child has-text-link is-underlined" onclick="toggleTag('nick', '{{ item.nick|escapejs }}')">
|
||||
{{ item.nick }}
|
||||
</a>
|
||||
{% if item.num_chans is not None %}
|
||||
{% if item.num_chans is not None %}
|
||||
<div class="nowrap-child">
|
||||
<span class="tag">
|
||||
{{ item.num_chans }}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
@@ -173,7 +171,7 @@
|
||||
<td>
|
||||
<div class="nowrap-parent">
|
||||
<a class="nowrap-child has-text-link is-underlined"
|
||||
onclick="toggleTag('channel', '{{ item.channel|escapejs }}')">
|
||||
onclick="toggleTag('channel', '{{ item.channel|escapejs }}')">
|
||||
{{ item.channel }}
|
||||
</a>
|
||||
{% if item.num_users is not None %}
|
||||
@@ -187,7 +185,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<a class="has-text-link is-underlined"
|
||||
onclick="toggleTag('net', '{{ item.net|escapejs }}')">
|
||||
onclick="toggleTag('net', '{{ item.net|escapejs }}')">
|
||||
{{ item.net }}
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@@ -6,23 +6,23 @@
|
||||
</div>
|
||||
|
||||
<div class="has-text-grey-light nowrap-parent">
|
||||
<div class="nowrap-child block">
|
||||
<i class="fa-solid fa-chart-mixed"></i>
|
||||
</div>
|
||||
<div class="nowrap-child">
|
||||
<p>fetched {{ results|length }} of {{ card }} hits in {{ took }}ms</p>
|
||||
</div>
|
||||
{% if exemption is not None %}
|
||||
<div class="nowrap-child block">
|
||||
<i class="fa-solid fa-chart-mixed"></i>
|
||||
</div>
|
||||
<div class="nowrap-child">
|
||||
<p>fetched {{ results|length }} of {{ card }} hits in {{ took }}ms</p>
|
||||
</div>
|
||||
{% if exemption is not None %}
|
||||
<div class="nowrap-child">
|
||||
<i class="fa-solid fa-book-bible"></i>
|
||||
</div>
|
||||
{% else %}
|
||||
{% if redacted != 0 %}
|
||||
{% else %}
|
||||
{% if redacted != 0 %}
|
||||
<div class="nowrap-child">
|
||||
<p>{{ redacted }} redacted</p>
|
||||
<p>{{ redacted }} redacted</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="table-container">
|
||||
|
||||
@@ -6,66 +6,70 @@
|
||||
|
||||
{% block table.thead %}
|
||||
{% if table.show_header %}
|
||||
<thead {{ table.attrs.thead.as_html }}>
|
||||
<thead {{ table.attrs.thead.as_html }}>
|
||||
<tr>
|
||||
{% for column in table.columns %}
|
||||
<th {{ column.attrs.th.as_html }}
|
||||
hx-post="{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-trigger="click"
|
||||
hx-target="div.table-container"
|
||||
hx-swap="outerHTML"
|
||||
hx-indicator=".progress"
|
||||
style="cursor: pointer;">
|
||||
{{ column.header }}
|
||||
</th>
|
||||
{% endfor %}
|
||||
{% for column in table.columns %}
|
||||
<th
|
||||
{{ column.attrs.th.as_html }}
|
||||
hx-post="{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-trigger="click"
|
||||
hx-target="div.table-container"
|
||||
hx-swap="outerHTML"
|
||||
hx-indicator=".progress"
|
||||
style="cursor: pointer;">
|
||||
{{ column.header }}
|
||||
</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
</thead>
|
||||
{% endif %}
|
||||
{% endblock table.thead %}
|
||||
|
||||
{# Pagination block overrides #}
|
||||
{% block pagination.previous %}
|
||||
<li class="previous page-item">
|
||||
<div hx-post="{% querystring table.prefixed_page_field=table.page.previous_page_number %}"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-trigger="click"
|
||||
hx-target="div.table-container"
|
||||
hx-swap="outerHTML"
|
||||
hx-indicator=".progress"
|
||||
class="page-link">
|
||||
<span aria-hidden="true">«</span>
|
||||
{% trans 'previous' %}
|
||||
</div>
|
||||
</li>
|
||||
<li class="previous page-item">
|
||||
<div
|
||||
hx-post="{% querystring table.prefixed_page_field=table.page.previous_page_number %}"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-trigger="click"
|
||||
hx-target="div.table-container"
|
||||
hx-swap="outerHTML"
|
||||
hx-indicator=".progress"
|
||||
class="page-link">
|
||||
<span aria-hidden="true">«</span>
|
||||
{% trans 'previous' %}
|
||||
</div>
|
||||
</li>
|
||||
{% endblock pagination.previous %}
|
||||
{% block pagination.range %}
|
||||
{% for p in table.page|table_page_range:table.paginator %}
|
||||
<li class="page-item{% if table.page.number == p %} active{% endif %}">
|
||||
<div class="page-link"
|
||||
{% if p != '...' %}hx-post="{% querystring table.prefixed_page_field=p %}"{% endif %}
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-trigger="click"
|
||||
hx-target="div.table-container"
|
||||
hx-swap="outerHTML"
|
||||
hx-indicator=".progress">
|
||||
{{ p }}
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% for p in table.page|table_page_range:table.paginator %}
|
||||
<li class="page-item{% if table.page.number == p %} active{% endif %}">
|
||||
<div
|
||||
class="page-link"
|
||||
{% if p != '...' %}hx-post="{% querystring table.prefixed_page_field=p %}"{% endif %}
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-trigger="click"
|
||||
hx-target="div.table-container"
|
||||
hx-swap="outerHTML"
|
||||
hx-indicator=".progress">
|
||||
{{ p }}
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% endblock pagination.range %}
|
||||
{% block pagination.next %}
|
||||
<li class="next page-item">
|
||||
<div hx-post="{% querystring table.prefixed_page_field=table.page.next_page_number %}"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-trigger="click"
|
||||
hx-target="div.table-container"
|
||||
hx-swap="outerHTML"
|
||||
hx-indicator=".progress"
|
||||
class="page-link">
|
||||
{% trans 'next' %}
|
||||
<span aria-hidden="true">»</span>
|
||||
</div>
|
||||
</li>
|
||||
<li class="next page-item">
|
||||
<div
|
||||
hx-post="{% querystring table.prefixed_page_field=table.page.next_page_number %}"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-trigger="click"
|
||||
hx-target="div.table-container"
|
||||
hx-swap="outerHTML"
|
||||
hx-indicator=".progress"
|
||||
class="page-link">
|
||||
{% trans 'next' %}
|
||||
<span aria-hidden="true">»</span>
|
||||
</div>
|
||||
</li>
|
||||
{% endblock pagination.next %}
|
||||
Reference in New Issue
Block a user