Improve search forms

This commit is contained in:
Mark Veidemanis 2022-08-03 07:20:30 +01:00
parent 716bd6afb6
commit 9442e92b31
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
8 changed files with 85 additions and 84 deletions

View File

@ -123,7 +123,7 @@ def run_main_query(client, user, query, custom_query=False, index=None, size=Non
search_query = construct_query(query, size)
try:
response = client.search(body=search_query, index=index)
except RequestError as err:
except RequestError:
return False
filter_blacklisted(user, response)
return response

View File

@ -7,7 +7,7 @@
hx-trigger="click"
hx-target="#actions"
hx-swap="outerHTML"
class="button is-success">
class="button is-primary">
<span class="icon-text">
<span class="icon">
<i class="fa-solid fa-plus"></i>
@ -21,7 +21,7 @@
hx-trigger="click"
hx-target="#actions"
hx-swap="outerHTML"
class="button is-success">
class="button is-primary">
<span class="icon-text">
<span class="icon">
<i class="fa-solid fa-wrench"></i>
@ -35,7 +35,7 @@
hx-trigger="click"
hx-target="#actions"
hx-swap="outerHTML"
class="button is-success">
class="button is-primary">
<span class="icon-text">
<span class="icon">
<i class="fa-solid fa-list"></i>

View File

@ -6,7 +6,7 @@
hx-get="{% url 'threshold_irc_actions_add-network' %}"
hx-trigger="click"
hx-target="#modals-here-actions"
class="button is-success">
class="button is-primary">
<span class="icon-text">
<span class="icon">
<i class="fa-solid fa-plus"></i>
@ -20,7 +20,7 @@
hx-trigger="click"
hx-target="#actions"
hx-swap="outerHTML"
class="button is-success">
class="button is-primary">
<span class="icon-text">
<span class="icon">
<i class="fa-solid fa-wrench"></i>
@ -30,7 +30,7 @@
</button>
<button
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
class="button is-success">
class="button is-primary">
<span class="icon-text">
<span class="icon">
<i class="fa-solid fa-list"></i>

View File

@ -29,8 +29,7 @@
</span>
</button>
<button
class="button is-small">
<button class="button is-small">
<span class="icon" data-tooltip="Self">
<i class="fa-solid fa-message-bot"></i>
</span>
@ -56,6 +55,7 @@
</td>
<td>
{{ alert.net }}/{{ alert.num }}
</td>
<td>
{% if alert.type == 'conn' %}
<span class="icon" data-tooltip="Conn">
@ -81,7 +81,9 @@
{{ alert.type }}
{% endif %}
</td>
<td style="max-width: 10em" class="wrap">{{ alert.msg }}</td>
<td class="wrap" style="max-width: 10em">
{{ alert.msg }}
</td>
</tr>
{% endfor %}
</tbody>

View File

@ -5,42 +5,18 @@
<div class="box">
<form method="POST">
{% csrf_token %}
<div class="field">
<label class="label">Search</label>
<div class="field-body">
<div class="field">
<div class="columns">
<div class="column">
<div class="field has-addons">
<div class="control is-expanded has-icons-left">
<input name="query" class="input" type="text" placeholder="msg: science AND nick: BillNye AND channel: #science">
<span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i>
</span>
</div>
</div>
</div>
</div>
<div class="columns">
<div class="column">
<label class="label">Results</label>
<div class="field">
<div class="control is-expanded has-icons-left">
<div class="select is-fullwidth">
<select name="size">
{% for size in sizes %}
<option value="{{ size }}">{{ size }}</option>
{% endfor %}
</select>
<span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i>
</span>
</div>
</div>
</div>
</div>
</div>
<div class="field">
<div class="control">
<div class="field">
<button
class="button is-primary is-fullwidth"
hx-post="{% url 'search_drilldown' %}"
@ -51,6 +27,31 @@
</button>
</div>
</div>
</div>
</div>
<div class="column">
<div class="field has-addons">
<div class="control is-expanded has-icons-left">
<span class="select is-fullwidth">
<select name="size">
{% for size in sizes %}
<option value="{{ size }}">{{ size }}</option>
{% endfor %}
</select>
<span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i>
</span>
</span>
</div>
<p class="control">
<a class="button is-static">
results
</a>
</p>
</div>
</div>
</div>
</form>
</div>

View File

@ -28,6 +28,7 @@
</thead>
<tbody>
{% for item in results %}
<tr>
{% if item.type == 'join' %}
<tr class="has-background-success-light">
{% elif item.type == 'quit' %}

View File

@ -23,6 +23,10 @@
<div class="content" style="max-height: 30em; overflow: auto;">
<div class="table-container">
<table class="table is-fullwidth is-hoverable">
<thead>
<th>attribute</th>
<th>value</th>
</thead>
<tbody>
<tr>
<th>src</th>

View File

@ -44,20 +44,13 @@
<article class="tile is-child box">
<form method="POST">
{% csrf_token %}
<div class="field">
<label class="label">Search</label>
<div class="field-body">
<div class="field">
<div class="field has-addons">
<div class="control is-expanded has-icons-left">
<input id="query" name="query" class="input" type="text" placeholder="nickname">
<span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i>
</span>
</div>
</div>
</div>
</div>
<div class="field">
<div class="control">
<button
class="button is-primary is-fullwidth"