nk20/templates/note/conso_form.html

152 lines
6.2 KiB
HTML
Raw Normal View History

2020-02-04 00:18:03 +00:00
{% extends "base.html" %}
2020-03-10 07:07:09 +00:00
{% load i18n static pretty_money django_tables2 %}
2020-02-04 00:18:03 +00:00
2020-02-21 21:40:58 +00:00
{# Remove page title #}
{% block contenttitle %}{% endblock %}
2020-02-04 00:18:03 +00:00
{% block content %}
2020-03-10 07:11:43 +00:00
<div class="row mt-4">
<div class="col-sm-5 col-md-4">
<div class="row">
{# User details column #}
<div class="col-xl-5">
<div class="card border-success shadow mb-4">
<img src="https://perso.crans.org/erdnaxe/site-crans/img/logo.svg"
alt="" class="img-fluid rounded mx-auto d-block">
<div class="card-body text-center">
Paquito (aka. PAC) : -230 €
2020-02-21 21:40:58 +00:00
</div>
</div>
2020-03-10 07:11:43 +00:00
</div>
2020-02-21 21:40:58 +00:00
2020-03-10 07:11:43 +00:00
{# User selection column #}
<div class="col-xl-7">
<div class="card border-success shadow mb-4">
<div class="card-header">
<p class="card-text font-weight-bold">
Sélection des émitteurs
</p>
</div>
<ul class="list-group list-group-flush">
<li class="list-group-item py-1 d-flex justify-content-between align-items-center">
Cras justo odio
<span class="badge badge-dark badge-pill">14</span>
</li>
<li class="list-group-item py-1 d-flex justify-content-between align-items-center">
Dapibus ac facilisis in
<span class="badge badge-dark badge-pill">1</span>
</li>
2020-02-21 21:40:58 +00:00
</ul>
2020-03-10 07:11:43 +00:00
<div class="card-body">
TODO: reimplement select2 here in JS
</div>
2020-02-21 21:40:58 +00:00
</div>
2020-03-10 07:11:43 +00:00
</div>
</div>
</div>
{# Buttons column #}
<div class="col-sm-7 col-md-8">
{# Show last used buttons #}
<div class="card shadow mb-4">
<div class="card-body text-nowrap" style="overflow:auto hidden">
<p class="card-text text-muted font-weight-light font-italic">
Les boutons les plus utilisés s'afficheront ici.
</p>
</div>
</div>
{# Regroup buttons under categories #}
{% regroup transaction_templates by template_type as template_types %}
2020-02-21 21:40:58 +00:00
2020-03-10 07:11:43 +00:00
<div class="card border-primary text-center shadow mb-4">
{# Tabs for button categories #}
<div class="card-header">
<ul class="nav nav-tabs nav-fill card-header-tabs">
{% for template_type in template_types %}
<li class="nav-item">
<a class="nav-link font-weight-bold" data-toggle="tab" href="#{{ template_type.grouper|slugify }}">
{{ template_type.grouper }}
</a>
</li>
{% endfor %}
</ul>
</div>
{# Tabs content #}
<div class="card-body">
<div class="tab-content">
{% for template_type in template_types %}
<div class="tab-pane" id="{{ template_type.grouper|slugify }}">
<div class="d-inline-flex flex-wrap justify-content-center">
{% for button in template_type.list %}
<button class="btn btn-outline-dark rounded-0 flex-fill"
name="button" value="{{ button.name }}">
{{ button.name }} ({{ button.amount | pretty_money }})
</button>
{% endfor %}
2020-02-21 21:40:58 +00:00
</div>
2020-03-10 07:11:43 +00:00
</div>
{% endfor %}
</div>
</div>
{# Mode switch #}
<div class="card-footer border-primary">
<a class="btn btn-sm btn-secondary float-left" href="{% url 'note:template_list' %}">
<i class="fa fa-edit"></i> Éditer
</a>
<div class="btn-group btn-group-toggle float-right" data-toggle="buttons">
<label class="btn btn-sm btn-outline-primary active">
<input type="radio" name="options" id="option1" checked>
Consomations simples
</label>
<label class="btn btn-sm btn-outline-primary">
<input type="radio" name="options" id="option2">
Consomations doubles
</label>
2020-02-04 00:18:03 +00:00
</div>
</div>
2020-02-21 21:40:58 +00:00
</div>
</div>
2020-03-10 07:11:43 +00:00
</div>
<div class="card shadow mb-4">
<div class="card-header">
<p class="card-text font-weight-bold">
Historique des transactions récentes
</p>
</div>
{% render_table table %}
</div>
{% endblock %}
{% block extracss %}
<style>
.select2-container{
max-width: 100%;
min-width: 100%;
}
</style>
2020-02-22 09:17:24 +00:00
{% endblock %}
2020-02-21 21:40:58 +00:00
2020-02-22 09:17:24 +00:00
{% block extrajavascript %}
2020-02-21 21:40:58 +00:00
<script type="text/javascript">
$(document).ready(function() {
// If hash of a category in the URL, then select this category
// else select the first one
if (location.hash) {
$("a[href='" + location.hash + "']").tab("show");
} else {
$("a[data-toggle='tab']").first().tab("show");
}
// When selecting a category, change URL
$(document.body).on("click", "a[data-toggle='tab']", function(event) {
location.hash = this.getAttribute("href");
});
});
</script>
2020-02-04 00:18:03 +00:00
{% endblock %}