mirror of
https://github.com/ae-utbm/sith.git
synced 2025-11-03 10:33:06 +00:00
posters: fix broken moderation view
This commit is contained in:
@@ -762,7 +762,19 @@ class PosterListView(ClubTabsMixin, PosterListBaseView):
|
||||
"""List communication posters."""
|
||||
|
||||
current_tab = "posters"
|
||||
extra_context = {"app": "club"}
|
||||
extra_context = {
|
||||
"links": {
|
||||
"title": _("Posters"),
|
||||
"position": "right",
|
||||
},
|
||||
"action": {
|
||||
"class": "edit",
|
||||
"label": _("Edit"),
|
||||
"get_url": lambda club, poster: reverse(
|
||||
"club:poster_edit", kwargs={"club_id": club.id, "poster_id": poster.id}
|
||||
),
|
||||
},
|
||||
}
|
||||
|
||||
def get_queryset(self):
|
||||
return super().get_queryset().filter(club=self.club.id)
|
||||
@@ -770,6 +782,19 @@ class PosterListView(ClubTabsMixin, PosterListBaseView):
|
||||
def get_object(self):
|
||||
return self.club
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
kwargs = super().get_context_data(**kwargs)
|
||||
kwargs["links"]["links"] = [
|
||||
{
|
||||
"pk": "create",
|
||||
"label": _("Create"),
|
||||
"url": reverse_lazy(
|
||||
"club:poster_create", kwargs={"club_id": self.club.id}
|
||||
),
|
||||
}
|
||||
]
|
||||
return kwargs
|
||||
|
||||
|
||||
class PosterCreateView(ClubTabsMixin, PosterCreateBaseView):
|
||||
"""Create communication poster."""
|
||||
|
||||
Reference in New Issue
Block a user