Don't add sources to query if we are allowed to see them all

master
Mark Veidemanis 2 years ago
parent 667e4c475f
commit 02e1b4698d
Signed by: m
GPG Key ID: 5ACFCEED46C0904F

@ -162,9 +162,13 @@ def query_results(
sources.append(source_iter) sources.append(source_iter)
add_top_tmp = {"bool": {"should": []}} add_top_tmp = {"bool": {"should": []}}
total_count = 0
for source_iter in sources: for source_iter in sources:
add_top_tmp["bool"]["should"].append({"equals": {"src": source_iter}}) add_top_tmp["bool"]["should"].append({"equals": {"src": source_iter}})
add_top.append(add_top_tmp) total_count += 1
total_sources = len(settings.MANTICORE_MAIN_SOURCES) + len(settings.MANTICORE_SOURCES_RESTRICTED)
if not total_count == total_sources:
add_top.append(add_top_tmp)
# Date/time range # Date/time range
if set({"from_date", "to_date", "from_time", "to_time"}).issubset( if set({"from_date", "to_date", "from_time", "to_time"}).issubset(

@ -4,485 +4,485 @@
{% load joinsep %} {% load joinsep %}
{% load urlsafe %} {% load urlsafe %}
{% block table-wrapper %} {% block table-wrapper %}
<div id="drilldown-table" class="column-shifter-container" style="position:relative; z-index:1;"> <div id="drilldown-table" class="column-shifter-container" style="position:relative; z-index:1;">
{% block table %} {% block table %}
<div class="nowrap-parent"> <div class="nowrap-parent">
<div class="nowrap-child"> <div class="nowrap-child">
<div class="dropdown" id="dropdown"> <div class="dropdown" id="dropdown">
<div class="dropdown-trigger"> <div class="dropdown-trigger">
<button id="dropdown-trigger" class="button dropdown-toggle" aria-haspopup="true" aria-controls="dropdown-menu"> <button id="dropdown-trigger" class="button dropdown-toggle" aria-haspopup="true" aria-controls="dropdown-menu">
<span>Show/hide fields</span> <span>Show/hide fields</span>
<span class="icon is-small"> <span class="icon is-small">
<i class="fas fa-angle-down" aria-hidden="true"></i> <i class="fas fa-angle-down" aria-hidden="true"></i>
</span> </span>
</button> </button>
</div>
<div class="dropdown-menu" id="dropdown-menu" role="menu">
<div class="dropdown-content" style="position:absolute; z-index:2;">
{% for column in table.columns %}
{% if column.name in show %}
<a class="btn-shift-column dropdown-item"
data-td-class="{{ column.name }}"
data-state="on"
{% if not forloop.last %} style="border-bottom:1px solid #ccc;" {%endif %}
data-table-class-container="drilldown-table">
<span class="check icon" data-tooltip="Visible" style="display:none;">
<i class="fa-solid fa-check"></i>
</span>
<span class="uncheck icon" data-tooltip="Hidden" style="display:none;">
<i class="fa-solid fa-xmark"></i>
</span>
{{ column.header }}
</a>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
<div class="nowrap-child">
<span id="loader" class="button is-light has-text-link is-loading">Static</span>
</div>
</div> </div>
<script> <div class="dropdown-menu" id="dropdown-menu" role="menu">
var dropdown_button = document.getElementById("dropdown-trigger"); <div class="dropdown-content" style="position:absolute; z-index:2;">
var dropdown = document.getElementById("dropdown"); {% for column in table.columns %}
dropdown_button.addEventListener('click', function(e) { {% if column.name in show %}
// elements[i].preventDefault(); <a class="btn-shift-column dropdown-item"
dropdown.classList.toggle('is-active'); data-td-class="{{ column.name }}"
}); data-state="on"
{% if not forloop.last %} style="border-bottom:1px solid #ccc;" {%endif %}
data-table-class-container="drilldown-table">
<span class="check icon" data-tooltip="Visible" style="display:none;">
<i class="fa-solid fa-check"></i>
</span>
<span class="uncheck icon" data-tooltip="Hidden" style="display:none;">
<i class="fa-solid fa-xmark"></i>
</span>
{{ column.header }}
</a>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
<div class="nowrap-child">
<span id="loader" class="button is-light has-text-link is-loading">Static</span>
</div>
</div>
<script>
var dropdown_button = document.getElementById("dropdown-trigger");
var dropdown = document.getElementById("dropdown");
dropdown_button.addEventListener('click', function(e) {
// elements[i].preventDefault();
dropdown.classList.toggle('is-active');
});
</script> </script>
<div id="table-container" style="display:none;"> <div id="table-container" style="display:none;">
<table {% render_attrs table.attrs class="table drilldown-results-table is-fullwidth" %}> <table {% render_attrs table.attrs class="table drilldown-results-table is-fullwidth" %}>
{% block table.thead %} {% block table.thead %}
{% if table.show_header %} {% if table.show_header %}
<thead {% render_attrs table.attrs.thead class="" %}> <thead {% render_attrs table.attrs.thead class="" %}>
{% block table.thead.row %} {% block table.thead.row %}
<tr> <tr>
{% for column in table.columns %} {% for column in table.columns %}
{% if column.name in show %} {% if column.name in show %}
{% block table.thead.th %} {% block table.thead.th %}
<th class="orderable {{ column.name }}"> <th class="orderable {{ column.name }}">
<div class="nowrap-parent"> <div class="nowrap-parent">
{% if column.orderable %} {% if column.orderable %}
<div class="nowrap-child"> <div class="nowrap-child">
{% if column.is_ordered %} {% if column.is_ordered %}
{% is_descending column.order_by as descending %} {% is_descending column.order_by as descending %}
{% if descending %} {% if descending %}
<span class="icon" aria-hidden="true">{% block table.desc_icon %}<i class="fa-solid fa-sort-down"></i>{% endblock table.desc_icon %}</span> <span class="icon" aria-hidden="true">{% block table.desc_icon %}<i class="fa-solid fa-sort-down"></i>{% endblock table.desc_icon %}</span>
{% else %} {% else %}
<span class="icon" aria-hidden="true">{% block table.asc_icon %}<i class="fa-solid fa-sort-up"></i>{% endblock table.asc_icon %}</span> <span class="icon" aria-hidden="true">{% block table.asc_icon %}<i class="fa-solid fa-sort-up"></i>{% endblock table.asc_icon %}</span>
{% endif %} {% endif %}
{% else %} {% else %}
<span class="icon" aria-hidden="true">{% block table.orderable_icon %}<i class="fa-solid fa-sort"></i>{% endblock table.orderable_icon %}</span> <span class="icon" aria-hidden="true">{% block table.orderable_icon %}<i class="fa-solid fa-sort"></i>{% endblock table.orderable_icon %}</span>
{% endif %} {% endif %}
</div> </div>
<div class="nowrap-child"> <div class="nowrap-child">
<a <a
hx-get="search/{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}&{{ uri }}" hx-get="search/{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}&{{ uri }}"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}' hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-trigger="click" hx-trigger="click"
hx-target="#results" hx-target="#results"
hx-swap="innerHTML" hx-swap="innerHTML"
hx-indicator="#spinner" hx-indicator="#spinner"
style="cursor: pointer;"> style="cursor: pointer;">
{{ column.header }} {{ column.header }}
</a> </a>
</div> </div>
{% else %} {% else %}
<div class="nowrap-child"> <div class="nowrap-child">
{{ column.header }} {{ column.header }}
</div> </div>
{% endif %} {% endif %}
</div> </div>
</th> </th>
{% endblock table.thead.th %} {% endblock table.thead.th %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</tr> </tr>
{% endblock table.thead.row %} {% endblock table.thead.row %}
</thead> </thead>
{% endif %} {% endif %}
{% endblock table.thead %} {% endblock table.thead %}
{% block table.tbody %} {% block table.tbody %}
<tbody {{ table.attrs.tbody.as_html }}> <tbody {{ table.attrs.tbody.as_html }}>
{% for row in table.paginated_rows %} {% for row in table.paginated_rows %}
{% block table.tbody.row %} {% block table.tbody.row %}
{% if row.cells.type == 'control' %} {% if row.cells.type == 'control' %}
<tr> <tr>
<td></td> <td></td>
<td> <td>
<span class="icon has-text-grey" data-tooltip="Hidden"> <span class="icon has-text-grey" data-tooltip="Hidden">
<i class="fa-solid fa-file-slash"></i> <i class="fa-solid fa-file-slash"></i>
</span> </span>
</td> </td>
<td> <td>
<p class="has-text-grey">Hidden {{ row.cells.hidden }} similar result{% if row.cells.hidden > 1%}s{% endif %}</p> <p class="has-text-grey">Hidden {{ row.cells.hidden }} similar result{% if row.cells.hidden > 1%}s{% endif %}</p>
</td> </td>
</tr> </tr>
{% else %}
<tr class="
{% if row.cells.exemption == True %}has-background-grey-lighter
{% elif cell == 'join' %}has-background-success-light
{% elif cell == 'quit' %}has-background-danger-light
{% elif cell == 'kick' %}has-background-danger-light
{% elif cell == 'part' %}has-background-warning-light
{% elif cell == 'mode' %}has-background-info-light
{% endif %}">
{% for column, cell in row.items %}
{% if column.name in show %}
{% block table.tbody.td %}
{% if cell == '—' %}
<td class="{{ column.name }}">
<span class="icon">
<i class="fa-solid fa-file-slash"></i>
</span>
</td>
{% elif column.name == 'tokens' %}
<td class="{{ column.name }} wrap" style="max-width: 10em">
{{ cell|joinsep:',' }}
</td>
{% elif column.name == 'src' %}
<td class="{{ column.name }}">
<a
class="has-text-link is-underlined"
onclick="populateSearch('src', '{{ cell|escapejs }}')">
{% if row.cells.src == 'irc' %}
<span class="icon" data-tooltip="IRC">
<i class="fa-solid fa-hashtag" aria-hidden="true"></i>
</span>
{% elif row.cells.src == 'dis' %}
<span class="icon" data-tooltip="Discord">
<i class="fa-brands fa-discord" aria-hidden="true"></i>
</span>
{% elif row.cells.src == '4ch' %}
<span class="icon" data-tooltip="4chan">
<i class="fa-solid fa-leaf" aria-hidden="true"></i>
</span>
{% endif %}
</a>
</td>
{% elif column.name == 'ts' %}
<td class="{{ column.name }}">
<p>{{ row.cells.date }}</p>
<p>{{ row.cells.time }}</p>
</td>
{% elif column.name == 'type' or column.name == 'mtype' %}
<td class="{{ column.name }}">
<a
class="has-text-link is-underlined"
onclick="populateSearch('{{ column.name }}', '{{ cell|escapejs }}')">
{% if cell == 'msg' %}
<span class="icon" data-tooltip="Message">
<i class="fa-solid fa-message"></i>
</span>
{% elif cell == 'join' %}
<span class="icon" data-tooltip="Join">
<i class="fa-solid fa-person-to-portal"></i>
</span>
{% elif cell == 'part' %}
<span class="icon" data-tooltip="Part">
<i class="fa-solid fa-person-from-portal"></i>
</span>
{% elif cell == 'quit' %}
<span class="icon" data-tooltip="Quit">
<i class="fa-solid fa-circle-xmark"></i>
</span>
{% elif cell == 'kick' %}
<span class="icon" data-tooltip="Kick">
<i class="fa-solid fa-user-slash"></i>
</span>
{% elif cell == 'nick' %}
<span class="icon" data-tooltip="Nick">
<i class="fa-solid fa-signature"></i>
</span>
{% elif cell == 'mode' %}
<span class="icon" data-tooltip="Mode">
<i class="fa-solid fa-gear"></i>
</span>
{% elif cell == 'action' %}
<span class="icon" data-tooltip="Action">
<i class="fa-solid fa-exclamation"></i>
</span>
{% elif cell == 'notice' %}
<span class="icon" data-tooltip="Notice">
<i class="fa-solid fa-message-code"></i>
</span>
{% elif cell == 'conn' %}
<span class="icon" data-tooltip="Connection">
<i class="fa-solid fa-cloud-exclamation"></i>
</span>
{% elif cell == 'znc' %}
<span class="icon" data-tooltip="ZNC">
<i class="fa-brands fa-unity"></i>
</span>
{% elif cell == 'query' %}
<span class="icon" data-tooltip="Query">
<i class="fa-solid fa-message"></i>
</span>
{% elif cell == 'highlight' %}
<span class="icon" data-tooltip="Highlight">
<i class="fa-solid fa-exclamation"></i>
</span>
{% elif cell == 'who' %}
<span class="icon" data-tooltip="Who">
<i class="fa-solid fa-passport"></i>
</span>
{% elif cell == 'topic' %}
<span class="icon" data-tooltip="Topic">
<i class="fa-solid fa-sign"></i>
</span>
{% else %}
{{ cell }}
{% endif %}
</a>
</td>
{% elif column.name == 'msg' %}
<td class="{{ column.name }} wrap">
<a
class="has-text-grey is-underlined"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{% url 'modal_context' %}"
hx-vals='{"net": "{{ row.cells.net|escapejs }}",
"num": "{{ row.cells.num|escapejs }}",
"source": "{{ row.cells.src|escapejs }}",
"channel": "{{ row.cells.channel|escapejs }}",
"time": "{{ row.cells.time|escapejs }}",
"date": "{{ row.cells.date|escapejs }}",
"index": "{{ params.index }}",
"type": "{{ row.cells.type }}",
"mtype": "{{ row.cells.mtype }}",
"nick": "{{ row.cells.nick|escapejs }}",
"dedup": "{{ params.dedup }}"}'
hx-target="#modals-here"
hx-trigger="click"
href="/?modal=context&net={{row.cells.net|escapejs}}&num={{row.cells.num|escapejs}}&source={{row.cells.src|escapejs}}&channel={{row.cells.channel|urlsafe}}&time={{row.cells.time|escapejs}}&date={{row.cells.date|escapejs}}&index={{params.index}}&type={{row.cells.type}}&mtype={{row.cells.mtype}}&nick={{row.cells.mtype|escapejs}}">
{{ row.cells.msg }}
</a>
</td>
{% elif column.name == 'nick' %}
<td class="{{ column.name }}">
<div class="nowrap-parent">
<div class="nowrap-child">
{% if row.cells.online is True %}
<span class="icon has-text-success has-tooltip-success" data-tooltip="Online">
<i class="fa-solid fa-circle"></i>
</span>
{% elif row.cells.online is False %}
<span class="icon has-text-danger has-tooltip-danger" data-tooltip="Offline">
<i class="fa-solid fa-circle"></i>
</span>
{% else %} {% else %}
<tr class=" <span class="icon has-text-warning has-tooltip-warning" data-tooltip="Unknown">
{% if row.cells.exemption == True %}has-background-grey-lighter <i class="fa-solid fa-circle"></i>
{% elif cell == 'join' %}has-background-success-light </span>
{% elif cell == 'quit' %}has-background-danger-light {% endif %}
{% elif cell == 'kick' %}has-background-danger-light </div>
{% elif cell == 'part' %}has-background-warning-light <a class="nowrap-child has-text-link is-underlined" onclick="populateSearch('nick', '{{ cell|escapejs }}')">
{% elif cell == 'mode' %}has-background-info-light {{ cell }}
{% endif %}"> </a>
{% for column, cell in row.items %} <div class="nowrap-child">
{% if column.name in show %} {% if row.cells.src == 'irc' %}
{% block table.tbody.td %} <a
{% if cell == '—' %} hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
<td class="{{ column.name }}"> hx-post="{% url 'modal_drilldown' %}"
<span class="icon"> hx-vals='{"net": "{{ row.cells.net }}", "nick": "{{ row.cells.nick }}", "channel": "{{ row.cells.channel }}"}'
<i class="fa-solid fa-file-slash"></i> hx-target="#modals-here"
</span> hx-trigger="click"
</td> class="has-text-black">
{% elif column.name == 'tokens' %} <span class="icon" data-tooltip="Open drilldown modal">
<td class="{{ column.name }} wrap" style="max-width: 10em"> <i class="fa-solid fa-album"></i>
{{ cell|joinsep:',' }} </span>
</td> </a>
{% elif column.name == 'src' %} <a
<td class="{{ column.name }}"> hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
<a hx-post="{% url 'modal_drilldown' type='window' %}"
class="has-text-link is-underlined" hx-vals='{"net": "{{ row.cells.net }}", "nick": "{{ row.cells.nick }}", "channel": "{{ row.cells.channel }}"}'
onclick="populateSearch('src', '{{ cell|escapejs }}')"> hx-target="#items-here"
{% if row.cells.src == 'irc' %} hx-swap="afterend"
<span class="icon" data-tooltip="IRC"> hx-trigger="click"
<i class="fa-solid fa-hashtag" aria-hidden="true"></i> class="has-text-black">
</span> <span class="icon" data-tooltip="Open drilldown window">
{% elif row.cells.src == 'dis' %} <i class="fa-solid fa-album"></i>
<span class="icon" data-tooltip="Discord"> </span>
<i class="fa-brands fa-discord" aria-hidden="true"></i> </a>
</span> <a
{% elif row.cells.src == '4ch' %} hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
<span class="icon" data-tooltip="4chan"> hx-post="{% url 'modal_drilldown' type='widget' %}"
<i class="fa-solid fa-leaf" aria-hidden="true"></i> hx-vals='{"net": "{{ row.cells.net }}", "nick": "{{ row.cells.nick }}", "channel": "{{ row.cells.channel }}"}'
</span> hx-target="#widgets-here"
{% endif %} hx-trigger="click"
</a> class="has-text-black">
</td> <span class="icon" data-tooltip="Open drilldown widget">
{% elif column.name == 'ts' %} <i class="fa-solid fa-album"></i>
<td class="{{ column.name }}"> </span>
<p>{{ row.cells.date }}</p> </a>
<p>{{ row.cells.time }}</p> {% endif %}
</td> </div>
{% elif column.name == 'type' or column.name == 'mtype' %} {% if row.cells.num_chans != '—' %}
<td class="{{ column.name }}"> <div class="nowrap-child">
<a <span class="tag">
class="has-text-link is-underlined" {{ row.cells.num_chans }}
onclick="populateSearch('{{ column.name }}', '{{ cell|escapejs }}')"> </span>
{% if cell == 'msg' %} </div>
<span class="icon" data-tooltip="Message"> {% endif %}
<i class="fa-solid fa-message"></i> </div>
</span> </td>
{% elif cell == 'join' %} {% elif column.name == 'channel' %}
<span class="icon" data-tooltip="Join"> <td class="{{ column.name }}">
<i class="fa-solid fa-person-to-portal"></i> {% if cell != '—' %}
</span> <div class="nowrap-parent">
{% elif cell == 'part' %} <a
<span class="icon" data-tooltip="Part"> class="nowrap-child has-text-link is-underlined"
<i class="fa-solid fa-person-from-portal"></i> onclick="populateSearch('channel', '{{ cell|escapejs }}')">
</span> {{ cell }}
{% elif cell == 'quit' %} </a>
<span class="icon" data-tooltip="Quit"> {% if row.cells.num_users != '—' %}
<i class="fa-solid fa-circle-xmark"></i> <div class="nowrap-child">
</span> <span class="tag">
{% elif cell == 'kick' %} {{ row.cells.num_users }}
<span class="icon" data-tooltip="Kick"> </span>
<i class="fa-solid fa-user-slash"></i> </div>
</span>
{% elif cell == 'nick' %}
<span class="icon" data-tooltip="Nick">
<i class="fa-solid fa-signature"></i>
</span>
{% elif cell == 'mode' %}
<span class="icon" data-tooltip="Mode">
<i class="fa-solid fa-gear"></i>
</span>
{% elif cell == 'action' %}
<span class="icon" data-tooltip="Action">
<i class="fa-solid fa-exclamation"></i>
</span>
{% elif cell == 'notice' %}
<span class="icon" data-tooltip="Notice">
<i class="fa-solid fa-message-code"></i>
</span>
{% elif cell == 'conn' %}
<span class="icon" data-tooltip="Connection">
<i class="fa-solid fa-cloud-exclamation"></i>
</span>
{% elif cell == 'znc' %}
<span class="icon" data-tooltip="ZNC">
<i class="fa-brands fa-unity"></i>
</span>
{% elif cell == 'query' %}
<span class="icon" data-tooltip="Query">
<i class="fa-solid fa-message"></i>
</span>
{% elif cell == 'highlight' %}
<span class="icon" data-tooltip="Highlight">
<i class="fa-solid fa-exclamation"></i>
</span>
{% elif cell == 'who' %}
<span class="icon" data-tooltip="Who">
<i class="fa-solid fa-passport"></i>
</span>
{% elif cell == 'topic' %}
<span class="icon" data-tooltip="Topic">
<i class="fa-solid fa-sign"></i>
</span>
{% else %}
{{ cell }}
{% endif %}
</a>
</td>
{% elif column.name == 'msg' %}
<td class="{{ column.name }} wrap">
<a
class="has-text-grey is-underlined"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{% url 'modal_context' %}"
hx-vals='{"net": "{{ row.cells.net|escapejs }}",
"num": "{{ row.cells.num|escapejs }}",
"source": "{{ row.cells.src|escapejs }}",
"channel": "{{ row.cells.channel|escapejs }}",
"time": "{{ row.cells.time|escapejs }}",
"date": "{{ row.cells.date|escapejs }}",
"index": "{{ params.index }}",
"type": "{{ row.cells.type }}",
"mtype": "{{ row.cells.mtype }}",
"nick": "{{ row.cells.nick|escapejs }}",
"dedup": "{{ params.dedup }}"}'
hx-target="#modals-here"
hx-trigger="click"
href="/?modal=context&net={{row.cells.net|escapejs}}&num={{row.cells.num|escapejs}}&source={{row.cells.src|escapejs}}&channel={{row.cells.channel|urlsafe}}&time={{row.cells.time|escapejs}}&date={{row.cells.date|escapejs}}&index={{params.index}}&type={{row.cells.type}}&mtype={{row.cells.mtype}}&nick={{row.cells.mtype|escapejs}}">
{{ row.cells.msg }}
</a>
</td>
{% elif column.name == 'nick' %}
<td class="{{ column.name }}">
<div class="nowrap-parent">
<div class="nowrap-child">
{% if row.cells.online is True %}
<span class="icon has-text-success has-tooltip-success" data-tooltip="Online">
<i class="fa-solid fa-circle"></i>
</span>
{% elif row.cells.online is False %}
<span class="icon has-text-danger has-tooltip-danger" data-tooltip="Offline">
<i class="fa-solid fa-circle"></i>
</span>
{% else %}
<span class="icon has-text-warning has-tooltip-warning" data-tooltip="Unknown">
<i class="fa-solid fa-circle"></i>
</span>
{% endif %}
</div>
<a class="nowrap-child has-text-link is-underlined" onclick="populateSearch('nick', '{{ cell|escapejs }}')">
{{ cell }}
</a>
<div class="nowrap-child">
{% if row.cells.src == 'irc' %}
<a
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{% url 'modal_drilldown' %}"
hx-vals='{"net": "{{ row.cells.net }}", "nick": "{{ row.cells.nick }}", "channel": "{{ row.cells.channel }}"}'
hx-target="#modals-here"
hx-trigger="click"
class="has-text-black">
<span class="icon" data-tooltip="Open drilldown modal">
<i class="fa-solid fa-album"></i>
</span>
</a>
<a
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{% url 'modal_drilldown' type='window' %}"
hx-vals='{"net": "{{ row.cells.net }}", "nick": "{{ row.cells.nick }}", "channel": "{{ row.cells.channel }}"}'
hx-target="#items-here"
hx-swap="afterend"
hx-trigger="click"
class="has-text-black">
<span class="icon" data-tooltip="Open drilldown window">
<i class="fa-solid fa-album"></i>
</span>
</a>
<a
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-post="{% url 'modal_drilldown' type='widget' %}"
hx-vals='{"net": "{{ row.cells.net }}", "nick": "{{ row.cells.nick }}", "channel": "{{ row.cells.channel }}"}'
hx-target="#widgets-here"
hx-trigger="click"
class="has-text-black">
<span class="icon" data-tooltip="Open drilldown widget">
<i class="fa-solid fa-album"></i>
</span>
</a>
{% endif %}
</div>
{% if row.cells.num_chans != '—' %}
<div class="nowrap-child">
<span class="tag">
{{ row.cells.num_chans }}
</span>
</div>
{% endif %}
</div>
</td>
{% elif column.name == 'channel' %}
<td class="{{ column.name }}">
{% if cell != '—' %}
<div class="nowrap-parent">
<a
class="nowrap-child has-text-link is-underlined"
onclick="populateSearch('channel', '{{ cell|escapejs }}')">
{{ cell }}
</a>
{% if row.cells.num_users != '—' %}
<div class="nowrap-child">
<span class="tag">
{{ row.cells.num_users }}
</span>
</div>
{% endif %}
</div>
{% else %}
{{ cell }}
{% endif %}
</td>
{% elif cell is True or cell is False %}
<td class="{{ column.name }}">
{% if cell is True %}
<span class="icon has-text-success">
<i class="fa-solid fa-check"></i>
</span>
{% else %}
<span class="icon">
<i class="fa-solid fa-xmark"></i>
</span>
{% endif %}
</td>
{% else %}
<td class="{{ column.name }}">
<a
class="has-text-link is-underlined"
onclick="populateSearch('{{ column.name }}', '{{ cell|escapejs }}')">
{{ cell }}
</a>
</td>
{% endif %}
{% endblock table.tbody.td %}
{% endif %}
{% endfor %}
</tr>
{% endif %} {% endif %}
{% endblock table.tbody.row %} </div>
{% empty %} {% else %}
{% if table.empty_text %} {{ cell }}
{% block table.tbody.empty_text %}
<tr><td class="{{ column.name }}" colspan="{{ table.columns|length }}">{{ table.empty_text }}</td></tr>
{% endblock table.tbody.empty_text %}
{% endif %} {% endif %}
{% endfor %} </td>
</tbody> {% elif cell is True or cell is False %}
{% endblock table.tbody %} <td class="{{ column.name }}">
{% block table.tfoot %} {% if cell is True %}
{% if table.has_footer %} <span class="icon has-text-success">
<tfoot {{ table.attrs.tfoot.as_html }}> <i class="fa-solid fa-check"></i>
{% block table.tfoot.row %} </span>
<tr> {% else %}
{% for column in table.columns %} <span class="icon">
{% block table.tfoot.td %} <i class="fa-solid fa-xmark"></i>
<td class="{{ column.name }}" {{ column.attrs.tf.as_html }}>{{ column.footer }}</td> </span>
{% endblock table.tfoot.td %} {% endif %}
{% endfor %} </td>
</tr>
{% endblock table.tfoot.row %}
</tfoot>
{% endif %}
{% endblock table.tfoot %}
</table>
</div>
{% endblock table %}
{% block pagination %}
{% if table.page and table.paginator.num_pages > 1 %}
<nav class="pagination is-justify-content-flex-end" role="navigation" aria-label="pagination">
{% block pagination.previous %}
<a
class="pagination-previous is-flex-grow-0 {% if not table.page.has_previous %}is-hidden-mobile{% endif %}"
{% if table.page.has_previous %}
hx-get="search/{% querystring table.prefixed_page_field=table.page.previous_page_number %}&{{ uri }}"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-trigger="click"
hx-target="#results"
hx-swap="innerHTML"
hx-indicator="#spinner"
{% else %}
href="#"
disabled
{% endif %}
style="order:1;">
{% block pagination.previous.text %}
<span aria-hidden="true">&laquo;</span>
{% endblock pagination.previous.text %}
</a>
{% endblock pagination.previous %}
{% block pagination.next %}
<a
class="pagination-next is-flex-grow-0 {% if not table.page.has_next %}is-hidden-mobile{% endif %}"
{% if table.page.has_next %}
hx-get="search/{% querystring table.prefixed_page_field=table.page.next_page_number %}&{{ uri }}"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-trigger="click"
hx-target="#results"
hx-swap="innerHTML"
hx-indicator="#spinner"
{% else %} {% else %}
href="#" <td class="{{ column.name }}">
disabled <a
class="has-text-link is-underlined"
onclick="populateSearch('{{ column.name }}', '{{ cell|escapejs }}')">
{{ cell }}
</a>
</td>
{% endif %} {% endif %}
style="order:3;" {% endblock table.tbody.td %}
> {% endif %}
{% block pagination.next.text %} {% endfor %}
<span aria-hidden="true">&raquo;</span> </tr>
{% endblock pagination.next.text %} {% endif %}
</a> {% endblock table.tbody.row %}
{% endblock pagination.next %} {% empty %}
{% if table.page.has_previous or table.page.has_next %} {% if table.empty_text %}
{% block pagination.range %} {% block table.tbody.empty_text %}
<ul class="pagination-list is-flex-grow-0" style="order:2;"> <tr><td class="{{ column.name }}" colspan="{{ table.columns|length }}">{{ table.empty_text }}</td></tr>
{% for p in table.page|table_page_range:table.paginator %} {% endblock table.tbody.empty_text %}
<li> {% endif %}
<a {% endfor %}
class="pagination-link {% if p == table.page.number %}is-current{% endif %}" </tbody>
aria-label="Page {{ p }}" block {% endblock table.tbody %}
{% if p == table.page.number %}aria-current="page"{% endif %} {% block table.tfoot %}
{% if p == table.page.number %} {% if table.has_footer %}
href="#" <tfoot {{ table.attrs.tfoot.as_html }}>
{% else %} {% block table.tfoot.row %}
hx-get="search/{% querystring table.prefixed_page_field=p %}&{{ uri }}" <tr>
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}' {% for column in table.columns %}
hx-trigger="click" {% block table.tfoot.td %}
hx-target="#results" <td class="{{ column.name }}" {{ column.attrs.tf.as_html }}>{{ column.footer }}</td>
hx-swap="innerHTML" {% endblock table.tfoot.td %}
hx-indicator="#spinner" {% endfor %}
{% endif %} </tr>
> {% endblock table.tfoot.row %}
{% if p == '...' %} </tfoot>
<span class="pagination-ellipsis">&hellip;</span>
{% else %}
{{ p }}
{% endif %}
</a>
</li>
{% endfor %}
</ul>
{% endblock pagination.range %}
{% endif %}
</nav>
{% endif %} {% endif %}
{% endblock pagination %} {% endblock table.tfoot %}
</div> </table>
</div>
{% endblock table %}
{% block pagination %}
{% if table.page and table.paginator.num_pages > 1 %}
<nav class="pagination is-justify-content-flex-end" role="navigation" aria-label="pagination">
{% block pagination.previous %}
<a
class="pagination-previous is-flex-grow-0 {% if not table.page.has_previous %}is-hidden-mobile{% endif %}"
{% if table.page.has_previous %}
hx-get="search/{% querystring table.prefixed_page_field=table.page.previous_page_number %}&{{ uri }}"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-trigger="click"
hx-target="#results"
hx-swap="innerHTML"
hx-indicator="#spinner"
{% else %}
href="#"
disabled
{% endif %}
style="order:1;">
{% block pagination.previous.text %}
<span aria-hidden="true">&laquo;</span>
{% endblock pagination.previous.text %}
</a>
{% endblock pagination.previous %}
{% block pagination.next %}
<a
class="pagination-next is-flex-grow-0 {% if not table.page.has_next %}is-hidden-mobile{% endif %}"
{% if table.page.has_next %}
hx-get="search/{% querystring table.prefixed_page_field=table.page.next_page_number %}&{{ uri }}"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-trigger="click"
hx-target="#results"
hx-swap="innerHTML"
hx-indicator="#spinner"
{% else %}
href="#"
disabled
{% endif %}
style="order:3;"
>
{% block pagination.next.text %}
<span aria-hidden="true">&raquo;</span>
{% endblock pagination.next.text %}
</a>
{% endblock pagination.next %}
{% if table.page.has_previous or table.page.has_next %}
{% block pagination.range %}
<ul class="pagination-list is-flex-grow-0" style="order:2;">
{% for p in table.page|table_page_range:table.paginator %}
<li>
<a
class="pagination-link {% if p == table.page.number %}is-current{% endif %}"
aria-label="Page {{ p }}" block
{% if p == table.page.number %}aria-current="page"{% endif %}
{% if p == table.page.number %}
href="#"
{% else %}
hx-get="search/{% querystring table.prefixed_page_field=p %}&{{ uri }}"
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
hx-trigger="click"
hx-target="#results"
hx-swap="innerHTML"
hx-indicator="#spinner"
{% endif %}
>
{% if p == '...' %}
<span class="pagination-ellipsis">&hellip;</span>
{% else %}
{{ p }}
{% endif %}
</a>
</li>
{% endfor %}
</ul>
{% endblock pagination.range %}
{% endif %}
</nav>
{% endif %}
{% endblock pagination %}
</div>
{% endblock table-wrapper %} {% endblock table-wrapper %}
Loading…
Cancel
Save