Integrate into new teams structure.
This commit is contained in:
parent
f5b80d9ac7
commit
214026dfd7
14
src/teams/migrations/0045_merge_20180805_1131.py
Normal file
14
src/teams/migrations/0045_merge_20180805_1131.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Generated by Django 2.0.4 on 2018-08-05 09:31
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('teams', '0044_auto_20180702_1507'),
|
||||||
|
('teams', '0043_auto_20180804_1641'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
]
|
|
@ -1,16 +0,0 @@
|
||||||
{% extends 'base.html' %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<a class="btn btn-info"
|
|
||||||
href="{% url 'teams:shift_list' camp_slug=camp.slug team_slug=team.slug %}">
|
|
||||||
<i class="fas fa-chevron-left"></i> Cancel
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<form method="post">{% csrf_token %}
|
|
||||||
<p>Are you sure you want to delete "{{ object }}"?</p>
|
|
||||||
<input type="submit" class="btn btn-danger" value="Confirm" />
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
|
@ -37,6 +37,12 @@ Team: {{ team.name }} | {{ block.super }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li {% if view.active_menu == "shifts" %}class="active"{% endif %}>
|
||||||
|
<a href="{% url "teams:shifts" camp_slug=team.camp.slug team_slug=team.slug %}">
|
||||||
|
Shifts
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
{% if request.user in team.responsible_members.all %}
|
{% if request.user in team.responsible_members.all %}
|
||||||
<li {% if view.active_menu == "info_categories" %}class="active"{% endif %}>
|
<li {% if view.active_menu == "info_categories" %}class="active"{% endif %}>
|
||||||
<a href="{% url "teams:info_categories" camp_slug=team.camp.slug team_slug=team.slug %}">
|
<a href="{% url "teams:info_categories" camp_slug=team.camp.slug team_slug=team.slug %}">
|
||||||
|
|
10
src/teams/templates/team_shift_confirm_delete.html
Normal file
10
src/teams/templates/team_shift_confirm_delete.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{% extends 'team_base.html' %}
|
||||||
|
|
||||||
|
{% block team_content %}
|
||||||
|
|
||||||
|
<form method="post">{% csrf_token %}
|
||||||
|
<p>Are you sure you want to delete "{{ object }}"?</p>
|
||||||
|
<input type="submit" class="btn btn-danger" value="Confirm" />
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{% endblock %}
|
|
@ -1,16 +1,9 @@
|
||||||
{% extends 'base.html' %}
|
{% extends 'team_base.html' %}
|
||||||
{% load commonmark %}
|
{% load commonmark %}
|
||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
|
|
||||||
|
|
||||||
{% block content %}
|
{% block team_content %}
|
||||||
|
|
||||||
<a class="btn btn-info"
|
|
||||||
href="{% url 'teams:shift_list' camp_slug=camp.slug team_slug=team.slug %}">
|
|
||||||
<i class="fas fa-chevron-left"></i> Cancel
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
<form method="POST">
|
<form method="POST">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
|
@ -1,16 +1,9 @@
|
||||||
{% extends 'base.html' %}
|
{% extends 'team_base.html' %}
|
||||||
{% load commonmark %}
|
{% load commonmark %}
|
||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
|
|
||||||
|
|
||||||
{% block content %}
|
{% block team_content %}
|
||||||
|
|
||||||
<a class="btn btn-info"
|
|
||||||
href="{% url 'teams:detail' camp_slug=camp.slug team_slug=team.slug %}">
|
|
||||||
<i class="fas fa-chevron-left"></i> Back to team detail
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
{% if request.user in team.responsible_members.all %}
|
{% if request.user in team.responsible_members.all %}
|
||||||
<a class="btn btn-success"
|
<a class="btn btn-success"
|
|
@ -158,7 +158,7 @@ urlpatterns = [
|
||||||
path(
|
path(
|
||||||
'',
|
'',
|
||||||
ShiftListView.as_view(),
|
ShiftListView.as_view(),
|
||||||
name="shift_list"
|
name="shifts"
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
'create/',
|
'create/',
|
||||||
|
|
|
@ -26,7 +26,7 @@ from ..models import (
|
||||||
|
|
||||||
class ShiftListView(LoginRequiredMixin, CampViewMixin, ListView):
|
class ShiftListView(LoginRequiredMixin, CampViewMixin, ListView):
|
||||||
model = TeamShift
|
model = TeamShift
|
||||||
template_name = "shifts/shift_list.html"
|
template_name = "team_shift_list.html"
|
||||||
context_object_name = "shifts"
|
context_object_name = "shifts"
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
|
@ -131,7 +131,7 @@ class ShiftForm(forms.ModelForm):
|
||||||
|
|
||||||
class ShiftCreateView(LoginRequiredMixin, CampViewMixin, CreateView):
|
class ShiftCreateView(LoginRequiredMixin, CampViewMixin, CreateView):
|
||||||
model = TeamShift
|
model = TeamShift
|
||||||
template_name = "shifts/shift_form.html"
|
template_name = "team_shift_form.html"
|
||||||
form_class = ShiftForm
|
form_class = ShiftForm
|
||||||
|
|
||||||
def get_form_kwargs(self):
|
def get_form_kwargs(self):
|
||||||
|
@ -149,7 +149,7 @@ class ShiftCreateView(LoginRequiredMixin, CampViewMixin, CreateView):
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
return reverse(
|
return reverse(
|
||||||
'teams:shift_list',
|
'teams:shifts',
|
||||||
kwargs=self.kwargs
|
kwargs=self.kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ class ShiftCreateView(LoginRequiredMixin, CampViewMixin, CreateView):
|
||||||
|
|
||||||
class ShiftUpdateView(LoginRequiredMixin, CampViewMixin, UpdateView):
|
class ShiftUpdateView(LoginRequiredMixin, CampViewMixin, UpdateView):
|
||||||
model = TeamShift
|
model = TeamShift
|
||||||
template_name = "shifts/shift_form.html"
|
template_name = "team_shift_form.html"
|
||||||
form_class = ShiftForm
|
form_class = ShiftForm
|
||||||
|
|
||||||
def get_form_kwargs(self):
|
def get_form_kwargs(self):
|
||||||
|
@ -175,7 +175,7 @@ class ShiftUpdateView(LoginRequiredMixin, CampViewMixin, UpdateView):
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
self.kwargs.pop('pk')
|
self.kwargs.pop('pk')
|
||||||
return reverse(
|
return reverse(
|
||||||
'teams:shift_list',
|
'teams:shifts',
|
||||||
kwargs=self.kwargs
|
kwargs=self.kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ class ShiftUpdateView(LoginRequiredMixin, CampViewMixin, UpdateView):
|
||||||
|
|
||||||
class ShiftDeleteView(LoginRequiredMixin, CampViewMixin, DeleteView):
|
class ShiftDeleteView(LoginRequiredMixin, CampViewMixin, DeleteView):
|
||||||
model = TeamShift
|
model = TeamShift
|
||||||
template_name = "shifts/shift_confirm_delete.html"
|
template_name = "team_shift_confirm_delete.html"
|
||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
context = super().get_context_data(**kwargs)
|
context = super().get_context_data(**kwargs)
|
||||||
|
@ -200,7 +200,7 @@ class ShiftDeleteView(LoginRequiredMixin, CampViewMixin, DeleteView):
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
self.kwargs.pop('pk')
|
self.kwargs.pop('pk')
|
||||||
return reverse(
|
return reverse(
|
||||||
'teams:shift_list',
|
'teams:shifts',
|
||||||
kwargs=self.kwargs
|
kwargs=self.kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ class MultipleShiftForm(forms.Form):
|
||||||
|
|
||||||
|
|
||||||
class ShiftCreateMultipleView(LoginRequiredMixin, CampViewMixin, FormView):
|
class ShiftCreateMultipleView(LoginRequiredMixin, CampViewMixin, FormView):
|
||||||
template_name = "shifts/shift_form.html"
|
template_name = "team_shift_form.html"
|
||||||
form_class = MultipleShiftForm
|
form_class = MultipleShiftForm
|
||||||
|
|
||||||
def get_form_kwargs(self):
|
def get_form_kwargs(self):
|
||||||
|
@ -268,7 +268,7 @@ class ShiftCreateMultipleView(LoginRequiredMixin, CampViewMixin, FormView):
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
return reverse(
|
return reverse(
|
||||||
'teams:shift_list',
|
'teams:shifts',
|
||||||
kwargs=self.kwargs
|
kwargs=self.kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ class MemberTakesShift(CampViewMixin, View):
|
||||||
|
|
||||||
return HttpResponseRedirect(
|
return HttpResponseRedirect(
|
||||||
reverse(
|
reverse(
|
||||||
'teams:shift_list',
|
'teams:shifts',
|
||||||
kwargs=kwargs
|
kwargs=kwargs
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue