1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

Merge branch 'morefront' into 'beta'

Do not list alias on profile page

See merge request bde/nk20!99
This commit is contained in:
erdnaxe
2020-08-25 16:44:55 +02:00
26 changed files with 548 additions and 526 deletions

View File

@ -1,65 +1,67 @@
{% extends "member/base.html" %}
{% extends "base.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load render_table from django_tables2 %}
{% load crispy_forms_tags %}
{% block contenttitle %}{% endblock %}
{% block profile_info %}
{% if note.club.weiclub %}
{% with club=note.club.weiclub %}
{% include "wei/weiclub_info.html" %}
{% endwith %}
{% elif note.club %}
{% with club=note.club %}
{% include "member/club_info.html" %}
{% endwith %}
{% elif note.user %}
{% with user_object=note.user %}
{% include "member/profile_info.html" %}
{% endwith %}
{% endif %}
{% endblock %}
{% block profile_content %}
{% crispy form %}
{% endblock %}
{# Use a fluid-width container #}
{% block containertype %}container-fluid{% endblock %}
{% block content %}
{{ block.super }}
<div id="table">
{% render_table table %}
<div class="row mt-4">
<div class="col-xl-4">
<div class="card bg-light mb-3">
<h3 class="card-header text-center">
{{ title }}
</h3>
<div class="card-body">
{% crispy form %}
</div>
</div>
</div>
<div class="col-xl-8">
<div class="card bg-light">
<div id="table">
{% render_table table %}
</div>
</div>
</div>
</div>
{% endblock %}
{% block extrajavascript %}
<script>
function refreshHistory() {
$("#history_list").load("{% url 'note:transactions' pk=object.pk %} #history_list");
$("#profile_infos").load("{% url 'note:transactions' pk=object.pk %} #profile_infos");
}
<script>
function refreshHistory() {
$("#history_list").load("{% url 'note:transactions' pk=object.pk %} #history_list");
$("#profile_infos").load("{% url 'note:transactions' pk=object.pk %} #profile_infos");
}
function refreshFilters() {
let filters = "";
filters += "source=" + $("#id_source_pk").val();
filters += "&destination=" + $("#id_destination_pk").val();
filters += $("input[name='type']:checked").map(function() {
return "&type=" + $(this).val();
}).toArray().join("");
filters += "&reason=" + $("#id_reason").val();
filters += "&valid=" + ($("#id_valid").is(":checked") ? "1" : "");
filters += "&amount_gte=" + $("#id_amount_gte").val();
filters += "&amount_lte=" + $("#id_amount_lte").val();
filters += "&created_after=" + $("#id_created_after").val();
filters += "&created_before=" + $("#id_created_before").val();
console.log(filters.replace(" ", "%20"));
$("#table").load(location.pathname + "?" + filters.replaceAll(" ", "%20") + " #table");
}
function refreshFilters() {
let filters = "";
filters += "source=" + $("#id_source_pk").val();
filters += "&destination=" + $("#id_destination_pk").val();
filters += $("input[name='type']:checked").map(function () {
return "&type=" + $(this).val();
}).toArray().join("");
filters += "&reason=" + $("#id_reason").val();
filters += "&valid=" + ($("#id_valid").is(":checked") ? "1" : "");
filters += "&amount_gte=" + $("#id_amount_gte").val();
filters += "&amount_lte=" + $("#id_amount_lte").val();
filters += "&created_after=" + $("#id_created_after").val();
filters += "&created_before=" + $("#id_created_before").val();
console.log(filters.replace(" ", "%20"));
$("#table").load(location.pathname + "?" + filters.replaceAll(" ", "%20") + " #table");
}
function autocompleted() {
refreshFilters();
}
function autocompleted() {
refreshFilters();
}
$(document).ready(function() {
$("input").change(refreshFilters);
$("input").keyup(refreshFilters);
});
</script>
$(document).ready(function () {
$("input").change(refreshFilters);
$("input").keyup(refreshFilters);
});
</script>
{% endblock %}