Implement alias editing views and templates
This commit is contained in:
@@ -36,6 +36,16 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div hx-target="#modals-here">
|
||||
<button hx-get="{% url 'threshold_irc_aliases_edit' %}" class="button is-primary is-fullwidth">
|
||||
<span class="icon" data-tooltip="Edit">
|
||||
<i class="fa-solid fa-pencil" aria-hidden="true"></i>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div id="modals-here">
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,73 @@
|
||||
{% load index %}
|
||||
{% load static %}
|
||||
{% load joinsep %}
|
||||
|
||||
<script src="{% static 'modal.js' %}"></script>
|
||||
<div class="modal is-active is-clipped">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-content">
|
||||
<div class="box">
|
||||
<h4 class="subtitle is-4">Edit aliases</h4>
|
||||
<form
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-post="{% url 'threshold_irc_aliases_edit' %}"
|
||||
hx-target="#aliases"
|
||||
hx-swap="outerHTML">
|
||||
<div class="content" style="max-height: 30em; overflow: auto;">
|
||||
<div class="table-container">
|
||||
<table class="table is-fullwidth is-hoverable">
|
||||
<thead>
|
||||
<th>num</th>
|
||||
<th>nick</th>
|
||||
<th>realname</th>
|
||||
<th>emails</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for alias in aliases %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ alias.num }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="field">
|
||||
<input class="input" type="text" name="{{ alias.num }}|nick" value="{{ alias.nick }}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="field">
|
||||
<input class="input" type="text" name="{{ alias.num }}|realname" value="{{ alias.realname }}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="field">
|
||||
<textarea class="textarea" name="{{ alias.num }}|emails">{{ alias.emails|joinsep:'\n' }}</textarea>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
class="button is-primary modal-close-button">
|
||||
Cancel
|
||||
</button>
|
||||
<button class="button is-primary modal-close-button">Submit</button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<button class="modal-close is-large" aria-label="close"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user