Replace checkboxes with switches and fix sentiment visibility

This commit is contained in:
Mark Veidemanis 2022-08-26 18:05:24 +01:00
parent e8f1791444
commit 83d5f64db6
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 53 additions and 27 deletions

View File

@ -140,7 +140,7 @@
<input <input
id="full_query" id="full_query"
type="checkbox" type="checkbox"
class="switch is-rounded" class="switch is-rounded is-info"
{% if params.query_full is not None %}checked="checked"{% else %}none{% endif %} {% if params.query_full is not None %}checked="checked"{% else %}none{% endif %}
{% if not perms.core.query_search %}disabled{% endif %} {% if not perms.core.query_search %}disabled{% endif %}
data-script="on click toggle .is-hidden on #query_full"> data-script="on click toggle .is-hidden on #query_full">
@ -187,20 +187,24 @@
</p> </p>
</div> </div>
<div class="control"> <div class="control">
<label class="button has-text-link"> <div class="field">
<input type="checkbox" <input
name="dedup" id="dedup_switch"
{% if params.dedup == "on" %} type="checkbox"
checked class="switch is-rounded is-info"
{% endif %}> name="dedup"
<span class="icon" data-tooltip="Deduplicate results"> {% if params.dedup == "on" %}
<i class="fa-solid fa-copy"></i> checked="checked"
</span> {% endif %}>
</label> <label
for="dedup_switch">
Deduplicate results
</label>
</div>
</div> </div>
</div> </div>
<div class="column is-narrow"> <div class="column is-narrow">
<div id="sentiment block"> <div id="sentiment">
<div class="field has-addons"> <div class="field has-addons">
<div class="control"> <div class="control">
<input <input
@ -231,25 +235,31 @@
</div> </div>
<div class="control"> <div class="control">
<label class="radio button has-text-link"> <label class="radio button has-text-link">
<input type="radio" <input type="radio"
value="below" value="below"
class="sentiment-radio"
{% if params.sentiment_method == 'below' %} {% if params.sentiment_method == 'below' %}
checked checked
{% endif %} {% endif %}
name="sentiment_method"> name="sentiment_method"
{% if params.check_sentiment != "on" %}
disabled
{% endif %}>
<span class="icon" data-tooltip="Below"> <span class="icon" data-tooltip="Below">
<i class="fa-solid fa-face-frown"></i> <i class="fa-solid fa-face-frown"></i>
</span> </span>
</label> </label>
<label class="radio button has-text-link is-hidden"> <label class="radio button has-text-link is-hidden">
<input type="radio" <input type="radio"
value="exact" value="exact"
class="sentiment-radio"
{% if params.sentiment_method == 'exact' %} {% if params.sentiment_method == 'exact' %}
checked checked
{% endif %} {% endif %}
name="sentiment_method"> name="sentiment_method"
{% if params.check_sentiment != "on" %}
disabled
{% endif %}>
<span class="icon" data-tooltip="Exact"> <span class="icon" data-tooltip="Exact">
<i class="fa-solid fa-face-smile"></i> <i class="fa-solid fa-face-smile"></i>
</span> </span>
@ -257,10 +267,14 @@
<label class="radio button has-text-link"> <label class="radio button has-text-link">
<input type="radio" <input type="radio"
value="above" value="above"
class="sentiment-radio"
{% if params.sentiment_method == 'above' %} {% if params.sentiment_method == 'above' %}
checked checked
{% endif %} {% endif %}
name="sentiment_method"> name="sentiment_method"
{% if params.check_sentiment != "on" %}
disabled
{% endif %}>
<span class="icon" data-tooltip="Above"> <span class="icon" data-tooltip="Above">
<i class="fa-solid fa-face-smile"></i> <i class="fa-solid fa-face-smile"></i>
</span> </span>
@ -268,25 +282,37 @@
<label class="radio button has-text-link"> <label class="radio button has-text-link">
<input type="radio" <input type="radio"
value="nonzero" value="nonzero"
class="sentiment-radio"
{% if params.sentiment_method == 'nonzero' %} {% if params.sentiment_method == 'nonzero' %}
checked checked
{% endif %} {% endif %}
name="sentiment_method"> name="sentiment_method"
{% if params.check_sentiment != "on" %}
disabled
{% endif %}>
<span class="icon" data-tooltip="Nonzero"> <span class="icon" data-tooltip="Nonzero">
<i class="fa-solid fa-face-meh-blank"></i> <i class="fa-solid fa-face-meh-blank"></i>
</span> </span>
</label> </label>
</div> </div>
</div> </div>
<label class="checkbox button mt-5"> <div class="control">
<input type="checkbox" <div class="field">
name="check_sentiment" <input
{% if params.check_sentiment == "on" %} id="sentiment_switch"
checked type="checkbox"
{% endif %} class="switch is-rounded is-info"
data-script="on click toggle @disabled on #sliderWithValue then toggle @disabled on #sentiment"> name="check_sentiment"
Check sentiment data-script="on click toggle @disabled on #sliderWithValue then toggle @disabled on #sentiment then toggle @disabled on .sentiment-radio"
</label> {% if params.check_sentiment == "on" %}
checked
{% endif %}>
<label
for="sentiment_switch">
Check sentiment
</label>
</div>
</div>
</div> </div>
<div class="column is-narrow"> <div class="column is-narrow">
<div id="date"> <div id="date">