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> </script>
<style>
.icon { border-bottom: 0px !important;}
</style>
</head> </head>
<body> <body>

View File

@ -35,9 +35,6 @@
}); });
} }
</script> </script>
<style>
.icon { border-bottom: 0px !important;}
</style>
<div class="box"> <div class="box">
<form method="POST"> <form method="POST">
{% csrf_token %} {% csrf_token %}
@ -77,7 +74,12 @@
<div class="field"> <div class="field">
<div class="control"> <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 Search
</button> </button>
</div> </div>

View File

@ -58,7 +58,12 @@
</div> </div>
<div class="field"> <div class="field">
<div class="control"> <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 Search
</button> </button>
</div> </div>
@ -67,13 +72,14 @@
</div> </div>
<div id="results"> <div id="results">
</div> </div>
</div> </div>
<div class="tile is-parent"> <div class="tile is-parent">
<p> 2</p> <div class="tile is-child box">
<p> 2</p>
</div>
</div> </div>
</div> </div>

View File

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