Properly indent search partial

This commit is contained in:
Mark Veidemanis 2022-08-28 12:02:09 +01:00
parent dc5bb61f37
commit d9234de7ab
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 214 additions and 214 deletions

View File

@ -1,14 +1,14 @@
<form class="skipEmptyFields" method="POST" hx-post="{% url 'search' %}" <form class="skipEmptyFields" method="POST" hx-post="{% url 'search' %}"
hx-trigger="change" hx-trigger="change"
hx-target="#results" hx-target="#results"
hx-swap="innerHTML" hx-swap="innerHTML"
hx-indicator="#spinner"> hx-indicator="#spinner">
{% csrf_token %} {% csrf_token %}
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<div class="field has-addons"> <div class="field has-addons">
<div id="query" class="control is-expanded has-icons-left"> <div id="query" class="control is-expanded has-icons-left">
<input <input
hx-post="{% url 'search' %}" hx-post="{% url 'search' %}"
hx-trigger="keyup changed delay:200ms" hx-trigger="keyup changed delay:200ms"
hx-target="#results" hx-target="#results"
@ -18,377 +18,377 @@
class="input" class="input"
type="text" type="text"
placeholder="(science | tech | art) + (interest) -hello"> placeholder="(science | tech | art) + (interest) -hello">
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i> <i class="fas fa-magnifying-glass"></i>
</span> </span>
</div> </div>
<div class="control"> <div class="control">
<div class="field"> <div class="field">
<button <button
id="search" id="search"
class="button is-info is-fullwidth" class="button is-info is-fullwidth"
hx-post="{% url 'search' %}" hx-post="{% url 'search' %}"
hx-trigger="click" hx-trigger="click"
hx-target="#results" hx-target="#results"
hx-swap="innerHTML"> hx-swap="innerHTML">
Search Search
</button> </button>
</div> </div>
</div>
</div> </div>
</div>
</div> </div>
<div class="column is-3"> <div class="column is-3">
<div class="nowrap-parent"> <div class="nowrap-parent">
<div <div
data-script="on click toggle .is-hidden on #options" data-script="on click toggle .is-hidden on #options"
class="button is-light has-text-link is-right nowrap-child"> class="button is-light has-text-link is-right nowrap-child">
Options Options
</div> </div>
<div class="nowrap-child"> <div class="nowrap-child">
<span id="spinner" class="button is-light has-text-link is-loading htmx-indicator">Static</span> <span id="spinner" class="button is-light has-text-link is-loading htmx-indicator">Static</span>
</div>
</div> </div>
</div>
</div> </div>
</div> </div>
<div id="options" class="block is-hidden"> <div id="options" class="block is-hidden">
<div class="columns is-multiline"> <div class="columns is-multiline">
<div class="column is-narrow"> <div class="column is-narrow">
<div class="field has-addons"> <div class="field has-addons">
<div class="control has-icons-left"> <div class="control has-icons-left">
<span class="select"> <span class="select">
<select name="size"> <select name="size">
{% for size in sizes %} {% for size in sizes %}
{% if size == params.size %} {% if size == params.size %}
<option selected value="{{ size }}">{{ size }}</option> <option selected value="{{ size }}">{{ size }}</option>
{% else %} {% else %}
<option value="{{ size }}">{{ size }}</option> <option value="{{ size }}">{{ size }}</option>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</select> </select>
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i> <i class="fas fa-magnifying-glass"></i>
</span> </span>
</span> </span>
</div> </div>
<p class="control"> <p class="control">
<a class="button is-static"> <a class="button is-static">
results results
</a> </a>
</p> </p>
</div> </div>
<div class="control"> <div class="control">
<div class="field rounded-tooltip"> <div class="field rounded-tooltip">
<input <input
id="full_query" id="full_query"
type="checkbox" type="checkbox"
class="switch is-rounded is-info" 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 %} {% if not perms.core.query_search %}
disabled disabled
{% endif %} {% endif %}
data-script="on click toggle .is-hidden on #query_full"> data-script="on click toggle .is-hidden on #query_full">
<label <label
for="full_query"> for="full_query">
Full query Full query
</label> </label>
{% if not perms.core.query_search %} {% if not perms.core.query_search %}
<span class="tooltiptext tag is-danger is-light">No access</span> <span class="tooltiptext tag is-danger is-light">No access</span>
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div> </div>
<div class="column is-narrow"> <div class="column is-narrow">
<div class="field has-addons block"> <div class="field has-addons block">
<div class="control has-icons-left"> <div class="control has-icons-left">
<span class="select"> <span class="select">
<select id="source" name="source"> <select id="source" name="source">
{% if params.source == 'irc' %} {% if params.source == 'irc' %}
<option selected value="irc">IRC</option> <option selected value="irc">IRC</option>
{% else %} {% else %}
<option value="irc">IRC</option> <option value="irc">IRC</option>
{% endif %} {% endif %}
{% if params.source == 'dis' %} {% if params.source == 'dis' %}
<option selected value="dis">Discord</option> <option selected value="dis">Discord</option>
{% else %} {% else %}
<option value="dis">Discord</option> <option value="dis">Discord</option>
{% endif %} {% endif %}
{% if params.source == None %} {% if params.source == None %}
<option selected value="all">All</option> <option selected value="all">All</option>
{% elif params.source == 'all' %} {% elif params.source == 'all' %}
<option selected value="all">All</option> <option selected value="all">All</option>
{% else %} {% else %}
<option value="all">All</option> <option value="all">All</option>
{% endif %} {% endif %}
</select> </select>
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i> <i class="fas fa-magnifying-glass"></i>
</span> </span>
</span> </span>
</div> </div>
<p class="control"> <p class="control">
<a class="button is-static"> <a class="button is-static">
source source
</a> </a>
</p> </p>
</div> </div>
<div class="control"> <div class="control">
<div class="field"> <div class="field">
<input <input
id="dedup_switch" id="dedup_switch"
type="checkbox" type="checkbox"
class="switch is-rounded is-info" class="switch is-rounded is-info"
name="dedup" name="dedup"
{% if params.dedup == "on" %} {% if params.dedup == "on" %}
checked="checked" checked="checked"
{% endif %}> {% endif %}>
<label <label
for="dedup_switch"> for="dedup_switch">
Deduplicate results Deduplicate results
</label> </label>
</div> </div>
</div> </div>
</div> </div>
<div class="column is-narrow"> <div class="column is-narrow">
<div id="sentiment"> <div id="sentiment">
<div class="field has-addons"> <div class="field has-addons">
<div class="control"> <div class="control">
<input <input
{% if params.check_sentiment != "on" %} {% if params.check_sentiment != "on" %}
disabled="undefined" disabled="undefined"
{% endif %} {% endif %}
name="sentiment" id="sliderWithValue" class="slider has-output-tooltip is-fullwidth" min="-1" max="1" name="sentiment" id="sliderWithValue" class="slider has-output-tooltip is-fullwidth" min="-1" max="1"
{% if params.sentiment == None %} {% if params.sentiment == None %}
value="0" value="0"
{% else %} {% else %}
value="{{ params.sentiment }}" value="{{ params.sentiment }}"
{% endif %} {% endif %}
step="0.05" type="range"> step="0.05" type="range">
<output for="sliderWithValue" class="slider-output"> <output for="sliderWithValue" class="slider-output">
{% if params.sentiment == None %} {% if params.sentiment == None %}
0 0
{% else %} {% else %}
{{ params.sentiment }} {{ params.sentiment }}
{% endif %} {% endif %}
</output> </output>
<script>bulmaSlider.attach();</script> <script>bulmaSlider.attach();</script>
</div> </div>
<p class="control"> <p class="control">
<a class="button is-static"> <a class="button is-static">
sentiment sentiment
</a> </a>
</p> </p>
</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" 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" %} {% if params.check_sentiment != "on" %}
disabled disabled
{% endif %}> {% 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" 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" %} {% if params.check_sentiment != "on" %}
disabled disabled
{% endif %}> {% 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>
</label> </label>
<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" 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" %} {% if params.check_sentiment != "on" %}
disabled disabled
{% endif %}> {% 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>
</label> </label>
<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" 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" %} {% if params.check_sentiment != "on" %}
disabled disabled
{% endif %}> {% 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>
<div class="control"> <div class="control">
<div class="field"> <div class="field">
<input <input
id="sentiment_switch" id="sentiment_switch"
type="checkbox" type="checkbox"
class="switch is-rounded is-info" class="switch is-rounded is-info"
name="check_sentiment" name="check_sentiment"
data-script="on click toggle @disabled on #sliderWithValue then toggle @disabled on #sentiment then toggle @disabled on .sentiment-radio" data-script="on click toggle @disabled on #sliderWithValue then toggle @disabled on #sentiment then toggle @disabled on .sentiment-radio"
{% if params.check_sentiment == "on" %} {% if params.check_sentiment == "on" %}
checked checked
{% endif %}> {% endif %}>
<label <label
for="sentiment_switch"> for="sentiment_switch">
Check sentiment Check sentiment
</label> </label>
</div> </div>
</div> </div>
<div class="control"> <div class="control">
<div class="field"> <div class="field">
<input <input
id="sentiment_graph_switch" id="sentiment_graph_switch"
type="checkbox" type="checkbox"
class="switch is-rounded is-info" class="switch is-rounded is-info"
name="show_sentiment" name="show_sentiment"
data-script="on click toggle .is-hidden on #sentiment-container"> data-script="on click toggle .is-hidden on #sentiment-container">
<label <label
for="sentiment_graph_switch"> for="sentiment_graph_switch">
Show graph Show graph
</label> </label>
</div> </div>
</div> </div>
</div> </div>
<div class="column is-narrow"> <div class="column is-narrow">
<div id="date"> <div id="date">
<div class="field"> <div class="field">
<div class="control"> <div class="control">
<input type="date" name="dates" value="{{ params.date }}"> <input type="date" name="dates" value="{{ params.date }}">
<script> <script>
var options = { var options = {
"type": "datetime", "type": "datetime",
"isRange": true, "isRange": true,
"color": "info", "color": "info",
"validateLabel": "Save", "validateLabel": "Save",
"dateFormat": "yyyy-MM-dd", "dateFormat": "yyyy-MM-dd",
"startDate": "{{ params.from_date|escapejs }}", "startDate": "{{ params.from_date|escapejs }}",
"startTime": "{{ params.from_time|escapejs }}", "startTime": "{{ params.from_time|escapejs }}",
"endDate": "{{ params.to_date|escapejs }}", "endDate": "{{ params.to_date|escapejs }}",
"endTime": "{{ params.to_time|escapejs }}", "endTime": "{{ params.to_time|escapejs }}",
"displayMode": "dialog" "displayMode": "dialog"
}; };
// Initialize all input of type date // Initialize all input of type date
var calendars = bulmaCalendar.attach('[type="date"]', options); var calendars = bulmaCalendar.attach('[type="date"]', options);
// Loop on each calendar initialized // Loop on each calendar initialized
for(var i = 0; i < calendars.length; i++) { for(var i = 0; i < calendars.length; i++) {
// Add listener to select event // Add listener to select event
calendars[i].on('save', date => { calendars[i].on('save', date => {
htmx.trigger("#search", "click"); htmx.trigger("#search", "click");
}); });
} }
</script> </script>
</div> </div>
</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" value="desc" name="sorting" <input type="radio" value="desc" name="sorting"
{% if params.sorting == None %} {% if params.sorting == None %}
checked checked
{% elif params.sorting == 'desc' %} {% elif params.sorting == 'desc' %}
checked checked
{% endif %} {% endif %}
> >
<span class="icon" data-tooltip="Sort descending"> <span class="icon" data-tooltip="Sort descending">
<i class="fa-solid fa-sort-down"></i> <i class="fa-solid fa-sort-down"></i>
</span> </span>
</label> </label>
<label class="radio button"> <label class="radio button">
<input type="radio" value="asc" name="sorting" <input type="radio" value="asc" name="sorting"
{% if params.sorting == 'asc' %} {% if params.sorting == 'asc' %}
checked checked
{% endif %}> {% endif %}>
<span class="icon" data-tooltip="Sort ascending"> <span class="icon" data-tooltip="Sort ascending">
<i class="fa-solid fa-sort-up"></i> <i class="fa-solid fa-sort-up"></i>
</span> </span>
</label> </label>
<label class="radio button"> <label class="radio button">
<input type="radio" value="none" name="sorting" <input type="radio" value="none" name="sorting"
{% if params.sorting == 'none' %} {% if params.sorting == 'none' %}
checked checked
{% endif %}> {% endif %}>
<span class="icon" data-tooltip="No sort"> <span class="icon" data-tooltip="No sort">
<i class="fa-solid fa-sort"></i> <i class="fa-solid fa-sort"></i>
</span> </span>
</label> </label>
</div> </div>
</div> </div>
</div> </div>
<div class="column is-narrow rounded-tooltip"> <div class="column is-narrow rounded-tooltip">
<div class="field has-addons"> <div class="field has-addons">
<div class="control has-icons-left"> <div class="control has-icons-left">
<span class="select is-warning"> <span class="select is-warning">
<select {% if not user.is_superuser %}disabled{% endif %} id="index" name="index"> <select {% if not user.is_superuser %}disabled{% endif %} id="index" name="index">
{% if params.index == 'main' %} {% if params.index == 'main' %}
<option selected value="main">Main</option> <option selected value="main">Main</option>
{% elif params.index == None %} {% elif params.index == None %}
<option selected value="main">Main</option> <option selected value="main">Main</option>
{% else %} {% else %}
<option value="main">Main</option> <option value="main">Main</option>
{% endif %} {% endif %}
{% if params.index == 'int' %} {% if params.index == 'int' %}
<option selected value="int">Internal</option> <option selected value="int">Internal</option>
{% else %} {% else %}
<option value="int">Internal</option> <option value="int">Internal</option>
{% endif %} {% endif %}
{% if params.index == 'meta' %} {% if params.index == 'meta' %}
<option selected value="meta">Meta</option> <option selected value="meta">Meta</option>
{% else %} {% else %}
<option value="meta">Meta</option> <option value="meta">Meta</option>
{% endif %} {% endif %}
</select> </select>
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i> <i class="fas fa-magnifying-glass"></i>
</span> </span>
</span> </span>
</div> </div>
<p class="control"> <p class="control">
<a class="button is-static"> <a class="button is-static">
index index
</a> </a>
</p> </p>
</div> </div>
{% if not user.is_superuser %} {% if not user.is_superuser %}
<span class="tooltiptext tag is-danger is-light">No access</span> <span class="tooltiptext tag is-danger is-light">No access</span>
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div> </div>
<div id="query_full" class="block {% if params.query_full is None %}is-hidden{% endif %}"> <div id="query_full" class="block {% if params.query_full is None %}is-hidden{% endif %}">
<div class="control is-expanded has-icons-left"> <div class="control is-expanded has-icons-left">
<input <input
hx-post="{% url 'search' %}" hx-post="{% url 'search' %}"
hx-trigger="keyup changed delay:200ms" hx-trigger="keyup changed delay:200ms"
hx-target="#results" hx-target="#results"
@ -398,24 +398,24 @@
class="input" class="input"
type="text" type="text"
placeholder="msg: science AND nick: BillNye AND channel: #science"> placeholder="msg: science AND nick: BillNye AND channel: #science">
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fas fa-magnifying-glass"></i> <i class="fas fa-magnifying-glass"></i>
</span> </span>
</div> </div>
</div> </div>
<div class="block"> <div class="block">
<input <input
hx-trigger="change" hx-trigger="change"
hx-post="{% url 'search' %}" hx-post="{% url 'search' %}"
hx-target="#results" hx-target="#results"
hx-swap="innerHTML" hx-swap="innerHTML"
id="tags" id="tags"
class="input" class="input"
type="tags" type="tags"
name="tags" name="tags"
placeholder="Add tags" placeholder="Add tags"
value="{{ params.tags }}"> value="{{ params.tags }}">
</div> </div>
<div class="is-hidden"></div> <div class="is-hidden"></div>
</div> </div>
</form> </form>