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

add table, add some translation

This commit is contained in:
quark
2025-03-13 21:01:50 +01:00
parent bd9773a8af
commit bd7e6b8ad4
4 changed files with 83 additions and 51 deletions

View File

@ -1,6 +1,6 @@
{% extends "wrapped/1/wrapped_base.html" %}
{% comment %}
COPYRIGHT (C) 2018-2024 BDE ENS Paris-Saclay
COPYRIGHT (C) 2018-2025 BDE ENS Paris-Saclay
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load i18n pretty_money %}
@ -23,9 +23,9 @@ SPDX-License-Identifier: GPL-3.0-or-later
let d1 = document.getElementById("consumer");
let d2 = document.getElementById("creditor");
if (con) { d1.textContent = {{ big_consumer | safe }}[0] + " " + gettext("with") + " " + {{ big_consumer | safe}}[1] + "€";}
else { d1.textContent = gettext("Infortunately, you doesn't have consumer this year");};
else { d1.textContent = gettext({% trans "Infortunately, you doesn't have consumer this year" %});};
if (cre) { d2.textContent = {{ big_creancier | safe}}[0] + " " + gettext("with") + " " + {{ big_creancier | safe}}[1] + "€";}
else { d2.textContent = gettext("Congratulations you are a real rat !"); };
else { d2.textContent = gettext({% trans "Congratulations you are a real rat !" %}); };
</script>
{% endblock %}

View File

@ -6,17 +6,24 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% load i18n %}
{% block content %}
<div class="row justify-content-center">
<div class="col-md-10">
<div class="card card-border shadow">
<div class="card-header text-center">
<h5> {{ title }}</h5>
</div>
<div class="card-body px-0 py-0" id="wrapped_table">
{% render_table table %}
</div>
</div>
</div>
<div id="wrapped_tables">
{% if tables|length > 0 %}
<div class="card bg-light mb-3">
<h3 class="card-header text-center">
{% trans "My wrapped" %}
</h3>
{% render_table tables.1 %}
</div>
{% endif %}
{% if tables|length > 0 %}
<div class="card bg-light mb-3">
<h3 class="card-header text-center">
{% trans "Public wrapped" %}
</h3>
{% render_table tables.0 %}
</div>
{% endif %}
</div>
{% endblock %}
@ -25,7 +32,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
let club_not_public = {{ club_not_public }};
if (club_not_public) { (addMsg("{% trans "Do not forget to ask permission to people who are in your wrapped before to make them public" %}", 'warning'));}
function refreshTable() {
$("#wrapped_table").load(location.pathname + " #wrapped_table");
$("#wrapped_tables").load(location.pathname + " #wrapped_tables");
}
function copylink(id) {