Author SHA1 Message Date
imperosol c07f25a2df move the club page edit link to the club main page 2026-10-15 16:18:16 +02:00
3 changed files with 36 additions and 53 deletions

No files matched your search

+9
View File
@@ -26,6 +26,15 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
{% if user.can_edit(club) %}
<a
href="{{ url("core:page_edit", page_name=club.page.get_full_name()) }}"
class="btn btn-blue margin-bottom"
>
<i class="fa fa-pen-to-square"></i> {% trans %}Edit{% endtrans %}
</a>
{% endif %}
<h3>{{ club.name }}</h3> <h3>{{ club.name }}</h3>
<div id="club-detail" {% if links %}class="has-links"{% endif %}> <div id="club-detail" {% if links %}class="has-links"{% endif %}>
<div id="club-attributes"> <div id="club-attributes">
+10 -32
View File
@@ -106,20 +106,19 @@ class ClubTabsMixin(TabedViewMixin):
return self.object.get_display_name() return self.object.get_display_name()
def get_list_of_tabs(self): def get_list_of_tabs(self):
if not self.request.user.has_perm("club.view_club"):
# The user will still be able to see the club main page,
# but nothing else.
# It's useless to display a tab with only one item, so return nothing.
return []
tab_list = [ tab_list = [
{ {
"url": reverse("club:club_view", kwargs={"club_id": self.object.id}), "url": reverse("club:club_view", kwargs={"club_id": self.object.id}),
"slug": "infos", "slug": "infos",
"name": _("Infos"), "name": _("Infos"),
} },
]
if self.request.user.has_perm("club.view_club"):
tab_list.extend(
[
{ {
"url": reverse( "url": reverse("club:club_members", kwargs={"club_id": self.object.id}),
"club:club_members", kwargs={"club_id": self.object.id}
),
"slug": "members", "slug": "members",
"name": _("Members"), "name": _("Members"),
}, },
@@ -130,18 +129,12 @@ class ClubTabsMixin(TabedViewMixin):
"slug": "elderlies", "slug": "elderlies",
"name": _("Old members"), "name": _("Old members"),
}, },
]
)
if self.object.page:
tab_list.append(
{ {
"url": reverse( "url": reverse("club:club_hist", kwargs={"club_id": self.object.id}),
"club:club_hist", kwargs={"club_id": self.object.id}
),
"slug": "history", "slug": "history",
"name": _("History"), "name": _("History"),
} },
) ]
if self.request.user.can_edit(self.object): if self.request.user.can_edit(self.object):
tab_list.extend( tab_list.extend(
[ [
@@ -159,21 +152,6 @@ class ClubTabsMixin(TabedViewMixin):
"slug": "edit", "slug": "edit",
"name": _("Edit"), "name": _("Edit"),
}, },
]
)
if self.object.page and self.request.user.can_edit(self.object.page):
tab_list.append(
{
"url": reverse(
"core:page_edit",
kwargs={"page_name": self.object.page.get_full_name()},
),
"slug": "page_edit",
"name": _("Edit club page"),
}
)
tab_list.extend(
[
{ {
"url": reverse( "url": reverse(
"club:club_sellings", kwargs={"club_id": self.object.id} "club:club_sellings", kwargs={"club_id": self.object.id}
+17 -21
View File
@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-10-09 21:44+0200\n" "POT-Creation-Date: 2026-10-15 14:50+0200\n"
"PO-Revision-Date: 2016-07-18\n" "PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Maréchal <thomas.girod@utbm.fr\n" "Last-Translator: Maréchal <thomas.girod@utbm.fr\n"
"Language-Team: AE info <ae.info@utbm.fr>\n" "Language-Team: AE info <ae.info@utbm.fr>\n"
@@ -517,6 +517,22 @@ msgstr "Url dupliquée"
msgid "This link doesn't match with the url base of its type." msgid "This link doesn't match with the url base of its type."
msgstr "Ce lien ne correspond pas à l'url de base de son type." msgstr "Ce lien ne correspond pas à l'url de base de son type."
#: club/templates/club/club_detail.jinja club/views.py
#: com/templates/com/news_admin_list.jinja com/templates/com/poster_list.jinja
#: com/templates/com/screen_list.jinja com/templates/com/weekmail.jinja
#: core/templates/core/file.jinja core/templates/core/group_list.jinja
#: core/templates/core/page/base.jinja core/templates/core/user_tools.jinja
#: core/views/user.py counter/templates/counter/cash_summary_list.jinja
#: counter/templates/counter/counter_list.jinja
#: election/templates/election/election_detail.jinja
#: forum/templates/forum/macros.jinja
#: pedagogy/templates/pedagogy/fragments/ue_detail/comments.jinja
#: pedagogy/templates/pedagogy/guide.jinja sas/templates/sas/album.jinja
#: trombi/templates/trombi/detail.jinja
#: trombi/templates/trombi/edit_profile.jinja
msgid "Edit"
msgstr "Éditer"
#: club/templates/club/club_detail.jinja com/templates/com/news_list.jinja #: club/templates/club/club_detail.jinja com/templates/com/news_list.jinja
msgid "Links" msgid "Links"
msgstr "Liens" msgstr "Liens"
@@ -1019,26 +1035,6 @@ msgstr "Historique"
msgid "Tools" msgid "Tools"
msgstr "Outils" msgstr "Outils"
#: club/views.py com/templates/com/news_admin_list.jinja
#: com/templates/com/poster_list.jinja com/templates/com/screen_list.jinja
#: com/templates/com/weekmail.jinja core/templates/core/file.jinja
#: core/templates/core/group_list.jinja core/templates/core/page/base.jinja
#: core/templates/core/user_tools.jinja core/views/user.py
#: counter/templates/counter/cash_summary_list.jinja
#: counter/templates/counter/counter_list.jinja
#: election/templates/election/election_detail.jinja
#: forum/templates/forum/macros.jinja
#: pedagogy/templates/pedagogy/fragments/ue_detail/comments.jinja
#: pedagogy/templates/pedagogy/guide.jinja sas/templates/sas/album.jinja
#: trombi/templates/trombi/detail.jinja
#: trombi/templates/trombi/edit_profile.jinja
msgid "Edit"
msgstr "Éditer"
#: club/views.py
msgid "Edit club page"
msgstr "Éditer la page de club"
#: club/views.py #: club/views.py
msgid "Sellings" msgid "Sellings"
msgstr "Vente" msgstr "Vente"