Implement updating network registration
This commit is contained in:
@@ -29,6 +29,19 @@
|
||||
<span>Auto</span>
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'threshold_irc_actions_registration_net' net %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#modals-here"
|
||||
class="button is-info">
|
||||
<span class="icon-text">
|
||||
<span class="icon">
|
||||
<i class="fa-solid fa-list"></i>
|
||||
</span>
|
||||
<span>Registration</span>
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-post="{% url 'threshold_irc_network_list' net %}"
|
||||
@@ -44,53 +57,25 @@
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="columns">
|
||||
<div class="column">
|
||||
<form method="POST">
|
||||
<div class="field has-addons">
|
||||
<div class="control is-expanded has-icons-left">
|
||||
<input class="input" name="num" type="text" placeholder="Relay number">
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fa-brands fa-unity"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
class="button is-info is-fullwidth"
|
||||
hx-put="{% url 'threshold_irc_network_actions_add_relay' net %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#actions"
|
||||
hx-swap="outerHTML">
|
||||
Add
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form method="POST">
|
||||
<div class="field has-addons">
|
||||
<div class="control is-expanded has-icons-left">
|
||||
<input class="input" name="num" type="text" placeholder="Relay number">
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fa-brands fa-unity"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
class="button is-info is-fullwidth"
|
||||
hx-put="{% url 'threshold_irc_network_actions_add_relay' net %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#actions"
|
||||
hx-swap="outerHTML">
|
||||
Add
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<form method="POST">
|
||||
<div class="field has-addons">
|
||||
<div class="control is-expanded has-icons-left">
|
||||
<input class="input" name="num" type="text" placeholder="Channel limit">
|
||||
<span class="icon is-small is-left">
|
||||
<i class="fa-brands fa-unity"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="control">
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
class="button is-warning is-fullwidth"
|
||||
hx-put="{% url 'threshold_irc_network_actions_add_relay' net %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#actions"
|
||||
hx-swap="outerHTML">
|
||||
Set
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,47 @@
|
||||
{% load index %}
|
||||
{% load static %}
|
||||
|
||||
<script src="{% static 'modal.js' %}"></script>
|
||||
<div id="modal" class="modal is-active is-clipped">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-content">
|
||||
<div class="box">
|
||||
<h4 class="subtitle is-4">Registration</h4>
|
||||
<form
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-put="{% url 'threshold_irc_actions_registration_net' net %}"
|
||||
hx-target="#actions"
|
||||
hx-swap="outerHTML">
|
||||
{{ unreg }}
|
||||
{% for network, items in unreg.items %}
|
||||
<h4 class="title is-4">{{ network }}</h4>
|
||||
{% for nick, num in items %}
|
||||
<div class="field">
|
||||
<label class="label">{{ nick }}/{{ num }}</label>
|
||||
<div class="control">
|
||||
<input class="input" type="text" name="{{ network }}|{{ num }}" placeholder="Enter token">
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
<button
|
||||
type="button"
|
||||
class="button is-light modal-close-button">
|
||||
Cancel
|
||||
</button>
|
||||
<button type="submit" class="button is-info modal-close-button">Submit</button>
|
||||
{# <script>activateButtons();</script> #}
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<button class="modal-close is-large" aria-label="close"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -112,4 +112,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="modals-here">
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
</button>
|
||||
<button
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-get="{% url 'threshold_irc_actions_registration' %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#modals-here"
|
||||
class="button is-info">
|
||||
<span class="icon-text">
|
||||
<span class="icon">
|
||||
|
||||
Reference in New Issue
Block a user