From e3785e11f19b5d6ae9b7d904df28a62c7224013c Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Tue, 25 Aug 2020 16:30:02 +0200 Subject: [PATCH] Cards everywhere in member app --- apps/member/templates/member/add_members.html | 109 ++++++++------- apps/member/templates/member/base.html | 74 +++++++--- apps/member/templates/member/club_alias.html | 3 + apps/member/templates/member/club_detail.html | 3 + apps/member/templates/member/club_form.html | 4 +- apps/member/templates/member/club_list.html | 2 +- .../member/templates/member/club_members.html | 73 +++++----- .../templates/member/includes/club_info.html | 132 +++++++----------- .../member/includes/profile_info.html | 103 ++++++-------- .../templates/member/manage_auth_tokens.html | 41 +++--- .../templates/member/picture_update.html | 1 - .../templates/member/profile_alias.html | 3 + .../templates/member/profile_detail.html | 11 +- .../templates/member/profile_update.html | 2 +- .../templates/note/search_transactions.html | 90 +++++++----- apps/wei/templates/wei/weiclub_detail.html | 3 - 16 files changed, 338 insertions(+), 316 deletions(-) diff --git a/apps/member/templates/member/add_members.html b/apps/member/templates/member/add_members.html index 05aad9a4..fa0a958c 100644 --- a/apps/member/templates/member/add_members.html +++ b/apps/member/templates/member/add_members.html @@ -1,68 +1,75 @@ {% extends "member/base.html" %} -{% load crispy_forms_tags %} -{% load static %} -{% load i18n %} -{% load pretty_money %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load crispy_forms_tags i18n pretty_money %} {% block profile_content %} - {% if additional_fee_renewal %} +
+

+ {{ title }} +

+
+ {% if additional_fee_renewal %}
{% if renewal %} - {% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %} - The user is not a member of the club·s {{ clubs }}. An additional fee of {{ pretty_fee }} - will be charged to renew automatically the membership in this/these club·s. - {% endblocktrans %} + {% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %} + The user is not a member of the club·s {{ clubs }}. An additional fee of {{ pretty_fee }} + will be charged to renew automatically the membership in this/these club·s. + {% endblocktrans %} {% else %} - {% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %} - This club has parents {{ clubs }}. An additional fee of {{ pretty_fee }} - will be charged to adhere automatically to this/these club·s. - {% endblocktrans %} + {% blocktrans trimmed with clubs=clubs_renewal|join:", " pretty_fee=additional_fee_renewal|pretty_money %} + This club has parents {{ clubs }}. An additional fee of {{ pretty_fee }} + will be charged to adhere automatically to this/these club·s. + {% endblocktrans %} {% endif %}
- {% endif %} + {% endif %} -
- {% csrf_token %} - {{ form|crispy }} - -
+
+ {% csrf_token %} + {{ form|crispy }} + +
+
+
{% endblock %} {% block extrajavascript %} - -{% endblock %} + soge_field.change(fillFields); + +{% endblock %} \ No newline at end of file diff --git a/apps/member/templates/member/base.html b/apps/member/templates/member/base.html index c52760c3..b474f736 100644 --- a/apps/member/templates/member/base.html +++ b/apps/member/templates/member/base.html @@ -2,6 +2,7 @@ {% comment %} SPDX-License-Identifier: GPL-3.0-or-later {% endcomment %} +{% load i18n perms %} {% block contenttitle %}{% endblock %} {# Use a fluid-width container #} @@ -11,28 +12,63 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% block profile_info %} - {% if user_object %} - {% include "member/includes/profile_info.html" %} - {% elif club %} +
+

+ {% if user_object %} + {% trans "Account #" %}{{ user_object.pk }} + {% elif club %} + Club {{ club.name }} + {% endif %} +

+
+ {% if user_object %} + + + + {% elif club %} + + + + {% endif %} +
+
+ {% if user_object %} + {% include "member/includes/profile_info.html" %} + {% elif club %} {% include "member/includes/club_info.html" %} - {% elif note.club.weiclub %} - {% with club=note.club.weiclub %} - {% include "wei/weiclub_info.html" %} - {% endwith %} - {% elif note.club %} - {% with club=note.club %} - {% include "member/includes/club_info.html" %} - {% endwith %} - {% elif note.user %} - {% with user_object=note.user %} - {% include "member/includes/profile_info.html" %} - {% endwith %} - {% endif %} - {% endblock %} + {% endif %} + {% endblock %} +
+ +
- {% block profile_content %} - {% endblock %} + {% block profile_content %}{% endblock %}
{% endblock %} diff --git a/apps/member/templates/member/club_alias.html b/apps/member/templates/member/club_alias.html index e574e41d..d80dfa0b 100644 --- a/apps/member/templates/member/club_alias.html +++ b/apps/member/templates/member/club_alias.html @@ -1,4 +1,7 @@ {% extends "member/base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} {% load static django_tables2 i18n %} {% block profile_content %} diff --git a/apps/member/templates/member/club_detail.html b/apps/member/templates/member/club_detail.html index c05b20ab..b6cd1e33 100644 --- a/apps/member/templates/member/club_detail.html +++ b/apps/member/templates/member/club_detail.html @@ -1,4 +1,7 @@ {% extends "member/base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} {% load render_table from django_tables2 %} {% load i18n perms %} diff --git a/apps/member/templates/member/club_form.html b/apps/member/templates/member/club_form.html index fc4e79e3..bd44ff16 100644 --- a/apps/member/templates/member/club_form.html +++ b/apps/member/templates/member/club_form.html @@ -1,11 +1,11 @@ -{% extends "base.html" %} +{% extends "member/base.html" %} {% comment %} SPDX-License-Identifier: GPL-3.0-or-later {% endcomment %} {% load i18n crispy_forms_tags %} {% block contenttitle %}{% endblock %} -{% block content %} +{% block profile_content %}

{{ title }} diff --git a/apps/member/templates/member/club_list.html b/apps/member/templates/member/club_list.html index f6d039e7..66863a3c 100644 --- a/apps/member/templates/member/club_list.html +++ b/apps/member/templates/member/club_list.html @@ -13,4 +13,4 @@ SPDX-License-Identifier: GPL-3.0-or-later {# Search panel #} {{ block.super }} -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/apps/member/templates/member/club_members.html b/apps/member/templates/member/club_members.html index 075e3c75..0da95242 100644 --- a/apps/member/templates/member/club_members.html +++ b/apps/member/templates/member/club_members.html @@ -3,63 +3,64 @@ {% load render_table from django_tables2 %} {% block profile_content %} - -
+
+

+ {{ title }} +

+
+
-
-
- -
+
+
-
-
{% if table.data %} - {% render_table table %} + {% render_table table %} {% else %} -
- {% trans "There is no membership found with this pattern." %} -
+
+ {% trans "There is no membership found with this pattern." %} +
{% endif %}
+
{% endblock %} {% block extrajavascript %} - -{% endblock %} + searchbar_obj.keyup(reloadTable); + only_active_obj.change(reloadTable); + roles_obj.change(reloadTable); + }); + +{% endblock %} \ No newline at end of file diff --git a/apps/member/templates/member/includes/club_info.html b/apps/member/templates/member/includes/club_info.html index bbae10ba..271083b8 100644 --- a/apps/member/templates/member/includes/club_info.html +++ b/apps/member/templates/member/includes/club_info.html @@ -1,84 +1,56 @@ {% load i18n pretty_money perms %} -
-

- Club {{ club.name }} -

-
- - - -
-
-
-
{% trans 'name'|capfirst %}
-
{{ club.name }}
+
+
{% trans 'name'|capfirst %}
+
{{ club.name }}
- {% if club.parent_club %} -
- {% trans 'Club Parent'|capfirst %} -
-
{{ club.parent_club.name }}
- {% endif %} - - {% if club.require_memberships %} - {% if club.membership_start %} -
{% trans 'membership start'|capfirst %}
-
{{ club.membership_start }}
- {% endif %} - - {% if club.membership_end %} -
{% trans 'membership end'|capfirst %}
-
{{ club.membership_end }}
- {% endif %} - - {% if club.membership_duration %} -
{% trans 'membership duration'|capfirst %}
-
{{ club.membership_duration }} {% trans "days" %}
- {% endif %} - - {% if club.membership_fee_paid == club.membership_fee_unpaid %} -
{% trans 'membership fee'|capfirst %}
-
{{ club.membership_fee_paid|pretty_money }}
- {% else %} -
{% trans 'membership fee (paid students)'|capfirst %}
-
{{ club.membership_fee_paid|pretty_money }}
- -
{% trans 'membership fee (unpaid students)'|capfirst %}
-
{{ club.membership_fee_unpaid|pretty_money }}
- {% endif %} - {% endif %} - - {% if "note.view_note"|has_perm:club.note %} -
{% trans 'balance'|capfirst %}
-
{{ club.note.balance | pretty_money }}
- {% endif %} - -
{% trans 'aliases'|capfirst %}
-
- - {% trans 'Edit my aliases' %} ({{ club.note.alias_set.all|length }}) - -
- -
{% trans 'email'|capfirst %}
-
{{ club.email }}
-
-
- {% if not club.weiclub %} - + {% if club.parent_club %} +
+ {% trans 'Club Parent'|capfirst %} +
+
{{ club.parent_club.name }}
{% endif %} -
\ No newline at end of file + + {% if club.require_memberships %} + {% if club.membership_start %} +
{% trans 'membership start'|capfirst %}
+
{{ club.membership_start }}
+ {% endif %} + + {% if club.membership_end %} +
{% trans 'membership end'|capfirst %}
+
{{ club.membership_end }}
+ {% endif %} + + {% if club.membership_duration %} +
{% trans 'membership duration'|capfirst %}
+
{{ club.membership_duration }} {% trans "days" %}
+ {% endif %} + + {% if club.membership_fee_paid == club.membership_fee_unpaid %} +
{% trans 'membership fee'|capfirst %}
+
{{ club.membership_fee_paid|pretty_money }}
+ {% else %} +
{% trans 'membership fee (paid students)'|capfirst %}
+
{{ club.membership_fee_paid|pretty_money }}
+ +
{% trans 'membership fee (unpaid students)'|capfirst %}
+
{{ club.membership_fee_unpaid|pretty_money }}
+ {% endif %} + {% endif %} + + {% if "note.view_note"|has_perm:club.note %} +
{% trans 'balance'|capfirst %}
+
{{ club.note.balance | pretty_money }}
+ {% endif %} + +
{% trans 'aliases'|capfirst %}
+
+ + {% trans 'Edit aliases' %} ({{ club.note.alias_set.all|length }}) + +
+ +
{% trans 'email'|capfirst %}
+
{{ club.email }}
+ \ No newline at end of file diff --git a/apps/member/templates/member/includes/profile_info.html b/apps/member/templates/member/includes/profile_info.html index a7aaadaa..ba12572f 100644 --- a/apps/member/templates/member/includes/profile_info.html +++ b/apps/member/templates/member/includes/profile_info.html @@ -1,70 +1,49 @@ {% load i18n pretty_money perms %} -
-

- {% trans "Account #" %}{{ user_object.pk }} -

- -
-
-
{% trans 'name'|capfirst %}, {% trans 'first name' %}
-
{{ user_object.last_name }} {{ user_object.first_name }}
+ + {% endif %} -
{% trans 'username'|capfirst %}
-
{{ user_object.username }}
- - {% if user_object.pk == user.pk %} -
{% trans 'password'|capfirst %}
-
- - {% trans 'Change password' %} - -
- {% endif %} - -
{% trans 'aliases'|capfirst %}
-
- - {% trans 'Edit my aliases' %} ({{ user_object.note.alias_set.all|length }}) - -
- -
{% trans 'section'|capfirst %}
-
{{ user_object.profile.section }}
- -
{% trans 'email'|capfirst %}
-
{{ user_object.email }}
- -
{% trans 'phone number'|capfirst %}
-
{{ user_object.profile.phone_number }}
- -
{% trans 'address'|capfirst %}
-
{{ user_object.profile.address }}
- - {% if "note.view_note"|has_perm:user_object.note %} -
{% trans 'balance'|capfirst %}
-
{{ user_object.note.balance | pretty_money }}
- -
{% trans 'paid'|capfirst %}
-
{{ user_object.profile.paid|yesno }}
- {% endif %} -
-
- -
+ + +
{% trans 'section'|capfirst %}
+
{{ user_object.profile.section }}
+ +
{% trans 'email'|capfirst %}
+
{{ user_object.email }}
+ +
{% trans 'phone number'|capfirst %}
+
{{ user_object.profile.phone_number }} +
+ +
{% trans 'address'|capfirst %}
+
{{ user_object.profile.address }}
+ + {% if "note.view_note"|has_perm:user_object.note %} +
{% trans 'balance'|capfirst %}
+
{{ user_object.note.balance | pretty_money }}
+ +
{% trans 'paid'|capfirst %}
+
{{ user_object.profile.paid|yesno }}
+ {% endif %} + {% if user_object.pk == user_object.pk %} diff --git a/apps/member/templates/member/manage_auth_tokens.html b/apps/member/templates/member/manage_auth_tokens.html index 259194ba..473286c1 100644 --- a/apps/member/templates/member/manage_auth_tokens.html +++ b/apps/member/templates/member/manage_auth_tokens.html @@ -1,8 +1,11 @@ {% extends "member/base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} {% load i18n %} {% block content %} -
+

À quoi sert un jeton d'authentification ?

Un jeton vous permet de vous connecter à
l'API de la Note Kfet.
@@ -10,24 +13,24 @@ pour pouvoir vous identifier.

Une documentation de l'API arrivera ultérieurement. -
+
-
- {%trans 'Token' %} : - {% if 'show' in request.GET %} - {{ token.key }} (cacher) - {% else %} - caché (montrer) - {% endif %} -
- {%trans 'Created' %} : {{ token.created }} -
+
+ {%trans 'Token' %} : + {% if 'show' in request.GET %} + {{ token.key }} (cacher) + {% else %} + caché (montrer) + {% endif %} +
+ {%trans 'Created' %} : {{ token.created }} +
-
- Attention : regénérer le jeton va révoquer tout accès autorisé à l'API via ce jeton ! -
+
+ Attention : regénérer le jeton va révoquer tout accès autorisé à l'API via ce jeton ! +
- - - -{% endblock %} + + + +{% endblock %} \ No newline at end of file diff --git a/apps/member/templates/member/picture_update.html b/apps/member/templates/member/picture_update.html index daec4f53..41568cfb 100644 --- a/apps/member/templates/member/picture_update.html +++ b/apps/member/templates/member/picture_update.html @@ -99,7 +99,6 @@ $("#id_width").val(cropData["width"]); $("#formUpload").submit(); }); - }); {% endblock %} \ No newline at end of file diff --git a/apps/member/templates/member/profile_alias.html b/apps/member/templates/member/profile_alias.html index e574e41d..d80dfa0b 100644 --- a/apps/member/templates/member/profile_alias.html +++ b/apps/member/templates/member/profile_alias.html @@ -1,4 +1,7 @@ {% extends "member/base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} {% load static django_tables2 i18n %} {% block profile_content %} diff --git a/apps/member/templates/member/profile_detail.html b/apps/member/templates/member/profile_detail.html index 29d46bb1..b8cae4a0 100644 --- a/apps/member/templates/member/profile_detail.html +++ b/apps/member/templates/member/profile_detail.html @@ -1,4 +1,7 @@ {% extends "member/base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} {% load render_table from django_tables2 %} {% load i18n perms %} @@ -12,7 +15,7 @@
{% endif %} -
+
-
- -
+
- {% trans "Transaction history" %} diff --git a/apps/member/templates/member/profile_update.html b/apps/member/templates/member/profile_update.html index 480da954..a50f4afd 100644 --- a/apps/member/templates/member/profile_update.html +++ b/apps/member/templates/member/profile_update.html @@ -1,8 +1,8 @@ {% extends "member/base.html" %} -{% load i18n crispy_forms_tags %} {% comment %} SPDX-License-Identifier: GPL-3.0-or-later {% endcomment %} +{% load i18n crispy_forms_tags %} {% block contenttitle %}{% endblock %} {% block profile_content %} diff --git a/apps/note/templates/note/search_transactions.html b/apps/note/templates/note/search_transactions.html index f6a3d1d0..2a952e5a 100644 --- a/apps/note/templates/note/search_transactions.html +++ b/apps/note/templates/note/search_transactions.html @@ -1,49 +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_content %} - {% crispy form %} -{% endblock %} +{# Use a fluid-width container #} +{% block containertype %}container-fluid{% endblock %} {% block content %} - {{ block.super }} -
- {% render_table table %} +
+
+
+

+ {{ title }} +

+
+ {% crispy form %} +
+
+
+
+
+ {% render_table table %} +
+
+
+
{% endblock %} {% block extrajavascript %} - + $(document).ready(function () { + $("input").change(refreshFilters); + $("input").keyup(refreshFilters); + }); + {% endblock %} \ No newline at end of file diff --git a/apps/wei/templates/wei/weiclub_detail.html b/apps/wei/templates/wei/weiclub_detail.html index 4282964c..52d918f1 100644 --- a/apps/wei/templates/wei/weiclub_detail.html +++ b/apps/wei/templates/wei/weiclub_detail.html @@ -1,8 +1,5 @@ {% extends "wei/base.html" %} -{# Use a fluid-width container #} -{% block containertype %}container-fluid{% endblock %} - {% block profile_info %} {% include "wei/weiclub_info.html" %} {% endblock %}