# Path: apps/common/urls.py
# def arg_id(name):
#     return _build_arg(name, ID)
# 
# def arg_slug(name):
#     return _build_arg(name, SLUG)


from django.conf.urls import patterns, include, url
from apps.common.urls import arg_id, arg_slug
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Fabian Barkhau <fabian.barkhau@gmail.com>                  
# License: MIT (see LICENSE.TXT file) 




p = {
    "team" : arg_slug("team_link"),
    "bike" : arg_id("bike_id"),
    "borrow" : arg_id("borrow_id"),
}


urlpatterns = patterns("apps.borrow.views",
    url(r"^borrows$",                                   "borrower_list"),
    url(r"^borrow/arrivals$",                           "arrivals"),
    url(r"^borrow/departures$",                         "departures"),
    url(r"^borrow/view/%(borrow)s$" % p,                "borrower_view"),
    url(r"^borrow/edit/%(borrow)s$" % p,                "borrower_edit"),
    url(r"^borrow/cancel/%(borrow)s$" % p,              "borrower_cancel"),
    url(r"^borrow/rate/%(borrow)s$" % p,                "borrower_rate"),
    url(r"^borrow/comment/%(borrow)s$" % p,             "comment"),

    url(r"^%(team)s/borrows$" % p,                      "lender_list"),

# Path: apps/common/urls.py
# def arg_id(name):
#     return _build_arg(name, ID)
# 
# def arg_slug(name):
#     return _build_arg(name, SLUG)


# Path: apps/borrow/urls.py
from django.conf.urls import patterns, include, url
from apps.common.urls import arg_id, arg_slug

# -*- coding: utf-8 -*-
# Copyright (c) 2012 Fabian Barkhau <fabian.barkhau@gmail.com>                  
# License: MIT (see LICENSE.TXT file) 




p = {
    "team" : arg_slug("team_link"),
    "bike" : arg_id("bike_id"),
    "borrow" : arg_id("borrow_id"),
}


urlpatterns = patterns("apps.borrow.views",
    url(r"^borrows$",                                   "borrower_list"),
    url(r"^borrow/arrivals$",                           "arrivals"),
    url(r"^borrow/departures$",                         "departures"),
    url(r"^borrow/view/%(borrow)s$" % p,                "borrower_view"),
    url(r"^borrow/edit/%(borrow)s$" % p,                "borrower_edit"),
    url(r"^borrow/cancel/%(borrow)s$" % p,              "borrower_cancel"),
    url(r"^borrow/rate/%(borrow)s$" % p,                "borrower_rate"),
    url(r"^borrow/comment/%(borrow)s$" % p,             "comment"),

    url(r"^%(team)s/borrows$" % p,                      "lender_list"),

    url(r"^%(team)s/borrow/view/%(borrow)s$" % p,       "lender_view"),