2019-03-12 09:58:29 +00:00
|
|
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
|
|
|
from django.views.generic import ListView, DetailView
|
|
|
|
|
|
|
|
from camps.mixins import CampViewMixin
|
|
|
|
|
2019-03-12 10:13:13 +00:00
|
|
|
from ..models import Team
|
2019-03-12 09:58:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
class TeamGuideView(LoginRequiredMixin, CampViewMixin, DetailView):
|
|
|
|
template_name = "team_guide.html"
|
2019-06-16 12:32:24 +00:00
|
|
|
context_object_name = "team"
|
2019-03-12 09:58:29 +00:00
|
|
|
model = Team
|
2019-06-16 12:32:24 +00:00
|
|
|
slug_url_kwarg = "team_slug"
|
|
|
|
active_menu = "guide"
|
2019-03-12 09:58:29 +00:00
|
|
|
|
|
|
|
def get_queryset(self):
|
|
|
|
qs = CampViewMixin.get_queryset(self)
|
2019-06-16 12:32:24 +00:00
|
|
|
qs.filter(teammember__approved=True, teammember__user=self.request.user)
|
2019-03-12 09:58:29 +00:00
|
|
|
return qs
|
|
|
|
|
|
|
|
|
|
|
|
class TeamGuidePrintView(TeamGuideView):
|
|
|
|
template_name = "team_guide_print.html"
|