From 2e659c63cdcdc72a3e363d74dbcaa95680370d41 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Tue, 25 Aug 2020 15:39:57 +0200 Subject: [PATCH] Member templates inherit from member/base.html --- apps/member/templates/member/add_members.html | 4 - apps/member/templates/member/base.html | 23 ++- apps/member/templates/member/club_alias.html | 2 +- apps/member/templates/member/club_detail.html | 46 ++++- .../member/templates/member/club_members.html | 4 - .../templates/member/club_picture_update.html | 5 - apps/member/templates/member/club_tables.html | 42 ----- .../member/{ => includes}/club_info.html | 0 .../member/{ => includes}/profile_info.html | 0 .../templates/member/manage_auth_tokens.html | 4 +- .../templates/member/picture_update.html | 164 ++++++++++-------- .../templates/member/profile_alias.html | 2 +- .../templates/member/profile_detail.html | 36 ++++ .../member/profile_picture_update.html | 5 - .../templates/member/profile_tables.html | 32 ---- .../templates/member/profile_update.html | 4 +- apps/member/views.py | 4 +- .../templates/note/search_transactions.html | 16 -- note_kfet/inputs.py | 2 +- .../templates}/autocomplete_model.html | 0 20 files changed, 192 insertions(+), 203 deletions(-) delete mode 100644 apps/member/templates/member/club_picture_update.html delete mode 100644 apps/member/templates/member/club_tables.html rename apps/member/templates/member/{ => includes}/club_info.html (100%) rename apps/member/templates/member/{ => includes}/profile_info.html (100%) delete mode 100644 apps/member/templates/member/profile_picture_update.html delete mode 100644 apps/member/templates/member/profile_tables.html rename {apps/member/templates/member => note_kfet/templates}/autocomplete_model.html (100%) diff --git a/apps/member/templates/member/add_members.html b/apps/member/templates/member/add_members.html index 909e72b3..05aad9a4 100644 --- a/apps/member/templates/member/add_members.html +++ b/apps/member/templates/member/add_members.html @@ -4,10 +4,6 @@ {% load i18n %} {% load pretty_money %} -{% block profile_info %} -{% include "member/club_info.html" %} -{% endblock %} - {% block profile_content %} {% if additional_fee_renewal %}
diff --git a/apps/member/templates/member/base.html b/apps/member/templates/member/base.html index b61d869c..c52760c3 100644 --- a/apps/member/templates/member/base.html +++ b/apps/member/templates/member/base.html @@ -11,24 +11,39 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% block profile_info %} - {% include "member/profile_info.html" %} + {% 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 %}
{% block profile_content %} - {% include "member/profile_tables.html" %} {% endblock %}
{% endblock %} {% block extrajavascript %} +{% if object %} +{% endif %} {% endblock %} \ No newline at end of file diff --git a/apps/member/templates/member/club_alias.html b/apps/member/templates/member/club_alias.html index 60e2bef0..e574e41d 100644 --- a/apps/member/templates/member/club_alias.html +++ b/apps/member/templates/member/club_alias.html @@ -1,4 +1,4 @@ -{% extends "member/club_detail.html" %} +{% extends "member/base.html" %} {% 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 c3afee7b..c05b20ab 100644 --- a/apps/member/templates/member/club_detail.html +++ b/apps/member/templates/member/club_detail.html @@ -1,11 +1,47 @@ {% extends "member/base.html" %} - -{% block profile_info %} -{% include "member/club_info.html" %} -{% endblock %} +{% load render_table from django_tables2 %} +{% load i18n perms %} {% block profile_content %} -{% include "member/club_tables.html" %} +{% if managers.data %} +
+ + {% render_table managers %} +
+ +
+{% endif %} + +{% if member_list.data %} +
+ + {% render_table member_list %} +
+ +
+{% endif %} + +{% if history_list.data %} +
+ +
+ {% render_table history_list %} +
+
+{% endif %} {% endblock %} {% block extrajavascript %} diff --git a/apps/member/templates/member/club_members.html b/apps/member/templates/member/club_members.html index 9faff271..075e3c75 100644 --- a/apps/member/templates/member/club_members.html +++ b/apps/member/templates/member/club_members.html @@ -2,10 +2,6 @@ {% load i18n %} {% load render_table from django_tables2 %} -{% block profile_info %} - {% include "member/club_info.html" %} -{% endblock %} - {% block profile_content %}
diff --git a/apps/member/templates/member/club_picture_update.html b/apps/member/templates/member/club_picture_update.html deleted file mode 100644 index 358fdd6e..00000000 --- a/apps/member/templates/member/club_picture_update.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "member/club_detail.html" %} - -{% block profile_content%} -{% include "member/picture_update.html" %} -{% endblock%} diff --git a/apps/member/templates/member/club_tables.html b/apps/member/templates/member/club_tables.html deleted file mode 100644 index 063c00c5..00000000 --- a/apps/member/templates/member/club_tables.html +++ /dev/null @@ -1,42 +0,0 @@ -{% load render_table from django_tables2 %} -{% load i18n %} -{% load perms %} - -{% if managers.data %} -
- - {% render_table managers %} -
- -
-{% endif %} - -{% if member_list.data %} -
- - {% render_table member_list %} -
- -
-{% endif %} - -{% if history_list.data %} -
- -
- {% render_table history_list %} -
-
-{% endif %} diff --git a/apps/member/templates/member/club_info.html b/apps/member/templates/member/includes/club_info.html similarity index 100% rename from apps/member/templates/member/club_info.html rename to apps/member/templates/member/includes/club_info.html diff --git a/apps/member/templates/member/profile_info.html b/apps/member/templates/member/includes/profile_info.html similarity index 100% rename from apps/member/templates/member/profile_info.html rename to apps/member/templates/member/includes/profile_info.html diff --git a/apps/member/templates/member/manage_auth_tokens.html b/apps/member/templates/member/manage_auth_tokens.html index 0103fbbb..259194ba 100644 --- a/apps/member/templates/member/manage_auth_tokens.html +++ b/apps/member/templates/member/manage_auth_tokens.html @@ -1,5 +1,5 @@ -{% extends "base.html" %} -{% load i18n static pretty_money django_tables2 %} +{% extends "member/base.html" %} +{% load i18n %} {% block content %}
diff --git a/apps/member/templates/member/picture_update.html b/apps/member/templates/member/picture_update.html index f0c43e47..daec4f53 100644 --- a/apps/member/templates/member/picture_update.html +++ b/apps/member/templates/member/picture_update.html @@ -1,95 +1,105 @@ +{% extends "member/base.html" %} {% load i18n crispy_forms_tags %} + {% block profile_content %} -
-
- {% csrf_token %} - {{ form |crispy }} -
-
- -