diff options
author | Filipp Lepalaan <filipp@mac.com> | 2015-08-04 10:11:24 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2015-08-04 10:11:24 +0300 |
commit | 63b0fc6269b38edf7234b9f151b80d81f614c0a3 (patch) | |
tree | 555de3068f33f8dddb4619349bbea7d9b7c822fd /servo/urls | |
download | Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.tar.gz Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.tar.bz2 Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.zip |
Initial commit
First public commit
Diffstat (limited to 'servo/urls')
-rw-r--r-- | servo/urls/__init__.py | 0 | ||||
-rw-r--r-- | servo/urls/account.py | 45 | ||||
-rw-r--r-- | servo/urls/admin.py | 76 | ||||
-rw-r--r-- | servo/urls/api.py | 34 | ||||
-rw-r--r-- | servo/urls/checkin.py | 15 | ||||
-rw-r--r-- | servo/urls/customer.py | 29 | ||||
-rw-r--r-- | servo/urls/default.py | 73 | ||||
-rw-r--r-- | servo/urls/device.py | 52 | ||||
-rw-r--r-- | servo/urls/invoices.py | 10 | ||||
-rw-r--r-- | servo/urls/note.py | 29 | ||||
-rw-r--r-- | servo/urls/order.py | 105 | ||||
-rw-r--r-- | servo/urls/products.py | 56 | ||||
-rw-r--r-- | servo/urls/purchases.py | 25 | ||||
-rw-r--r-- | servo/urls/repairs.py | 11 | ||||
-rw-r--r-- | servo/urls/rules.py | 10 | ||||
-rw-r--r-- | servo/urls/sales.py | 10 | ||||
-rw-r--r-- | servo/urls/search.py | 27 | ||||
-rw-r--r-- | servo/urls/shipments.py | 28 | ||||
-rw-r--r-- | servo/urls/stats.py | 13 |
19 files changed, 648 insertions, 0 deletions
diff --git a/servo/urls/__init__.py b/servo/urls/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/servo/urls/__init__.py diff --git a/servo/urls/account.py b/servo/urls/account.py new file mode 100644 index 0000000..13214c7 --- /dev/null +++ b/servo/urls/account.py @@ -0,0 +1,45 @@ +from django.conf.urls import patterns, url +from django.views.generic import RedirectView + +urlpatterns = patterns( + "servo.views.account", + + url(r'^$', RedirectView.as_view(url='orders', permanent=False)), + + url(r'^search/$', "search", name="accounts-search"), + url(r'^orders/$', "orders", name="accounts-list_orders"), + url(r'^settings/$', 'settings', name="accounts-settings"), + url(r'^stats/$', 'stats', name="accounts-stats"), + url(r'^updates/$', 'updates', name="accounts-updates"), + + url(r'^calendars/$', "calendars", name="calendars-list"), + url(r'^calendars/new/$', "edit_calendar", name="calendars-create"), + url(r'^calendars/(?P<pk>\d+)/$', "view_calendar", {'view': 'week'}, + name='calendars.view'), + + url(r'^calendars/(?P<pk>\d+)/delete/$', "delete_calendar", + name='calendars-delete'), + + url(r'^calendars/(?P<pk>\d+)/(?P<view>[a-z]+)/$', "view_calendar", + name='calendars.view'), + url(r'^calendars/(?P<pk>\d+)/(?P<view>[a-z]+)/(?P<start_date>[0-9\-]+)/$', "view_calendar", + name='calendars-view_calendar'), + url(r'^calendars/(?P<pk>\d+)/(?P<view>[a-z]+)/download/$', "download_calendar", + name='calendars-download'), + url(r'^calendars/(?P<pk>\d+)/(?P<view>[a-z]+)/(?P<start_date>[0-9\-]+)/print/$', "print_calendar", + name="calendars-print"), + url(r'^calendars/(?P<pk>\d+)/(?P<view>[a-z]+)/edit/$', "edit_calendar", + name='calendars-edit'), + + url(r'^calendars/(?P<cal_pk>\d+)/events/new/$', "edit_calendar_event", + name='calendars.event.edit'), + url(r'^calendars/(?P<cal_pk>\d+)/events/(?P<pk>\d+)/edit/$', "edit_calendar_event", + name='calendars.event.edit'), + url(r'^calendars/(?P<cal_pk>\d+)/events/(?P<pk>\d+)/delete/$', "delete_calendar_event", + name='calendars.event.delete'), + url(r'^calendars/(?P<cal_pk>\d+)/events/(?P<pk>\d+)/finish/$', "finish_calendar_event", + name='calendars.event.finish'), + + url(r'^notifications/clear/$', "clear_notifications", name="accounts-clear_notifications"), + +) diff --git a/servo/urls/admin.py b/servo/urls/admin.py new file mode 100644 index 0000000..2c8b1ca --- /dev/null +++ b/servo/urls/admin.py @@ -0,0 +1,76 @@ +from django.conf.urls import patterns, url, include +from servo.views import admin + + +urlpatterns = patterns( + 'servo.views.admin', + url(r'^settings/$', 'settings', name='admin-settings'), + + url(r'^statuses/$', 'statuses', name='admin-statuses'), + url(r'^statuses/new/$', 'edit_status', name="admin-create_status"), + url(r'^statuses/(\d+)/edit/$', 'edit_status', name="admin-edit_status"), + url(r'^statuses/(\d+)/delete/$', 'remove_status', name="admin-delete_status"), + + url(r'^users/$', 'list_users', name='admin-list_users'), + url(r'^users/new/$', 'edit_user', name="admin-create_user"), + url(r'^users/upload/$', 'upload_users', name="admin-upload_users"), + url(r'^users/(\d+)/edit/$', 'edit_user', name="admin-edit_user"), + url(r'^users/(\d+)/delete/$', 'delete_user', name="admin-delete_user"), + url(r'^users/(\d+)/delete_tokens/$', 'delete_user_token', name="admin-delete_user_token"), + url(r'^users/(\d+)/create_token/$', 'create_user_token', name="admin-create_user_token"), + + url(r'^groups/$', 'list_groups', name='admin-list_groups'), + url(r'^groups/new/$', 'edit_group', name="admin-create_group"), + url(r'^groups/(\d+)/edit/$', 'edit_group', name="admin-edit_group"), + url(r'^groups/(\d+)/delete/$', 'delete_group', name="admin-delete_group"), + + url(r'^tags/$', 'tags', name='admin-tags'), + url(r'^tags/(?P<type>[a-z]+)/$', 'tags', name='admin-tags'), + url(r'^tags/(?P<type>[a-z]+)/new/$', 'edit_tag', name="admin-create_tag"), + url(r'^tags/[a-z]+/(?P<pk>\d+)/delete/$', 'delete_tag', name="admin-delete_tag"), + url(r'^tags/(?P<type>[a-z]+)/(?P<pk>\d+)/$', 'edit_tag', name="admin-edit_tag"), + + url(r'^fields/(?P<type>[a-z]+)/$', 'fields', name='admin-fields'), + url(r'^fields/(?P<type>[a-z]+)/new/$', 'edit_field', name="admin-create_field"), + url(r'^fields/[a-z]+/(\d+)/delete/$', 'delete_field', name="admin-delete_field"), + url(r'^fields/(?P<type>[a-z]+)/(?P<pk>\d+)/edit/$', 'edit_field', name="admin-edit_field"), + + url(r'^templates/$', 'list_templates', name='admin-list_templates'), + url(r'^templates/new/$', 'edit_template', name='admin-edit_template'), + url(r'^templates/(\d+)/edit/$', 'edit_template', name='admin-edit_template'), + url(r'^templates/(\d+)/delete/$', 'delete_template', name='admin-delete_template'), + + url(r'^queues/$', 'queues', name='admin-queues'), + #url(r'^queues/$', admin.QueueListView.as_view(), name='admin-queues'), + url(r'^queues/new/$', 'edit_queue', name="admin-create_queue"), + url(r'^queues/(?P<pk>\d+)/edit/$', 'edit_queue', name="admin-edit_queue"), + #url(r'^queues/(?P<pk>\d+)/edit/$', admin.QueueListView.as_view(), name='admin-edit_queue'), + url(r'^queues/(\d+)/delete/$', 'delete_queue', name="admin-delete_queue"), + + url(r'^gsx/accounts/$', 'list_gsx_accounts', name='admin-list_gsx_accounts'), + url(r'^gsx/accounts/new/$', 'edit_gsx_account', name='admin-edit_gsx_account'), + url(r'^gsx/accounts/(\d+)/$', 'edit_gsx_account', name='admin-edit_gsx_account'), + url(r'^gsx/accounts/(\d+)?/delete/$', 'delete_gsx_account', name='admin-delete_gsx_account'), + + url(r'^locations/$', 'locations', name='admin-locations'), + url(r'^locations/new/$', 'edit_location', name='admin-create_location'), + url(r'^locations/(\d+)/edit/$', 'edit_location', name='admin-edit_location'), + url(r'^locations/(\d+)/delete/$', 'delete_location', name='admin-delete_location'), + + url(r'^notifications/$', 'notifications', name='admin-notifications'), + url(r'^notifications/(\w+)/$', 'edit_notification'), + + url(r'^checklists/$', 'checklists', name='admin-checklists'), + url(r'^checklists/new/$', 'edit_checklist', name='admin-create_checklist'), + url(r'^checklists/(?P<pk>\d+)/edit/$', 'edit_checklist', name='admin-edit_checklist'), + url(r'^checklists/(?P<pk>\d+)/delete/$', 'delete_checklist', name='admin-delete_checklist'), + + url(r'^sites/$', 'list_sites', name="admin-list_sites"), + url(r'^sites/new/$', 'edit_site', name="admin-create_site"), + url(r'^sites/(\d+)/edit/$', 'edit_site', name="admin-edit_site"), + + url(r'^rules/', include('servo.urls.rules')), + + url(r'^backups/$', 'backups', name="admin-backups"), + +) diff --git a/servo/urls/api.py b/servo/urls/api.py new file mode 100644 index 0000000..462a692 --- /dev/null +++ b/servo/urls/api.py @@ -0,0 +1,34 @@ +from django.conf.urls import patterns, url, include + +from servo.views import api + + +urlpatterns = patterns( + "servo.views.api", + url(r'^status/$', api.OrderStatusView.as_view(), name='api-status'), + url(r'^tags/$', 'tags', name='api-tags'), + url(r'^users/$', 'users', name='api-users'), + url(r'^queues/$', 'queues', name='api-queues'), + url(r'^places/$', 'places', name='api-places'), + url(r'^locations/$', 'locations', name='api-locations'), + url(r'^statuses/$', 'statuses', name='api-statuses'), + + url(r'^orders/$', 'orders', name='api-order_create'), + url(r'^orders/(\d{8})/$', 'orders', name='api-order_list'), + url(r'^orders/(?P<pk>\d+)/$', 'orders', name='api-order_detail'), + + url(r'^warranty/$', 'warranty', name='api-device_warranty'), + url(r'^messages/$', 'messages', name='api-messages'), + url(r'^device_models/$', 'device_models'), + + url(r'^status/(?P<pk>\d+)/$', 'order_status', name='queuestatus-detail'), + url(r'^notes/(?P<pk>\d+)/$', 'notes', name='api-note_detail'), + url(r'^orders/products/(?P<pk>\d+)/$', 'order_items', name='api-order_items'), + + url(r'^users/(?P<pk>\d+)/$', 'user_detail', name='api-user_detail'), + + url(r'^customers/$', 'customers', name='api-customers'), + url(r'^customers/(?P<pk>\d+)/$', 'customers', name='api-customer_detail'), + + url(r'^devices/(?P<pk>\d+)/$', 'devices', name='api-device_detail'), +) diff --git a/servo/urls/checkin.py b/servo/urls/checkin.py new file mode 100644 index 0000000..a05e306 --- /dev/null +++ b/servo/urls/checkin.py @@ -0,0 +1,15 @@ +from django.conf.urls import patterns, url +from servo.views.checkin import * + + +urlpatterns = patterns( + '', + url(r'^$', index, name='checkin-index'), + url(r'^customer/$', get_customer, name='checkin-get_customer'), + url(r'^reset/$', reset, name='checkin-reset'), + url(r'^status/$', status, name='checkin-status'), + url(r'^checkin/print/(\w+)/$', print_confirmation, name='checkin-print'), + url(r'^thanks/(\w+)/$', thanks, name='checkin-thanks'), + url(r'^terms/$', terms, name='checkin-terms'), + +) diff --git a/servo/urls/customer.py b/servo/urls/customer.py new file mode 100644 index 0000000..86c8e9d --- /dev/null +++ b/servo/urls/customer.py @@ -0,0 +1,29 @@ +from django.conf.urls import patterns, url + +urlpatterns = patterns( + "servo.views.customer", + url(r'^$', 'index', {'group': 'all'}, name="customers-list_all"), + url(r'^find/$', 'find', name="customers-find"), + url(r'^search/$', 'search', name="customers-search"), + url(r'^filter/$', 'filter', name="customers-filter"), + url(r'^download/$', 'download', name="customers-download"), + url(r'^download/(?P<group>[\w\-]+)/$', 'download', name="customers-download"), + url(r'^find/download$', 'download', name="customers-download_search"), + url(r'^groups/add/$', 'edit_group', name="customers-create_group"), + url(r'^groups/(?P<group>[\w\-]+)/edit/$', 'edit_group', name="customers-edit_group"), + url(r'^groups/(?P<group>[\w\-]+)/delete/$', 'delete_group', name="customers-delete_group"), + url(r'^(?P<group>[\w\-]+)/$', 'index', name="customers-list"), + url(r'^(?P<group>[\w\-]+)/upload/$', 'upload', name="customers-upload"), + url(r'^(?P<group>[\w\-]+)/add/$', 'edit', name="customers-create_customer"), + url(r'^(?P<group>[\w\-]+)/(?P<pk>\d+)/$', 'view', name="customers-view_customer"), + url(r'^(?P<group>[\w\-]+)/(?P<pk>\d+)/edit/$', 'edit', name="customers-edit_customer"), + url(r'^(?P<group>[\w\-]+)/(?P<pk>\d+)/delete/$', 'delete', name="customers-delete_customer"), + url(r'^(?P<pk>\d+)/move/$', 'move', name="customers-move_customer"), + url(r'^(?P<pk>\d+)/move/(?P<new_parent>\d+)/$', 'move', name="customers-move_customer"), + url(r'^(?P<pk>\d+)/merge/$', 'merge', name="customers-merge_customer"), + url(r'^(?P<pk>\d+)/merge/(?P<target>\d+)/$', 'merge', name="customers-merge_customer"), + url(r'^(?P<parent_id>\d+)/new/$', 'edit', name="customers-create_contact"), + url(r'^(\d+)/orders/(\d+)/$', 'add_order', name="customers-add_to_order"), + url(r'^(?P<pk>\d+)/notes/$', 'notes', name="customers-list_notes"), + url(r'^(?P<pk>\d+)/notes/new/$', 'create_message', name="customers-create_message"), +) diff --git a/servo/urls/default.py b/servo/urls/default.py new file mode 100644 index 0000000..6de2bde --- /dev/null +++ b/servo/urls/default.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2013, First Party Software +# All rights reserved. + +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: + +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. + +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. + +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT +# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +from django.conf.urls import patterns, include, url +from django.views.generic import RedirectView, TemplateView +from servo.views import account, files, gsx + +urlpatterns = patterns( + '', + url(r'^$', RedirectView.as_view(url="orders/", permanent=False), name="home"), + + url(r'^checkin/', include('servo.urls.checkin')), + url(r'^orders/', include('servo.urls.order')), + url(r'^repairs/', include('servo.urls.repairs')), + url(r'^customers/', include('servo.urls.customer')), + url(r'^devices/', include('servo.urls.device')), + url(r'^admin/', include('servo.urls.admin')), + + url(r'^stats/', include('servo.urls.stats')), + + url(r'^notes/', include('servo.urls.note')), + url(r'^sales/', include('servo.urls.sales')), + + url(r'^queues/(\d+)/statuses/$', 'servo.views.queue.statuses'), + + url(r'^barcode/([\w\-]+)/$', 'servo.views.note.show_barcode', name='barcodes-view'), + url(r'^files/(?P<pk>\d+)/view/$', files.view_file), + url(r'^files/(?P<path>.+)/$', files.get_file), + + url(r'^login/$', account.login, name="accounts-login"), + url(r'^logout/$', account.logout, name="accounts-logout"), + #url(r'^register/$', account.register, name="accounts-register"), + + url(r'^about/$', TemplateView.as_view(template_name="about.html")), + + url(r'^repairs/(\d+)/parts/(\d+)/return_label/$', gsx.return_label, + name="parts-return_label"), + url(r'^repairs/([A-Z0-9]+)/details/$', gsx.repair_details, name="repairs-get_details"), + url(r'^returns/part/(?P<part_id>\d+)/register_return/$', gsx.register_return, + name='parts-register_return'), + + url(r'^events/(\d+)/ack/', 'servo.views.events.acknowledge', name="events-ack_event"), + url(r'^tags/(\d+)/clear/', 'servo.views.tags.clear', name="tags-clear"), + + (r'^api/', include('servo.urls.api')), + (r'^kaboom/$', 'servo.views.error.report'), + + url(r'^(?P<username>[\w@\+\-\._]+)/', include('servo.urls.account')), + +) diff --git a/servo/urls/device.py b/servo/urls/device.py new file mode 100644 index 0000000..132ffbf --- /dev/null +++ b/servo/urls/device.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- + +from django.conf.urls import patterns, url +from django.views.decorators.cache import cache_page + +from servo.views.order import create +from servo.views.device import get_gsx_search_results + +urlpatterns = patterns( + "servo.views.device", + url(r'^$', 'index', name="devices-list"), + + url(r'^search/$', 'search'), + url(r'^find/$', "find", name="devices-find"), + url(r'^add/$', "edit_device", name="devices-add"), + + url(r'^(?P<pk>\d+)/diags/$', 'diagnostics', name="devices-diagnostics"), + + url(r'^(?P<pk>\d+)/update_gsx_details/$', "update_gsx_details", name="devices-update_gsx_details"), + url(r'^(?P<pk>\d+)/orders/(?P<order_id>\d+)/queue/(?P<queue_id>\d+)/parts/$', + "parts", name="devices-parts"), + + url(r'^search/gsx/(?P<what>\w+)/(?P<param>\w+)/(?P<query>[~\w\s,\-\(\)/\.]+)/$', + "search_gsx", + name="devices-search_gsx"), + + url(r'^search/gsx/(?P<what>\w+)/(?P<param>\w+)/(?P<query>[~\w\s,\-\(\)/\.]+)/$', + cache_page(60*15)(get_gsx_search_results), + name="devices-get_gsx_search_results"), + + url(r'^choose/order/(\d+)/$', 'choose', name="devices-choose"), + url(r'^upload/$', 'upload_devices', name="devices-upload_devices"), + url(r'^(?P<device_id>\d+)/orders/create/$', create, name="devices-create_order"), + url(r'^(?P<pk>\d+)/get_info/$', 'get_info', name="devices-get_info"), + + url(r'^(?P<product_line>\w+)/$', "index", name="devices-list_devices"), + url(r'^(?P<product_line>\w+)/(?P<model>[\w\-]+)/$', "index", + name="devices-list_devices"), + url(r'^(?P<product_line>\w+)/(?P<model>[\w\-]+)/parts/$', "model_parts", + name="devices-model_parts"), + url(r'^(?P<product_line>\w+)/(?P<model>[\w\-]+)/(?P<pk>\d+)/$', "view_device", + name="devices-view_device"), + + url(r'^(?P<product_line>\w+)/(?P<model>[\w-]+)/(?P<pk>\d+)/edit/$', "edit_device", + name="devices-edit_device"), + url(r'^(?P<product_line>\w+)/(?P<model>[\w-]+)/create/$', "edit_device", + name="devices-create_device"), + url(r'^(?P<product_line>\w+)/(?P<model>[\w-]+)/(?P<pk>\d+)/delete/$', "delete_device", + name="devices-delete_device"), + + url(r'^search$', 'search', name="devices-search"), +) diff --git a/servo/urls/invoices.py b/servo/urls/invoices.py new file mode 100644 index 0000000..6003bbc --- /dev/null +++ b/servo/urls/invoices.py @@ -0,0 +1,10 @@ +from django.conf.urls import patterns, url + +urlpatterns = patterns( + "servo.views.invoices", + url(r'^$', "invoices", name="invoices-index"), + url(r'^gsx/$', 'gsx_invoices', name="invoices-gsx_invoices"), + + url(r'^(?P<pk>\d+)/$', 'view_invoice', name="invoices-view_invoice"), + url(r'^(?P<pk>\d+)/print/$', 'print_invoice', name="invoices-print_invoice"), +) diff --git a/servo/urls/note.py b/servo/urls/note.py new file mode 100644 index 0000000..7d7d830 --- /dev/null +++ b/servo/urls/note.py @@ -0,0 +1,29 @@ +from django.conf.urls import patterns, url + +urlpatterns = patterns( + "servo.views.note", + url(r'^$', 'list_notes', name="notes-list_notes"), + url(r'^search/$', 'search', name="notes-search"), + url(r'^find/$', 'find', name="notes-find"), + + url(r'^templates/$', 'templates'), + url(r'^new/$', 'edit', name="notes-create"), + url(r'^templates/(\d+)/$', 'templates', name='notes-template'), + url(r'^render_template/$', 'render_template', name='notes-render_template'), + url(r'^to/customer/(?P<customer>\d+)/new/$', 'edit', name="notes-create_to_customer"), + url(r'^(?P<pk>\d+)/toggle/tag/(?P<tag_id>\d+)/$', 'toggle_tag', name="notes-toggle_tag"), + url(r'^(?P<pk>\d+)/toggle/(?P<flag>[a-z]+)/$', 'toggle_flag', name="notes-toggle_flag"), + url(r'^(?P<parent>\d+)/reply/$', 'edit', name="notes-reply"), + url(r'^(?P<pk>\d+)/edit/$', 'edit', name="notes-edit"), + url(r'^(?P<pk>\d+)/messages/$', 'list_messages', name="notes-messages"), + url(r'^(?P<pk>\d+)/delete/$', 'delete_note', name='notes-delete_note'), + url(r'^(?P<pk>\d+)/copy/$', 'copy', name='notes-copy'), + url(r'^to/(?P<recipient>.+)/new/$', 'edit', name="notes-create_with_recipient"), + url(r'^to/(?P<recipient>.+)/order/(?P<order_id>\d+)/$', 'edit', + name="notes-create_with_to_and_order"), + + url(r'^escalations/new/$', 'create_escalation', name="notes-create_escalation"), + + url(r'^(?P<kind>\w+)/$', 'list_notes', name="notes-list_notes"), + url(r'^(?P<kind>\w+)/(?P<pk>\d+)/view/$', 'view_note', name="notes-view_note"), +) diff --git a/servo/urls/order.py b/servo/urls/order.py new file mode 100644 index 0000000..da0b3e0 --- /dev/null +++ b/servo/urls/order.py @@ -0,0 +1,105 @@ +from servo.views import note +from django.conf.urls import patterns, url +from servo.views.order import update_order +from servo.views.invoices import create_invoice +from servo.views.gsx import create_repair, edit_repair, import_repair + + +urlpatterns = patterns( + "servo.views.order", + + url(r'^$', 'list_orders', name='orders-index'), + url(r'^search/$', 'search', name="orders-search"), + url(r'^batch/$', 'batch_process', name="orders-batch_process"), + url(r'^download/$', 'download_results', name="orders-download_results"), + + # Update commands + url(r'^(\d+)/set_([a-z]+)/(\d+)/$', update_order, name="orders-update"), + url(r'^(\d+)/users/(\d+)/remove/$', "remove_user", name="orders-remove_user"), + + url(r'^new/$', 'create', name='orders-create'), + url(r'^(\d+)/$', 'edit', name='orders-edit'), + + url(r'^(?P<pk>\d+)/$', 'edit', name='order-detail'), + + url(r'^(\d+)/delete/$', "delete", name="orders-delete_order"), + url(r'^(\d+)/copy/$', "copy_order", name="orders-copy_order"), + url(r'^(\d+)/follow/$', 'toggle_follow', name="orders-toggle_follow"), + url(r'^(\d+)/unfollow/$', 'toggle_follow'), + + url(r'^(\d+)/flag/$', 'toggle_flagged', name="orders-toggle_flagged"), + url(r'^(\d+)/events/$', 'events', name="orders-list_events"), + url(r'^(\d+)/repairs/(\d+)/$', 'repair', name="repairs-view_repair"), + url(r'^(\d+)/repairs/(\d+)/close/$', 'complete_repair', + name="repairs-complete_repair"), + url(r'^(\d+)/device/(\d+)/queue/(\d+)/parts/$', 'parts', + name="orders-list_parts"), + url(r'^(\d+)/remove_device/(\d+)/$', "remove_device", + name='orders-delete_device'), + + url(r'^(?P<pk>\d+)/add_device/(?P<device_id>\d+)/$', "add_device", + name="orders-add_device"), + url(r'^(?P<pk>\d+)/add_device/(?P<sn>\w+)/$', "add_device", + name="orders-add_device"), + + url(r'^(\d+)/products/$', 'products'), + url(r'^(\d+)/list_products/$', 'list_products', name="orders-list_products"), + + url(r'^(\d+)/close/$', 'close', name='orders-close'), + url(r'^(\d+)/reopen/$', 'reopen_order', name='orders-reopen_order'), + url(r'^(\d+)/tags/(\d+)/toggle/$', 'toggle_tag', name='orders-toggle_tag'), + url(r'^(\d+)/tasks/(\d+)/toggle/$', 'toggle_task', name='orders-toggle_task'), + url(r'^(\d+)/dispatch/$', create_invoice, name='orders-dispatch'), + url(r'^(\d+)/products/reserve/$', 'reserve_products', + name="orders-reserve_products"), + url(r'^(\d+)/products/(\d+)/create_device/$', 'device_from_product', + name="orders-create_device"), + + url(r'^(?P<pk>\d+)/customer/choose/', 'choose_customer', + name="orders-choose_customer"), + url(r'^(?P<pk>\d+)/customer/(?P<customer_id>\d+)/select/$', 'select_customer', + name="orders-select_customer"), + url(r'^(?P<pk>\d+)/customer/(?P<customer_id>\d+)/remove/$', 'remove_customer', + name="orders-remove_customer"), + + url(r'^create/product/(?P<product_id>\d+)/$', 'create', + name="orders-create_with_product"), + url(r'^create/note/(?P<note_id>\d+)/$', 'create', name="orders-create_with_note"), + url(r'^create/device/(?P<device_id>\d+)/$', 'create', + name='orders-create_with_device'), + url(r'^create/sn/(?P<sn>\w+)?/$', 'create', name='orders-create_with_sn'), + url(r'^create/customer/(?P<customer_id>\d+)?/$', 'create', + name="orders-create_with_customer"), + + url(r'^(?P<pk>\d+)/device/(?P<device_id>\d+)/accessories/$', 'accessories', + name='orders-accessories'), + url(r'^(?P<order_id>\d+)/device/(?P<device_id>\d+)/accessories/(?P<pk>\d+)/delete/$', + 'delete_accessory', name='orders-delete_accessory'), + + url(r'^(?P<pk>\d+)/print/(?P<kind>\w+)?/$', 'put_on_paper', + name="orders-print_order"), + + url(r'^(?P<pk>\d+)/products/(?P<item_id>\d+)/remove/$', 'remove_product', + name='orders-remove_product'), + url(r'^(?P<pk>\d+)/products/(?P<product_id>\d+)/add/$', 'add_product', + name="orders-add_product"), + url(r'^(?P<pk>\d+)/devices/(?P<device>\d+)/parts/(?P<code>[\w\-/]+)/add/$', 'add_part', name="orders-add_part"), + url(r'^(?P<pk>\d+)/devices/(?P<device>\d+)/history/$', 'history', name="orders-history"), + url(r'^(?P<pk>\d+)/products/(?P<item_id>\d+)/report/$', 'report_product', + name="orders-report_product"), + url(r'^(?P<pk>\d+)/devices/(?P<device_id>\d+)/report/$', 'report_device', + name="orders-report_device"), + url(r'^(?P<pk>\d+)/products/(?P<item_id>\d+)/edit/$', 'edit_product', + name="orders-edit_product"), + url(r'^(?P<pk>\d+)/products/(?P<item_id>\d+)/(?P<action>\w+)/$', 'products'), + + url(r'^(?P<order_id>\d+)/notes/new/$', note.edit, name="orders-add_note"), + url(r'^(?P<order_id>\d+)/notes/(?P<pk>\d+)/$', note.edit, + name="orders-edit_note"), + url(r'^(\d+)/device/(\d+)/repairs/(\w+)/create/$', create_repair, + name="repairs-create_repair"), + url(r'^(\d+)/repairs/(\d+)/edit/$', edit_repair, name="repairs-edit_repair"), + + url(r'^(\d+)/repairs/import/$', import_repair, name="repairs-import_repair"), + +) diff --git a/servo/urls/products.py b/servo/urls/products.py new file mode 100644 index 0000000..9de2575 --- /dev/null +++ b/servo/urls/products.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- + +from django.conf.urls import patterns, url + +urlpatterns = patterns( + "servo.views.product", + + url(r'^tags/$', "tags", name="products-tags"), + url(r'^all/$', "list_products", {'group': 'all'}, name="products-list_products"), + url(r'^download/$', "download_products", name="products-download"), + url(r'^upload/$', "upload_products", name="products-upload_products"), + url(r'^upload/parts/$', "upload_gsx_parts", name="products-upload_gsx_parts"), + url(r'^update_price/(\d+)/$', "update_price", name="products-update_price"), + + url(r'^all/(?P<pk>\d+)/$', "view_product", {'group': 'all'}, name="products-view_product"), + url(r'^(?P<group>[\w\-/]*)/(?P<pk>\d+)/view/$', "view_product", + name="products-view_product"), + + # Editing product categories + url(r'^categories/create/$', "edit_category", name="products-create_category"), + url(r'^categories/(?P<slug>[\w\-]+)/edit/$', + "edit_category", + name="products-edit_category"), + url(r'^categories/(?P<slug>[\w\-]+)/delete/$', + "delete_category", + name="products-delete_category"), + url(r'^categories/(?P<parent_slug>[\w\-]+)/create/$', + "edit_category", + name="products-create_category"), + + # Editing products + url(r'^create/$', "edit_product", name="products-create"), + url(r'^(?P<group>[\w\-]+)/create/$', "edit_product", name="products-create"), + url(r'^(?P<group>[\w\-/]*)/(?P<pk>\d+)/edit/$', "edit_product", + name="products-edit_product"), + url(r'^(?P<group>[\w\-/]*)/(?P<pk>\d+)/delete/$', "delete_product", + name="products-delete_product"), + + # Choosing a product for an order + url(r'^choose/order/(?P<order_id>\d+)/$', "choose_product", name="products-choose"), + + url(r'^(?P<group>[\w\-]+)/(?P<code>[\w\-/]+)/create/$', "edit_product", + name="products-create"), + url(r'^all/(?P<code>[\w\-/]+)/view/$', + "view_product", {'group': 'all'}, + name="products-view_product"), + url(r'^(?P<code>[\w\-/]+)/new/$', + "edit_product", {'group': None}, + name="products-create"), + + url(r'^code/(?P<code>[\w\-/]+)/location/(?P<location>\d+)/get_info/$', + "get_info", + name="products-get_info"), + + url(r'^(?P<group>[\w\-]+)/$', "list_products", name="products-list_products"), +) diff --git a/servo/urls/purchases.py b/servo/urls/purchases.py new file mode 100644 index 0000000..8bf630b --- /dev/null +++ b/servo/urls/purchases.py @@ -0,0 +1,25 @@ +from django.conf.urls import patterns, url +from servo.views.product import choose_product + +urlpatterns = patterns( + "servo.views.purchases", + url(r'^$', 'list_pos', name="purchases-list_pos"), + + url(r'^product/(?P<product_id>\d+)/order/$', 'create_po', name='purchases-create_po'), + url(r'^po/create/$', 'create_po', {'order_id': None, 'product_id': None}, + name='purchases-create_po'), + url(r'^po/(\d+)/edit/$', 'edit_po', name="purchases-edit_po"), + url(r'^po/(\d+)/view/$', 'view_po', name="purchases-view_po"), + url(r'^po/(\d+)/delete/$', 'delete_po', name="purchases-delete_po"), + url(r'^po/(\d+)/order_stock/$', 'order_stock', name="purchases-submit_stock_order"), + url(r'^po/(\d+)/purchases/choose/$', choose_product, + {'target_url': "purchases-add_to_po"}, + name="purchases-choose_for_po"), + url(r'^po/order/(?P<order_id>\d+)/$', 'create_po', name="purchases-create_po"), + url(r'^po/(?P<pk>\d+)/purchases/(?P<product_id>\d+)/add/$', 'add_to_po', + name="purchases-add_to_po"), + url(r'^po/(?P<pk>\d+)/purchases/(?P<item_id>\d+)/delete/$', 'delete_from_po', + name="purchases-delete_from_po"), + + url(r'^(\w+)/(\w+)/$', 'list_pos', name="purchases-browse_pos"), +) diff --git a/servo/urls/repairs.py b/servo/urls/repairs.py new file mode 100644 index 0000000..5cba1c6 --- /dev/null +++ b/servo/urls/repairs.py @@ -0,0 +1,11 @@ +from django.conf.urls import patterns, url + +urlpatterns = patterns( + "servo.views.gsx", + url(r'^(\d+)/delete/$', 'delete_repair', name="repairs-delete_repair"), + url(r'^(\d+)/parts/(\d+)/remove/$', 'remove_part', name="repairs-remove_part"), + url(r'^(\d+)/parts/(\d+)/add/$', 'add_part', name="repairs-add_part"), + url(r'^(\d+)/parts/(\d+)/update_sn/$', 'update_sn', name="repairs-update_sn"), + url(r'^(\d+)/copy/$', 'copy_repair', name="repairs-copy_repair"), + url(r'^(\d+)/check_parts/$', 'check_parts_warranty', name="repairs-check_parts"), +) diff --git a/servo/urls/rules.py b/servo/urls/rules.py new file mode 100644 index 0000000..5328e28 --- /dev/null +++ b/servo/urls/rules.py @@ -0,0 +1,10 @@ +from django.conf.urls import patterns, include, url + +urlpatterns = patterns( + 'servo.views.rules', + url(r'^$', 'list_rules', name='rules-list_rules'), + url(r'^add/$', 'edit_rule', name='rules-create'), + url(r'^(?P<pk>\d+)$', 'view_rule', name='rules-view_rule'), + url(r'^(?P<pk>\d+)/edit/$', 'edit_rule', name='rules-edit_rule'), + url(r'^(?P<pk>\d+)/delete/$', 'delete_rule', name='rules-delete_rule'), +) diff --git a/servo/urls/sales.py b/servo/urls/sales.py new file mode 100644 index 0000000..db8a834 --- /dev/null +++ b/servo/urls/sales.py @@ -0,0 +1,10 @@ +from django.conf.urls import patterns, url, include + +urlpatterns = patterns( + "", + url(r'^products/', include('servo.urls.products')), + url(r'^purchases/', include('servo.urls.purchases')), + url(r'^shipments/', include('servo.urls.shipments')), + url(r'^invoices/', include('servo.urls.invoices')), + url(r'^search/$', 'servo.views.product.search'), +) diff --git a/servo/urls/search.py b/servo/urls/search.py new file mode 100644 index 0000000..dcd7821 --- /dev/null +++ b/servo/urls/search.py @@ -0,0 +1,27 @@ +from django.conf.urls import patterns, url +from django.views.decorators.cache import cache_page + +from servo.views.search import search_gsx + +urlpatterns = patterns( + "servo.views.search", + url(r'^$', "spotlight", + name="search-spotlight"), + url(r'^gsx/(?P<what>\w+)/$', "list_gsx", + name="search-gsx"), + url(r'^gsx/(?P<what>\w+)/for/(?P<q>\w+)/$', "list_gsx", + name="search-gsx"), + # /search/gsx/parts/?productName=iPod+Shuffle... + url(r'^gsx/(?P<what>\w+)/(?P<arg>\w+)/(?P<value>[~\w\s,\-\(\)/\.]+)/$', + cache_page(60*15)(search_gsx), + name="search-search_gsx"), + url(r'^gsx/(?P<what>\w+)/results/$', "view_gsx_results", + name="search-gsx_results"), + url(r'^notes/$', "list_notes"), + url(r'^products/$', "list_products"), + url(r'^orders/$', "list_orders"), + url(r'^customers/$', "list_customers"), + url(r'^devices/$', "list_devices"), + url(r'^gsx/$', "list_gsx"), + url(r'^articles/$', "list_articles"), +) diff --git a/servo/urls/shipments.py b/servo/urls/shipments.py new file mode 100644 index 0000000..580354b --- /dev/null +++ b/servo/urls/shipments.py @@ -0,0 +1,28 @@ +from django.conf.urls import patterns, url + +urlpatterns = patterns( + "servo.views.shipments", + url(r'^returns/list/$', "list_bulk_returns", name="shipments-list_bulk_returns"), + url(r'^returns/pending/$', "edit_bulk_return", name="shipments-edit_bulk_return"), + url(r'^returns/pending/(?P<ship_to>\d+)/$', "edit_bulk_return", name="shipments-edit_bulk_return"), + url(r'^returns/(?P<pk>\d+)/$', "view_bulk_return", name="shipments-view_bulk_return"), + url(r'^returns/(?P<pk>\d+)/packing_list/$', "view_packing_list", name="shipments-view_packing_list"), + + url(r'^incoming/$', "list_incoming", name="shipments-list_incoming"), + url(r'^incoming/(?P<pk>\d+)/$', "view_incoming", name="shipments-view_incoming"), + + url(r'^returns/(?P<pk>\d+)/verify/$', "verify", name="shipments-verify"), + + url(r'^returns/$', 'list_returns', name="shipments-returns"), + url(r'^incoming/date/$', 'list_incoming', {'status': 'received'}), + url(r'^returns/(?P<pk>\d+)/parts/(?P<part_pk>\d+)/remove/$', 'remove_from_return', + name="shipments-remove_from_return"), + url(r'^returns/(?P<pk>\d+)/parts/add/$', 'add_to_return', + name="shipments-pick_for_return"), + url(r'^returns/(?P<pk>\d+)/parts/(?P<part>\d+)/$', 'add_to_return', + name="shipments-add_to_return"), + url(r'^(?P<code>[\w\-/]+)/return_label/(?P<return_order>\d+)/$', 'return_label', + name="shipments-return_label"), + url(r'^(?P<part>\d+)/update/return_type/(?P<return_type>\d{1})/', 'update_part', + name="shipments-update_part"), +) diff --git a/servo/urls/stats.py b/servo/urls/stats.py new file mode 100644 index 0000000..df01d06 --- /dev/null +++ b/servo/urls/stats.py @@ -0,0 +1,13 @@ +from django.conf.urls import patterns, url + +urlpatterns = patterns( + 'servo.views.stats', + url(r'^$', 'index', name="stats-index"), + url(r'^sales/$', 'sales', name="stats-sales"), + url(r'^queues/$', 'queues', name="stats-queues"), + url(r'^locations/$', 'locations', name="stats-locations"), + url(r'^statuses/$', 'statuses', name="stats-statuses"), + url(r'^data/(?P<query>[\w/\-]+)/$', 'data', name="stats-data"), + + url(r'^repairs/$', 'repairs', name="stats-repairs"), +) |