|
|
@ -1,7 +1,6 @@
|
|
|
|
{% load django_tables2 %}
|
|
|
|
{% load django_tables2 %}
|
|
|
|
{% load i18n %}
|
|
|
|
{% load i18n %}
|
|
|
|
{% load django_tables2_bulma_template %}
|
|
|
|
{% load django_tables2_bulma_template %}
|
|
|
|
{% load joinsep %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% block table-wrapper %}
|
|
|
|
{% block table-wrapper %}
|
|
|
|
<div class="container">
|
|
|
|
<div class="container">
|
|
|
@ -13,6 +12,8 @@
|
|
|
|
{% block table.thead.row %}
|
|
|
|
{% block table.thead.row %}
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
{% for column in table.columns %}
|
|
|
|
{% for column in table.columns %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% if column.name not in hide %}
|
|
|
|
{% block table.thead.th %}
|
|
|
|
{% block table.thead.th %}
|
|
|
|
<th {% render_attrs column.attrs.th class="" %}>
|
|
|
|
<th {% render_attrs column.attrs.th class="" %}>
|
|
|
|
{% if column.orderable %}
|
|
|
|
{% if column.orderable %}
|
|
|
@ -41,6 +42,8 @@
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
</th>
|
|
|
|
</th>
|
|
|
|
{% endblock table.thead.th %}
|
|
|
|
{% endblock table.thead.th %}
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
{% endblock table.thead.row %}
|
|
|
|
{% endblock table.thead.row %}
|
|
|
@ -65,6 +68,7 @@
|
|
|
|
has-background-info-light
|
|
|
|
has-background-info-light
|
|
|
|
{% endif %}">
|
|
|
|
{% endif %}">
|
|
|
|
{% for column, cell in row.items %}
|
|
|
|
{% for column, cell in row.items %}
|
|
|
|
|
|
|
|
{% if column.name not in hide %}
|
|
|
|
{% block table.tbody.td %}
|
|
|
|
{% block table.tbody.td %}
|
|
|
|
{% if column.name == 'src' %}
|
|
|
|
{% if column.name == 'src' %}
|
|
|
|
<td>
|
|
|
|
<td>
|
|
|
@ -81,6 +85,11 @@
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
|
|
|
|
{% elif column.name == 'ts' %}
|
|
|
|
|
|
|
|
<td>
|
|
|
|
|
|
|
|
<p>{{ row.cells.date }}</p>
|
|
|
|
|
|
|
|
<p>{{ row.cells.time }}</p>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
{% elif column.name == 'type' %}
|
|
|
|
{% elif column.name == 'type' %}
|
|
|
|
<td>
|
|
|
|
<td>
|
|
|
|
<a class="has-text-link is-underlined"
|
|
|
|
<a class="has-text-link is-underlined"
|
|
|
@ -203,6 +212,7 @@
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endblock table.tbody.td %}
|
|
|
|
{% endblock table.tbody.td %}
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
{% endfor %}
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
{% endblock table.tbody.row %}
|
|
|
|
{% endblock table.tbody.row %}
|
|
|
@ -309,24 +319,4 @@
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endblock pagination %}
|
|
|
|
{% endblock pagination %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{# Update the tags in case the user changed the query #}
|
|
|
|
|
|
|
|
{# Check for focus and refocus #}
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
var inputTags = document.getElementsByClassName('tags-input');
|
|
|
|
|
|
|
|
var inputBox = document.querySelector("[placeholder='Add query']");
|
|
|
|
|
|
|
|
var isFocused = (document.activeElement === inputBox);
|
|
|
|
|
|
|
|
for (index = 0; index < inputTags.length; index++) {
|
|
|
|
|
|
|
|
if (index == 0) {
|
|
|
|
|
|
|
|
inputTags[0].outerHTML = '<input id="tags" class="input" type="tags" placeholder="Add query" value="{{ tags|joinsep:',' }}">';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
inputTags[index].remove();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// inputTags[0].outerHTML = '<input id="tags" class="input" type="tags" placeholder="Add query" value="{{ tags|joinsep:',' }}">';
|
|
|
|
|
|
|
|
setupTags();
|
|
|
|
|
|
|
|
var inputBox = document.querySelector("[placeholder='Add query']");
|
|
|
|
|
|
|
|
if (isFocused) {
|
|
|
|
|
|
|
|
inputBox.focus();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
{% endblock table-wrapper %}
|
|
|
|
{% endblock table-wrapper %}
|