From aa98c4848d739dd03a95fb1cd0e6bf6faf080acf Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Fri, 21 Aug 2020 23:11:25 +0200 Subject: [PATCH 1/3] Create base template for search page --- apps/member/templates/member/user_list.html | 67 ++------------------ note_kfet/templates/base_search.html | 69 +++++++++++++++++++++ 2 files changed, 73 insertions(+), 63 deletions(-) create mode 100644 note_kfet/templates/base_search.html diff --git a/apps/member/templates/member/user_list.html b/apps/member/templates/member/user_list.html index 66aecf3a..ce0b14a7 100644 --- a/apps/member/templates/member/user_list.html +++ b/apps/member/templates/member/user_list.html @@ -1,10 +1,8 @@ -{% extends "base.html" %} +{% extends "base_search.html" %} {% comment %} SPDX-License-Identifier: GPL-3.0-or-later {% endcomment %} -{% load render_table from django_tables2 %} -{% load i18n crispy_forms_tags perms %} -{% block contenttitle %}{% endblock %} +{% load i18n perms %} {% block content %} {% if "member.change_profile_registration_valid"|has_perm:user %} @@ -13,63 +11,6 @@ SPDX-License-Identifier: GPL-3.0-or-later {% endif %} -
-

- {{ title }} -

-
- -
-
-
- {% if table.data %} - {% render_table table %} - {% else %} -
- {% trans "There is no user with this pattern." %} -
- {% endif %} -
-
-
+{# Search panel #} +{{ block.super }} {% endblock %} - -{% block extrajavascript %} - -{% endblock %} \ No newline at end of file diff --git a/note_kfet/templates/base_search.html b/note_kfet/templates/base_search.html new file mode 100644 index 00000000..1c588114 --- /dev/null +++ b/note_kfet/templates/base_search.html @@ -0,0 +1,69 @@ +{% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load render_table from django_tables2 %} +{% load i18n perms %} +{% block contenttitle %}{% endblock %} + +{% block content %} +
+

+ {{ title }} +

+
+ +
+
+ {% if table.data %} + {% render_table table %} + {% else %} +
+
+ {% trans "There is no results." %} +
+
+ {% endif %} +
+
+{% endblock %} + +{% block extrajavascript %} + +{% endblock %} From 8465b24d7d417de99f2690fcb689d8ff8a3884f5 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Fri, 21 Aug 2020 23:20:45 +0200 Subject: [PATCH 2/3] Use base search for club list --- apps/member/templates/member/club_list.html | 67 ++++----------------- 1 file changed, 12 insertions(+), 55 deletions(-) diff --git a/apps/member/templates/member/club_list.html b/apps/member/templates/member/club_list.html index 0ae4d5b8..f6d039e7 100644 --- a/apps/member/templates/member/club_list.html +++ b/apps/member/templates/member/club_list.html @@ -1,59 +1,16 @@ -{% extends "base.html" %} -{% load render_table from django_tables2 %} -{% load i18n %} +{% extends "base_search.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n perms %} {% block content %} -
-
- -
- {% if can_add_club %} - {% trans "Create club" %} - {% endif %} -
-
-
-
-
-
-
{% trans "Club listing" %}
-
-
- {% render_table table %} -
-
-
-
+{% if can_add_club %} + + {% trans "Create club" %} + +{% endif %} -{% endblock %} -{% block extrajavascript %} - +{# Search panel #} +{{ block.super }} {% endblock %} From 2272cf529495aeb511459749c3e8a30523b37c4c Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Sat, 22 Aug 2020 09:35:55 +0200 Subject: [PATCH 3/3] Update URL when searching --- note_kfet/templates/base_search.html | 37 ++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/note_kfet/templates/base_search.html b/note_kfet/templates/base_search.html index 1c588114..83c715d9 100644 --- a/note_kfet/templates/base_search.html +++ b/note_kfet/templates/base_search.html @@ -12,7 +12,8 @@ SPDX-License-Identifier: GPL-3.0-or-later {{ title }}
- +
{% if table.data %} @@ -30,8 +31,6 @@ SPDX-License-Identifier: GPL-3.0-or-later {% block extrajavascript %} -{% endblock %} +{% endblock %} \ No newline at end of file