from django.conf.urls import patterns, url
from branchoffice import views

urlpatterns = patterns('',
    url(r'^$', views.index, name='branchoffice'),
    url(r'^new/', views.newBranchoffice, name='new_branchoffice'),
    url(r'^workunit/new/', views.newWorkUnit, name='new_workunit'),
    url(r'^car/new/', views.newCarToBranchoffice, name='new_car_branchoffice'),
    url(r'^list/cars/', views.listAllCars, name='list_all_car'),
    url(r"^car/(?P<car_id>\d+)/delete/$", views.deleteCar, name="delete_car"),
    url(r"^car/(?P<car_id>\d+)/edit/$", views.editCar, name="edit_car"),
    url(r"^car/(?P<car_id>\d+)/view/$", views.viewCar, name="edit_car"),
    url(r"^car/(?P<car_id>\d+)/disabled/$", views.disabledEnabledCar, name="disabled_car"),
    url(r"^car/(?P<car_id>\d+)/enabled/$", views.disabledEnabledCar, name="enabled_car"),
    url(r"^search/internal_number/$", views.searchByCar, name="bo_search_by_car"),
    url(r"^search/license_plate/$", views.searchByLicensePlate, name="bo_search_by_license_plate"),
    url(r'^upload_car', views.uploadCar, name='upload_car'),
    url(r'^load_car_to_office', views.loadCarToBranchoffice, name='load_car_to_office'),
    url(r'^upload_ladders', views.uploadLadders, name='upload_ladders'),
    url(r'^guards/enabled/', views.showGuardsEnabled, name='show_guards_enabled'),
    url(r'^guards/', views.showGuardsAll, name='show_guards_all'),
    url(r"^(?P<branchoffice_id>\d+)/cars/$", views.showCarsByBranchoffice, name="list_branchoffice_car"),
    url(r"^(?P<branchoffice_id>\d+)/car/(?P<car_id>\d+)/$",
        views.updateCarToBranchoffice, name="update_branchoffice_car"),
    url(r"^(?P<branchoffice_id>\d+)/guards/$", views.showGuardsByBranchoffice, name="list_branchoffice_guard"),
    url(r"^(?P<branchoffice_id>\d+)/guard/(?P<guard_id>\d+)/$",
        views.updateGuardToBranchoffice, name="update_branchoffice_guard"),
    url(r"^(?P<branchoffice_id>\d+)/guard/(?P<guard_id>\d+)/delete/$",
        views.deleteGuardToBranchoffice, name="delete_branchoffice_guard"),
    url(r"^guardstobranchoffice/(?P<guard_in_office_id>\d+)/detail/$",
        views.guardInBranchoffice, name="detail_guard"),
)
