2020-09-22 18:41:42 +00:00
|
|
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
|
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
from django.views.generic import CreateView, FormView
|
2020-09-21 13:41:55 +00:00
|
|
|
|
2020-09-22 18:41:42 +00:00
|
|
|
from participation.forms import TeamForm, JoinTeamForm
|
|
|
|
from participation.models import Team
|
|
|
|
|
|
|
|
|
|
|
|
class CreateTeamView(LoginRequiredMixin, CreateView):
|
|
|
|
model = Team
|
|
|
|
form_class = TeamForm
|
|
|
|
extra_context = dict(title=_("Create team"))
|
|
|
|
template_name = "participation/create_team.html"
|
|
|
|
|
|
|
|
|
|
|
|
class JoinTeamView(LoginRequiredMixin, FormView):
|
|
|
|
model = Team
|
|
|
|
form_class = JoinTeamForm
|
|
|
|
extra_context = dict(title=_("Join team"))
|
|
|
|
template_name = "participation/create_team.html"
|