Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #374 from amruthasangeeth/ShiftShiftToCBV
Browse files Browse the repository at this point in the history
Migrated Shift app to CBV
  • Loading branch information
tapaswenipathak authored Aug 25, 2016
2 parents d5155db + 0921508 commit bfdb72b
Show file tree
Hide file tree
Showing 4 changed files with 412 additions and 576 deletions.
9 changes: 5 additions & 4 deletions vms/shift/models.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django.core.validators import (
MaxValueValidator,
MinValueValidator,
RegexValidator
)
MaxValueValidator,
MinValueValidator,
RegexValidator
)
from django.db import models

from job.models import Job
Expand All @@ -11,6 +11,7 @@


class Shift(models.Model):
id = models.AutoField(primary_key=True)
date = models.DateField()
start_time = models.TimeField()
end_time = models.TimeField()
Expand Down
2 changes: 1 addition & 1 deletion vms/shift/templates/shift/delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% block setting_content %}
<div class="spacer"></div>
<form class="form-horizontal" action="{% url 'shift:delete' shift_id %}" method="post">
<form class="form-horizontal" action="" method="post">
{% csrf_token %}
<div class="panel panel-danger">
<div class="panel-heading">
Expand Down
29 changes: 15 additions & 14 deletions vms/shift/urls.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
from django.conf.urls import patterns, url
from shift import views
from shift.views import *

urlpatterns = patterns('',
url(r'^add_hours/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', views.add_hours, name='add_hours'),
url(r'^add_hours_manager/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', views.add_hours_manager, name='add_hours_manager'),
url(r'^create/(?P<job_id>\d+)$', views.create, name='create'),
url(r'^add_hours/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', AddHoursView.as_view(), name='add_hours'),
url(r'^add_hours_manager/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', AddHoursManagerView.as_view(), name='add_hours_manager'),
url(r'^create/(?P<job_id>\d+)$', ShiftCreateView.as_view(), name='create'),
url(r'^cancel/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', views.cancel, name='cancel'),
url(r'^delete/(?P<shift_id>\d+)$', views.delete, name='delete'),
url(r'^clear_hours/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', views.clear_hours, name='clear_hours'),
url(r'^clear_hours_manager/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', views.clear_hours_manager, name='clear_hours_manager'),
url(r'^edit/(?P<shift_id>\d+)$', views.edit, name='edit'),
url(r'^edit_hours/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', views.edit_hours, name='edit_hours'),
url(r'^edit_hours_manager/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', views.edit_hours_manager, name='edit_hours_manager'),
url(r'^list_jobs/$', views.list_jobs, name='list_jobs'),
url(r'^list_shifts/(?P<job_id>\d+)$', views.list_shifts, name='list_shifts'),
url(r'^delete/(?P<shift_id>\d+)$', ShiftDeleteView.as_view(), name='delete'),
url(r'^clear_hours/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', ClearHoursView.as_view(), name='clear_hours'),
url(r'^clear_hours_manager/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', ClearHoursManager.as_view(), name='clear_hours_manager'),
url(r'^edit/(?P<shift_id>\d+)$', ShiftUpdateView.as_view(), name='edit'),
url(r'^edit_hours/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', EditHoursView.as_view(), name='edit_hours'),
url(r'^edit_hours_manager/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', EditHoursManagerView.as_view(), name='edit_hours_manager'),
url(r'^list_jobs/$', JobListView.as_view(), name='list_jobs'),
url(r'^list_shifts/(?P<job_id>\d+)$', ShiftListView.as_view(), name='list_shifts'),
url(r'^view_shift/(?P<shift_id>\d+)$', views.view_volunteers, name='view_volunteers'),
url(r'^list_shifts_sign_up/(?P<job_id>\d+)/(?P<volunteer_id>\d+)$', views.list_shifts_sign_up, name='list_shifts_sign_up'),
url(r'^manage_volunteer_shifts/(?P<volunteer_id>\d+)$', views.manage_volunteer_shifts, name='manage_volunteer_shifts'),
url(r'^manage_volunteer_shifts/(?P<volunteer_id>\d+)$', ManageVolunteerShiftView.as_view(), name='manage_volunteer_shifts'),
url(r'^sign_up/(?P<shift_id>\d+)/(?P<volunteer_id>\d+)$', views.sign_up, name='sign_up'),
url(r'^view_hours/(?P<volunteer_id>\d+)$', views.view_hours, name='view_hours'),
url(r'^view_hours/(?P<volunteer_id>\d+)$', ViewHoursView.as_view(), name='view_hours'),
url(r'^view_volunteer_shifts/(?P<volunteer_id>\d+)$', views.view_volunteer_shifts, name='view_volunteer_shifts'),
url(r'^volunteer_search/$', views.volunteer_search, name='volunteer_search'),
url(r'^volunteer_search/$', VolunteerSearchView.as_view(), name='volunteer_search'),
)
Loading

0 comments on commit bfdb72b

Please sign in to comment.