Reformat templates

This commit is contained in:
Mark Veidemanis 2022-07-21 13:51:59 +01:00
parent 185bda02ea
commit 423d363f9f
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
4 changed files with 91 additions and 76 deletions

View File

@ -35,6 +35,9 @@
});
</script>
<style>
.icon { border-bottom: 0px !important;}
</style>
</head>
<body>

View File

@ -35,9 +35,6 @@
});
}
</script>
<style>
.icon { border-bottom: 0px !important;}
</style>
<div class="box">
<form method="POST">
{% csrf_token %}
@ -77,7 +74,12 @@
<div class="field">
<div class="control">
<button class="button is-primary is-fullwidth" hx-post="{% url 'search_drilldown' %}" hx-trigger="click" hx-target="#results" hx-swap="outerHTML">
<button
class="button is-primary is-fullwidth"
hx-post="{% url 'search_drilldown' %}"
hx-trigger="click"
hx-target="#results"
hx-swap="outerHTML">
Search
</button>
</div>

View File

@ -58,7 +58,12 @@
</div>
<div class="field">
<div class="control">
<button class="button is-primary is-fullwidth" hx-post="{% url 'search_insights' %}" hx-trigger="click" hx-target="#results" hx-swap="outerHTML">
<button
class="button is-primary is-fullwidth"
hx-post="{% url 'search_insights' %}"
hx-trigger="click"
hx-target="#results"
hx-swap="outerHTML">
Search
</button>
</div>
@ -67,13 +72,14 @@
</div>
<div id="results">
</div>
</div>
<div class="tile is-parent">
<p> 2</p>
<div class="tile is-child box">
<p> 2</p>
</div>
</div>
</div>

View File

@ -1,77 +1,81 @@
{% load static %}
{% load index %}
<div class="tile is-child box">
<div id="results">
<div id="results">
<div class="tile is-child box">
{% if item is not None %}
<div class="table-container">
<table class="table is-hoverable is-fullwidth">
<tr>
<th>src</th>
<td>
{% if item|index:'src' == 'irc' %}
<span class="icon" data-tooltip="IRC">
<i class="fa-solid fa-hashtag" aria-hidden="true"></i>
</span>
{% elif item|index:'src' == 'dis' %}
<span class="icon" data-tooltip="Discord">
<i class="fa-brands fa-discord" aria-hidden="true"></i>
</span>
{% endif %}
</td>
</tr>
<tr>
<th>nick</th>
<td>
{% if item|index:'online' is True %}
<span class="icon has-text-success has-tooltip-success" data-tooltip="Online">
<i class="fa-solid fa-circle"></i>
</span>
{{ item.nick }}
{% elif item|index:'online' is False %}
<span class="icon has-text-danger has-tooltip-danger" data-tooltip="Offline">
<i class="fa-solid fa-circle"></i>
</span>
{{ item|index:'nick' }}
{% else %}
<span class="icon has-text-warning has-tooltip-warning" data-tooltip="Unknown">
<i class="fa-solid fa-circle"></i>
</span>
{{ item|index:'nick'}}
{% endif %}
{% if item|index:'num_chans' is not None %}
<span class="tag">
{{ item|index:'num_chans' }}
</span>
{% endif %}
</td>
</tr>
<tr>
<th>host</th>
<td>{{ item.host }}</td>
</tr>
<tr>
<th>actions</th>
<td>
{% if item.src == 'irc' %}
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{% url 'modal_insights' %}"
hx-vals='{"net": "{{ item.net }}", "nick": "{{ item.nick }}", "channel": "{{ item.channel }}"}'
hx-target="#modals-here"
hx-trigger="click"
class="button is-small">
Information
</button>
<div id="modals-here"></div>
{% endif %}
</td>
</tr>
<tr>
<th>net</th>
<td>{{ item.net }}</td>
</tr>
<table class="table is-fullwidth">
<tbody>
<tr>
<th>src</th>
<td>
{% if item|index:'src' == 'irc' %}
<span class="icon" data-tooltip="IRC">
<i class="fa-solid fa-hashtag" aria-hidden="true"></i>
</span>
IRC
{% elif item|index:'src' == 'dis' %}
<span class="icon" data-tooltip="Discord">
<i class="fa-brands fa-discord" aria-hidden="true"></i>
</span>
Discord
{% endif %}
</td>
</tr>
<tr>
<th>nick</th>
<td>
{% if item|index:'online' is True %}
<span class="icon has-text-success has-tooltip-success" data-tooltip="Online">
<i class="fa-solid fa-circle"></i>
</span>
{{ item.nick }}
{% elif item|index:'online' is False %}
<span class="icon has-text-danger has-tooltip-danger" data-tooltip="Offline">
<i class="fa-solid fa-circle"></i>
</span>
{{ item|index:'nick' }}
{% else %}
<span class="icon has-text-warning has-tooltip-warning" data-tooltip="Unknown">
<i class="fa-solid fa-circle"></i>
</span>
{{ item|index:'nick'}}
{% endif %}
{% if item|index:'num_chans' is not None %}
<span class="tag">
{{ item|index:'num_chans' }}
</span>
{% endif %}
</td>
</tr>
<tr>
<th>host</th>
<td>{{ item.host }}</td>
</tr>
<tr>
<th>actions</th>
<td>
{% if item.src == 'irc' %}
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{% url 'modal_insights' %}"
hx-vals='{"net": "{{ item.net }}", "nick": "{{ item.nick }}", "channel": "{{ item.channel }}"}'
hx-target="#modals-here"
hx-trigger="click"
class="button is-small">
Information
</button>
<div id="modals-here"></div>
{% endif %}
</td>
</tr>
<tr>
<th>net</th>
<td>{{ item.net }}</td>
</tr>
</tbody>
</table>
</div>
{% endif %}