Fix insights
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
style="display: none;"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-vals='{"net": "{{ item.net }}", "nick": "{{ item.nick }}"}'
|
||||
hx-post="{% url 'chans_insights' %}"
|
||||
hx-post="{% url 'chans_insights' index=index %}"
|
||||
hx-trigger="load"
|
||||
hx-target="#channels"
|
||||
hx-swap="outerHTML">
|
||||
@@ -13,7 +13,7 @@
|
||||
style="display: none;"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-vals='{"net": "{{ item.net }}", "nick": "{{ item.nick }}"}'
|
||||
hx-post="{% url 'nicks_insights' %}"
|
||||
hx-post="{% url 'nicks_insights' index=index %}"
|
||||
hx-trigger="load"
|
||||
hx-target="#nicks"
|
||||
hx-swap="outerHTML">
|
||||
@@ -81,7 +81,7 @@
|
||||
{% if item.src == 'irc' %}
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-post="{% url 'modal_insights' %}"
|
||||
hx-post="{% url 'modal_insights' index=index %}"
|
||||
hx-vals='{"net": "{{ item.net }}", "nick": "{{ item.nick }}", "channel": "{{ item.channel }}"}'
|
||||
hx-target="#modals-here"
|
||||
hx-trigger="click"
|
||||
|
||||
@@ -2,39 +2,7 @@
|
||||
{% load static %}
|
||||
{% block content %}
|
||||
{% include 'partials/notify.html' %}
|
||||
<script>
|
||||
// tabbed browsing for the modal
|
||||
function initTabs() {
|
||||
TABS.forEach((tab) => {
|
||||
tab.addEventListener('click', (e) => {
|
||||
let selected = tab.getAttribute('data-tab');
|
||||
updateActiveTab(tab);
|
||||
updateActiveContent(selected);
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function updateActiveTab(selected) {
|
||||
TABS.forEach((tab) => {
|
||||
if (tab && tab.classList.contains(ACTIVE_CLASS)) {
|
||||
tab.classList.remove(ACTIVE_CLASS);
|
||||
}
|
||||
});
|
||||
selected.classList.add(ACTIVE_CLASS);
|
||||
}
|
||||
|
||||
function updateActiveContent(selected) {
|
||||
CONTENT.forEach((item) => {
|
||||
if (item && item.classList.contains(ACTIVE_CLASS)) {
|
||||
item.classList.remove(ACTIVE_CLASS);
|
||||
}
|
||||
let data = item.getAttribute('data-content');
|
||||
if (data === selected) {
|
||||
item.classList.add(ACTIVE_CLASS);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script src="{% static 'tabs.js' %}"></script>
|
||||
<style>
|
||||
.icon { border-bottom: 0px !important;}
|
||||
</style>
|
||||
@@ -47,7 +15,7 @@
|
||||
{% csrf_token %}
|
||||
<div class="field has-addons">
|
||||
<div class="control is-expanded has-icons-left">
|
||||
<input id="query_full" name="query_full" class="input" type="text" placeholder="nickname">
|
||||
<input id="query_full" name="query" class="input" type="text" placeholder="nickname">
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fas fa-magnifying-glass"></i>
|
||||
</span>
|
||||
@@ -55,7 +23,7 @@
|
||||
<div class="control">
|
||||
<button
|
||||
class="button is-info is-fullwidth"
|
||||
hx-post="{% url 'search_insights' %}"
|
||||
hx-post="{% url 'search_insights' index=index %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#info"
|
||||
hx-swap="outerHTML">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
style="display: none;"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-vals='{"net": "{{ net }}", "nicks": "{{ nicks }}"}'
|
||||
hx-post="{% url 'meta_insights' %}"
|
||||
hx-post="{% url 'meta_insights' index=index %}"
|
||||
hx-trigger="load"
|
||||
hx-target="#meta"
|
||||
hx-swap="outerHTML">
|
||||
|
||||
Reference in New Issue
Block a user