mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-06-21 07:58:22 +02:00
Add page titles
This commit is contained in:
@ -152,6 +152,7 @@ class TeamDetailView(LoginRequiredMixin, FormMixin, ProcessFormView, DetailView)
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
team = self.get_object()
|
||||
context["title"] = _("Detail of team {trigram}").format(trigram=self.object.trigram)
|
||||
context["request_validation_form"] = RequestValidationForm(self.request.POST or None)
|
||||
context["validation_form"] = ValidateParticipationForm(self.request.POST or None)
|
||||
# A team is complete when there are at least 3 members that have sent their photo authorization
|
||||
@ -241,6 +242,7 @@ class TeamUpdateView(LoginRequiredMixin, UpdateView):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["participation_form"] = ParticipationForm(data=self.request.POST or None,
|
||||
instance=self.object.participation)
|
||||
context["title"] = _("Update team {trigram}").format(team=self.object.trigram)
|
||||
return context
|
||||
|
||||
@transaction.atomic
|
||||
@ -290,8 +292,8 @@ class TeamLeaveView(LoginRequiredMixin, TemplateView):
|
||||
"""
|
||||
A team member leaves a team
|
||||
"""
|
||||
|
||||
template_name = "participation/team_leave.html"
|
||||
extra_context = dict(title=_("Leave team"))
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
if not request.user.is_authenticated:
|
||||
@ -389,6 +391,7 @@ class CreateQuestionView(LoginRequiredMixin, CreateView):
|
||||
participation: Participation
|
||||
model = Question
|
||||
form_class = QuestionForm
|
||||
extra_context = dict(title=_("Create question"))
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
if not request.user.is_authenticated:
|
||||
@ -434,6 +437,7 @@ class DeleteQuestionView(LoginRequiredMixin, DeleteView):
|
||||
Remove a question.
|
||||
"""
|
||||
model = Question
|
||||
extra_context = dict(title=_("Delete question"))
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
self.object = self.get_object()
|
||||
@ -456,6 +460,7 @@ class UploadVideoView(LoginRequiredMixin, UpdateView):
|
||||
model = Video
|
||||
form_class = UploadVideoForm
|
||||
template_name = "participation/upload_video.html"
|
||||
extra_context = dict(title=_("Upload video"))
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
user = request.user
|
||||
@ -474,6 +479,7 @@ class CalendarView(SingleTableView):
|
||||
"""
|
||||
table_class = CalendarTable
|
||||
model = Phase
|
||||
extra_context = dict(title=_("Calendar"))
|
||||
|
||||
|
||||
class PhaseUpdateView(AdminMixin, UpdateView):
|
||||
@ -482,6 +488,7 @@ class PhaseUpdateView(AdminMixin, UpdateView):
|
||||
"""
|
||||
model = Phase
|
||||
form_class = PhaseForm
|
||||
extra_context = dict(title=_("Calendar update"))
|
||||
|
||||
def get_success_url(self):
|
||||
return reverse_lazy("participation:calendar")
|
||||
|
Reference in New Issue
Block a user