labelbase/templates/labelbase.html
Xavier Fiechter 224d468e0d .
2023-02-05 16:03:00 +01:00

139 lines
4.5 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "_base.html" %}
{% load i18n %}
{% load labelbase_tags %}
{% block content %}
<div style="padding-top: 1em;">
{% if labelbase %}
<div class="row">
<div class="col float-start">
<h2>{% block title %}{{ labelbase.name }} {% endblock %}</h2>
{% if  labelbase.fingerprint %}<tt>{{ labelbase.fingerprint }} </tt>{% endif %}
{% if  labelbase.about %}
<p>{{  labelbase.about}} </p>
{% endif %}
</div>
<div class="col float-end" >
<div class="btn-group float-end" role="group" aria-label="Button group with nested dropdown">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addLabelModal">New Label</button>
<div class="btn-group" role="group">
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
Import
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Dropdown link</a></li>
<li><a class="dropdown-item" href="#">Dropdown link</a></li>
</ul>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
Export
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#">Dropdown link</a></li>
<li><a class="dropdown-item" href="#">Dropdown link</a></li>
</ul>
</div>
<div class="btn-group" role="group">
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
Labelbase
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#editLabelbaseModal">Edit</a></li>
<li><a class="dropdown-item" href="#">Merge duplicates</a></li>
<li><a class="dropdown-item" href="#">Delete</a></li>
</ul>
</div>
</div>
</div>
</div>
{% else %}
<p>There is no such labelbase.</p>
{% endif %}
</div>
{% if labelbase %}
<div class="table-responsive" style="padding-top:1em" >
{% if label_list %}
<table id="bip329labels" class="table table-striped table-sm">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">type</th>
<th scope="col">ref</th>
<th scope="col">label</th>
</tr>
</thead>
<tbody>
{% for label in label_list %}
<tr>
<td>{{ label.id }}</td>
<td>{{ label.get_type_display }}</td>
<td>{{ label.ref }}</td>
<td>{{ label.label }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>There are no labels in this labelbase.</p>
{% endif %}
</div>
{% endif %}
{% if labelbase %}
<!-- modal -->
<div class="modal" tabindex="-1" id="addLabelModal">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<form action=".{#% url 'addlabeltolabelbase' labelbase.id %#}" method="post">
{% csrf_token %}
<div class="modal-header">
<h5 class="modal-title">Create a new label</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{{ labelform.as_p }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">OK</button>
</div>
</form>
</div>
</div>
</div>
<!-- modal -->
<div class="modal" tabindex="-1" id="editLabelbaseModal">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<form action="{% url 'labelbase_new' %}" method="post">
{% csrf_token %}
<div class="modal-header">
<h5 class="modal-title">Edit labelbase</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{% labelbaseform_edit labelbase as form %}
{{ form.as_p }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">OK</button>
</div>
</form>
</div>
</div>
</div>
{% endif %}
<!-- end modal -->
{% endblock %}