mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 15:51:19 +00:00
Fix tab mixin on clubs
This commit is contained in:
parent
91d3e9e4dc
commit
cc99cecaa0
@ -90,8 +90,6 @@ class ClubTabsMixin(TabedViewMixin):
|
||||
def get_tabs_title(self):
|
||||
if isinstance(self.object, PageRev):
|
||||
self.object = self.object.page.club
|
||||
if isinstance(self.object, Poster):
|
||||
self.object = self.club
|
||||
return self.object.get_display_name()
|
||||
|
||||
def get_list_of_tabs(self):
|
||||
@ -603,15 +601,17 @@ class MailingAutoCleanView(View):
|
||||
return redirect('club:mailing', club_id=self.mailing.club.id)
|
||||
|
||||
|
||||
class PosterListView(PosterListBaseView, CanViewMixin, ClubTabsMixin):
|
||||
class PosterListView(PosterListBaseView, ClubTabsMixin, CanViewMixin):
|
||||
"""List communication posters"""
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
return super(PosterListView, self).dispatch(request, *args, **kwargs)
|
||||
def get_object(self):
|
||||
return self.club
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
kwargs = super(PosterListView, self).get_context_data(**kwargs)
|
||||
kwargs['app'] = "club"
|
||||
kwargs['tabs_title'] = self.get_tabs_title()
|
||||
kwargs['list_of_tabs'] = self.get_list_of_tabs()
|
||||
return kwargs
|
||||
|
||||
|
||||
|
@ -510,6 +510,7 @@ class PosterListBaseView(ListView):
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
club_id = kwargs.pop('club_id', None)
|
||||
self.club = None
|
||||
if club_id:
|
||||
self.club = get_object_or_404(Club, pk=club_id)
|
||||
return super(PosterListBaseView, self).dispatch(request, *args, **kwargs)
|
||||
|
@ -169,7 +169,6 @@
|
||||
</ul>
|
||||
|
||||
<div id="content">
|
||||
{{ object }}
|
||||
{% if list_of_tabs %}
|
||||
<div class="tool_bar">
|
||||
<div>{{ tabs_title }}</div>
|
||||
|
Loading…
Reference in New Issue
Block a user