Integrate into new teams structure.

This commit is contained in:
Víðir Valberg Guðmundsson 2018-08-05 12:18:10 +02:00
parent f5b80d9ac7
commit 214026dfd7
8 changed files with 45 additions and 45 deletions

View 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 = [
]

View file

@ -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 %}

View file

@ -37,6 +37,12 @@ Team: {{ team.name }} | {{ block.super }}
</a>
</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 %}
<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 %}">

View 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 %}

View file

@ -1,16 +1,9 @@
{% extends 'base.html' %}
{% extends 'team_base.html' %}
{% load commonmark %}
{% load bootstrap3 %}
{% 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 />
{% block team_content %}
<form method="POST">
{% csrf_token %}

View file

@ -1,16 +1,9 @@
{% extends 'base.html' %}
{% extends 'team_base.html' %}
{% load commonmark %}
{% load bootstrap3 %}
{% block 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 />
{% block team_content %}
{% if request.user in team.responsible_members.all %}
<a class="btn btn-success"

View file

@ -158,7 +158,7 @@ urlpatterns = [
path(
'',
ShiftListView.as_view(),
name="shift_list"
name="shifts"
),
path(
'create/',

View file

@ -26,7 +26,7 @@ from ..models import (
class ShiftListView(LoginRequiredMixin, CampViewMixin, ListView):
model = TeamShift
template_name = "shifts/shift_list.html"
template_name = "team_shift_list.html"
context_object_name = "shifts"
def get_queryset(self):
@ -131,7 +131,7 @@ class ShiftForm(forms.ModelForm):
class ShiftCreateView(LoginRequiredMixin, CampViewMixin, CreateView):
model = TeamShift
template_name = "shifts/shift_form.html"
template_name = "team_shift_form.html"
form_class = ShiftForm
def get_form_kwargs(self):
@ -149,7 +149,7 @@ class ShiftCreateView(LoginRequiredMixin, CampViewMixin, CreateView):
def get_success_url(self):
return reverse(
'teams:shift_list',
'teams:shifts',
kwargs=self.kwargs
)
@ -164,7 +164,7 @@ class ShiftCreateView(LoginRequiredMixin, CampViewMixin, CreateView):
class ShiftUpdateView(LoginRequiredMixin, CampViewMixin, UpdateView):
model = TeamShift
template_name = "shifts/shift_form.html"
template_name = "team_shift_form.html"
form_class = ShiftForm
def get_form_kwargs(self):
@ -175,7 +175,7 @@ class ShiftUpdateView(LoginRequiredMixin, CampViewMixin, UpdateView):
def get_success_url(self):
self.kwargs.pop('pk')
return reverse(
'teams:shift_list',
'teams:shifts',
kwargs=self.kwargs
)
@ -187,7 +187,7 @@ class ShiftUpdateView(LoginRequiredMixin, CampViewMixin, UpdateView):
class ShiftDeleteView(LoginRequiredMixin, CampViewMixin, DeleteView):
model = TeamShift
template_name = "shifts/shift_confirm_delete.html"
template_name = "team_shift_confirm_delete.html"
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
@ -200,7 +200,7 @@ class ShiftDeleteView(LoginRequiredMixin, CampViewMixin, DeleteView):
def get_success_url(self):
self.kwargs.pop('pk')
return reverse(
'teams:shift_list',
'teams:shifts',
kwargs=self.kwargs
)
@ -226,7 +226,7 @@ class MultipleShiftForm(forms.Form):
class ShiftCreateMultipleView(LoginRequiredMixin, CampViewMixin, FormView):
template_name = "shifts/shift_form.html"
template_name = "team_shift_form.html"
form_class = MultipleShiftForm
def get_form_kwargs(self):
@ -268,7 +268,7 @@ class ShiftCreateMultipleView(LoginRequiredMixin, CampViewMixin, FormView):
def get_success_url(self):
return reverse(
'teams:shift_list',
'teams:shifts',
kwargs=self.kwargs
)
@ -300,7 +300,7 @@ class MemberTakesShift(CampViewMixin, View):
return HttpResponseRedirect(
reverse(
'teams:shift_list',
'teams:shifts',
kwargs=kwargs
)
)