aboutsummaryrefslogtreecommitdiffstats
path: root/servo/templates
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-08-04 10:11:24 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-08-04 10:11:24 +0300
commit63b0fc6269b38edf7234b9f151b80d81f614c0a3 (patch)
tree555de3068f33f8dddb4619349bbea7d9b7c822fd /servo/templates
downloadServo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.tar.gz
Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.tar.bz2
Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.zip
Initial commit
First public commit
Diffstat (limited to 'servo/templates')
-rwxr-xr-xservo/templates/about.html25
-rwxr-xr-xservo/templates/accounts/calendar_form.html12
-rwxr-xr-xservo/templates/accounts/calendars.html55
-rwxr-xr-xservo/templates/accounts/delete_calendar.html17
-rwxr-xr-xservo/templates/accounts/delete_calendar_event.html13
-rwxr-xr-xservo/templates/accounts/edit_calendar_event.html14
-rwxr-xr-xservo/templates/accounts/login.html22
-rwxr-xr-xservo/templates/accounts/logout.html17
-rwxr-xr-xservo/templates/accounts/orders.html59
-rwxr-xr-xservo/templates/accounts/print_calendar.html82
-rwxr-xr-xservo/templates/accounts/register.html14
-rwxr-xr-xservo/templates/accounts/settings.html46
-rwxr-xr-xservo/templates/accounts/stats.html42
-rwxr-xr-xservo/templates/accounts/tabs.html22
-rw-r--r--servo/templates/accounts/updates.html65
-rwxr-xr-xservo/templates/accounts/view_calendar.html66
-rw-r--r--servo/templates/admin/backups.html17
-rw-r--r--servo/templates/admin/checklist/form.html31
-rw-r--r--servo/templates/admin/checklist/index.html6
-rw-r--r--servo/templates/admin/fields/form.html17
-rw-r--r--servo/templates/admin/fields/index.html30
-rw-r--r--servo/templates/admin/fields/remove.html8
-rwxr-xr-xservo/templates/admin/gsx/form.html20
-rwxr-xr-xservo/templates/admin/gsx/index.html6
-rwxr-xr-xservo/templates/admin/gsx/remove.html13
-rw-r--r--servo/templates/admin/index.html50
-rw-r--r--servo/templates/admin/inventory/index.html18
-rw-r--r--servo/templates/admin/locations/form.html40
-rw-r--r--servo/templates/admin/locations/index.html6
-rw-r--r--servo/templates/admin/notifications/form.html5
-rw-r--r--servo/templates/admin/notifications/index.html39
-rw-r--r--servo/templates/admin/queues/form.html81
-rw-r--r--servo/templates/admin/queues/index.html6
-rw-r--r--servo/templates/admin/queues/remove.html17
-rw-r--r--servo/templates/admin/settings.html136
-rw-r--r--servo/templates/admin/sites/edit_site.html9
-rw-r--r--servo/templates/admin/sites/index.html23
-rw-r--r--servo/templates/admin/statuses/form.html21
-rw-r--r--servo/templates/admin/statuses/index.html6
-rw-r--r--servo/templates/admin/statuses/remove.html17
-rw-r--r--servo/templates/admin/tags/form.html17
-rw-r--r--servo/templates/admin/tags/index.html37
-rw-r--r--servo/templates/admin/templates/form.html21
-rw-r--r--servo/templates/admin/templates/list_templates.html7
-rw-r--r--servo/templates/admin/users/delete_group.html11
-rw-r--r--servo/templates/admin/users/form.html70
-rw-r--r--servo/templates/admin/users/group_form.html23
-rw-r--r--servo/templates/admin/users/groups.html37
-rw-r--r--servo/templates/admin/users/index.html51
-rw-r--r--servo/templates/admin/users/remove.html17
-rw-r--r--servo/templates/admin/users/tabs.html7
-rw-r--r--servo/templates/admin/users/upload_users.html13
-rw-r--r--servo/templates/checkin/confirmation.html13
-rw-r--r--servo/templates/checkin/customer_form.html87
-rw-r--r--servo/templates/checkin/device_form.html62
-rw-r--r--servo/templates/checkin/error.html15
-rw-r--r--servo/templates/checkin/index.html95
-rw-r--r--servo/templates/checkin/newindex.html146
-rw-r--r--servo/templates/checkin/status-show.html35
-rw-r--r--servo/templates/checkin/status.html21
-rw-r--r--servo/templates/checkin/terms.html9
-rw-r--r--servo/templates/checkin/thanks.html26
-rwxr-xr-xservo/templates/customers/choose-list.html8
-rwxr-xr-xservo/templates/customers/choose.html45
-rwxr-xr-xservo/templates/customers/delete_group.html17
-rwxr-xr-xservo/templates/customers/edit_group.html8
-rw-r--r--servo/templates/customers/find.html95
-rwxr-xr-xservo/templates/customers/form.html51
-rwxr-xr-xservo/templates/customers/index.html84
-rwxr-xr-xservo/templates/customers/list.html11
-rw-r--r--servo/templates/customers/merge.html19
-rwxr-xr-xservo/templates/customers/move.html20
-rwxr-xr-xservo/templates/customers/remove.html17
-rw-r--r--servo/templates/customers/results-merge.html5
-rwxr-xr-xservo/templates/customers/search-results.html5
-rwxr-xr-xservo/templates/customers/search.html44
-rw-r--r--servo/templates/customers/upload.html13
-rwxr-xr-xservo/templates/customers/view.html119
-rwxr-xr-xservo/templates/default.html185
-rwxr-xr-xservo/templates/default_print.html23
-rwxr-xr-xservo/templates/devices/accessories_edit.html40
-rwxr-xr-xservo/templates/devices/choose-error.html5
-rwxr-xr-xservo/templates/devices/choose-list.html12
-rwxr-xr-xservo/templates/devices/choose.html26
-rw-r--r--servo/templates/devices/diagnostic_error.html1
-rw-r--r--servo/templates/devices/diagnostic_init.html16
-rw-r--r--servo/templates/devices/diagnostic_ios.html20
-rwxr-xr-xservo/templates/devices/diagnostic_results.html22
-rwxr-xr-xservo/templates/devices/diagnostics.html13
-rwxr-xr-xservo/templates/devices/find.html66
-rwxr-xr-xservo/templates/devices/form.html44
-rwxr-xr-xservo/templates/devices/get_info.html45
-rwxr-xr-xservo/templates/devices/index.html78
-rwxr-xr-xservo/templates/devices/list.html38
-rwxr-xr-xservo/templates/devices/parts.html42
-rwxr-xr-xservo/templates/devices/remove.html17
-rwxr-xr-xservo/templates/devices/search.html15
-rwxr-xr-xservo/templates/devices/search_gsx.html41
-rwxr-xr-xservo/templates/devices/search_gsx_error.html19
-rwxr-xr-xservo/templates/devices/search_gsx_parts.html30
-rwxr-xr-xservo/templates/devices/search_gsx_repairs.html27
-rwxr-xr-xservo/templates/devices/search_gsx_results.html5
-rwxr-xr-xservo/templates/devices/search_gsx_warranty.html71
-rwxr-xr-xservo/templates/devices/specs.html42
-rwxr-xr-xservo/templates/devices/summary.html48
-rwxr-xr-xservo/templates/devices/upload_devices.html13
-rwxr-xr-xservo/templates/devices/view.html83
-rwxr-xr-xservo/templates/dropdown_snippet.html8
-rw-r--r--servo/templates/error.html49
-rwxr-xr-xservo/templates/form_buttons.html5
-rwxr-xr-xservo/templates/form_field_snippet.html30
-rwxr-xr-xservo/templates/form_snippet.html7
-rw-r--r--servo/templates/generic/admin_list.html18
-rwxr-xr-xservo/templates/generic/button_dropdown.html12
-rwxr-xr-xservo/templates/generic/delete.html17
-rwxr-xr-xservo/templates/generic/index.html23
-rwxr-xr-xservo/templates/invoices/index.html106
-rwxr-xr-xservo/templates/invoices/view_invoice.html0
-rwxr-xr-xservo/templates/login.html26
-rwxr-xr-xservo/templates/modal.html19
-rwxr-xr-xservo/templates/notes/edit_escalation.html17
-rwxr-xr-xservo/templates/notes/find.html39
-rwxr-xr-xservo/templates/notes/form.html112
-rwxr-xr-xservo/templates/notes/list_notes.html75
-rw-r--r--servo/templates/notes/messages.html22
-rwxr-xr-xservo/templates/notes/remove.html17
-rwxr-xr-xservo/templates/notes/search-results.html25
-rwxr-xr-xservo/templates/notes/search.html18
-rwxr-xr-xservo/templates/notes/templates.html10
-rwxr-xr-xservo/templates/notes/view_escalation.html1
-rwxr-xr-xservo/templates/notes/view_note.html38
-rwxr-xr-xservo/templates/oauth/challenge.html0
-rw-r--r--servo/templates/orders/batch_process.html14
-rwxr-xr-xservo/templates/orders/checklists.html10
-rwxr-xr-xservo/templates/orders/close.html17
-rwxr-xr-xservo/templates/orders/close_repair.html17
-rwxr-xr-xservo/templates/orders/customer.html52
-rwxr-xr-xservo/templates/orders/delete_order.html17
-rwxr-xr-xservo/templates/orders/devices.html139
-rwxr-xr-xservo/templates/orders/dispatch.html115
-rwxr-xr-xservo/templates/orders/edit.html115
-rwxr-xr-xservo/templates/orders/edit_product.html33
-rwxr-xr-xservo/templates/orders/events.html21
-rwxr-xr-xservo/templates/orders/followers.html28
-rwxr-xr-xservo/templates/orders/gsx_repair_form.html94
-rw-r--r--servo/templates/orders/history.html9
-rwxr-xr-xservo/templates/orders/index.html55
-rwxr-xr-xservo/templates/orders/list.html43
-rwxr-xr-xservo/templates/orders/list_products.html22
-rwxr-xr-xservo/templates/orders/notes.html84
-rwxr-xr-xservo/templates/orders/parts.html36
-rwxr-xr-xservo/templates/orders/print_confirmation.html193
-rwxr-xr-xservo/templates/orders/print_dispatch.html38
-rwxr-xr-xservo/templates/orders/print_quote.html3
-rwxr-xr-xservo/templates/orders/print_receipt.html46
-rwxr-xr-xservo/templates/orders/products.html98
-rwxr-xr-xservo/templates/orders/remove_customer.html17
-rwxr-xr-xservo/templates/orders/remove_device.html17
-rwxr-xr-xservo/templates/orders/remove_product.html17
-rwxr-xr-xservo/templates/orders/repair.html63
-rwxr-xr-xservo/templates/orders/reserve_products.html13
-rwxr-xr-xservo/templates/orders/search.html7
-rwxr-xr-xservo/templates/orders/statuses.html7
-rwxr-xr-xservo/templates/orders/tabs.html8
-rwxr-xr-xservo/templates/orders/toggle_flagged.html1
-rwxr-xr-xservo/templates/orders/toggle_follow.html1
-rwxr-xr-xservo/templates/orders/toolbar.html116
-rwxr-xr-xservo/templates/pagination.html18
-rwxr-xr-xservo/templates/products/category_form.html13
-rwxr-xr-xservo/templates/products/choose-list.html9
-rwxr-xr-xservo/templates/products/choose.html25
-rwxr-xr-xservo/templates/products/delete_category.html17
-rwxr-xr-xservo/templates/products/form.html90
-rwxr-xr-xservo/templates/products/get_info.html59
-rwxr-xr-xservo/templates/products/index.html104
-rwxr-xr-xservo/templates/products/index_outgoing.html56
-rwxr-xr-xservo/templates/products/list.html27
-rwxr-xr-xservo/templates/products/list_rows.html55
-rwxr-xr-xservo/templates/products/receive_item.html51
-rwxr-xr-xservo/templates/products/remove.html13
-rwxr-xr-xservo/templates/products/search.html20
-rwxr-xr-xservo/templates/products/tabs.html21
-rwxr-xr-xservo/templates/products/upload_gsx_parts.html13
-rwxr-xr-xservo/templates/products/upload_products.html13
-rwxr-xr-xservo/templates/products/view.html205
-rwxr-xr-xservo/templates/products/view_incoming.html1
-rwxr-xr-xservo/templates/purchases/edit_po.html92
-rwxr-xr-xservo/templates/purchases/list_pos.html132
-rwxr-xr-xservo/templates/purchases/order_stock.html17
-rwxr-xr-xservo/templates/purchases/view_po.html56
-rwxr-xr-xservo/templates/repairs/add_part.html22
-rwxr-xr-xservo/templates/repairs/check_parts.html10
-rwxr-xr-xservo/templates/repairs/delete_part.html12
-rwxr-xr-xservo/templates/repairs/delete_repair.html16
-rwxr-xr-xservo/templates/repairs/get_details.html27
-rwxr-xr-xservo/templates/repairs/part_menu.html33
-rw-r--r--servo/templates/rules/form.html142
-rw-r--r--servo/templates/rules/list.html6
-rw-r--r--servo/templates/rules/list_rules.html22
-rwxr-xr-xservo/templates/search/results/articles.html10
-rwxr-xr-xservo/templates/search/results/customers.html26
-rwxr-xr-xservo/templates/search/results/devices.html10
-rwxr-xr-xservo/templates/search/results/gsx.html41
-rwxr-xr-xservo/templates/search/results/gsx_error.html4
-rwxr-xr-xservo/templates/search/results/gsx_notfound.html4
-rwxr-xr-xservo/templates/search/results/gsx_repair_details.html19
-rwxr-xr-xservo/templates/search/results/gsx_results.html5
-rwxr-xr-xservo/templates/search/results/gsx_warranty.html49
-rwxr-xr-xservo/templates/search/results/notes.html20
-rwxr-xr-xservo/templates/search/results/orders.html10
-rwxr-xr-xservo/templates/search/results/products.html10
-rwxr-xr-xservo/templates/search/spotlight.html37
-rwxr-xr-xservo/templates/shipments/add_to_return-results.html8
-rwxr-xr-xservo/templates/shipments/add_to_return.html14
-rwxr-xr-xservo/templates/shipments/edit_bulk_return.html101
-rwxr-xr-xservo/templates/shipments/index.html46
-rwxr-xr-xservo/templates/shipments/list_bulk_returns.html37
-rwxr-xr-xservo/templates/shipments/list_incoming.html61
-rwxr-xr-xservo/templates/shipments/list_returns.html44
-rwxr-xr-xservo/templates/shipments/submit_bulk_return.html15
-rwxr-xr-xservo/templates/shipments/update_part.html14
-rwxr-xr-xservo/templates/shipments/view_bulk_return.html35
-rw-r--r--servo/templates/snippets/alert.html1
-rwxr-xr-xservo/templates/snippets/control_group.html3
-rwxr-xr-xservo/templates/snippets/dropdown.html11
-rwxr-xr-xservo/templates/snippets/dropdown_menu.html5
-rwxr-xr-xservo/templates/snippets/error_modal.html10
-rwxr-xr-xservo/templates/snippets/filtering_form.html15
-rwxr-xr-xservo/templates/snippets/form_field.html12
-rwxr-xr-xservo/templates/snippets/form_field_label.html1
-rwxr-xr-xservo/templates/snippets/form_input.html22
-rwxr-xr-xservo/templates/snippets/modal.html14
-rwxr-xr-xservo/templates/stats/index.html68
-rwxr-xr-xservo/templates/stats/locations.html33
-rw-r--r--servo/templates/stats/newstats.html87
-rwxr-xr-xservo/templates/stats/plot_snippet.html9
-rwxr-xr-xservo/templates/stats/queues.html29
-rwxr-xr-xservo/templates/stats/sales.html33
-rwxr-xr-xservo/templates/stats/statuses.html21
-rwxr-xr-xservo/templates/tabbed_form.html14
-rwxr-xr-xservo/templates/three_column_layout.html27
-rwxr-xr-xservo/templates/two_column_layout.html18
242 files changed, 8371 insertions, 0 deletions
diff --git a/servo/templates/about.html b/servo/templates/about.html
new file mode 100755
index 0000000..c8a6521
--- /dev/null
+++ b/servo/templates/about.html
@@ -0,0 +1,25 @@
+{% load staticfiles %}
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Servo Credits</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link href="{{ STATIC_URL }}js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+ <script src="{{ STATIC_URL }}js/jquery.min.js"></script>
+ <script src="{{ STATIC_URL }}js/bootstrap/js/bootstrap.min.js"></script>
+ </head>
+ <body>
+ <div class="container">
+ <div class="text-center">
+ <img src="{{ STATIC_URL }}images/servo-logo-large.gif" alt=""/></div>
+ <p class="text-center">
+ <h5>Creator and Developer</h5>
+ Filipp Lepalaaan
+ <h5>Special Thanks</h5>
+ Janne, Rami, Joonas and Vesa
+ </p>
+ </div>
+ <script src="http://code.jquery.com/jquery.js"></script>
+ <script src="js/bootstrap.min.js"></script>
+ </body>
+</html>
diff --git a/servo/templates/accounts/calendar_form.html b/servo/templates/accounts/calendar_form.html
new file mode 100755
index 0000000..4094d01
--- /dev/null
+++ b/servo/templates/accounts/calendar_form.html
@@ -0,0 +1,12 @@
+{% extends "snippets/modal.html" %}
+
+{% block header %}
+ {{ title }}
+{% endblock header %}
+
+{% block body %}
+ <form method="post" action="{{ action }}" accept-charset="utf-8" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ </form>
+{% endblock body %}
diff --git a/servo/templates/accounts/calendars.html b/servo/templates/accounts/calendars.html
new file mode 100755
index 0000000..c10276c
--- /dev/null
+++ b/servo/templates/accounts/calendars.html
@@ -0,0 +1,55 @@
+{% extends "accounts/orders.html" %}
+{% load i18n %}
+{% load servo_tags %}
+
+{% block toolbar %}
+<div class="btn-group">
+ <a href="{% url 'calendars-create' username=request.user.username %}" data-modal="#modal" class="btn"><i class="icon-plus"></i> {% trans "New Calendar" %}</a>
+{% if calendar %}
+ <a href="{% url 'calendars.event.edit' username=request.user.username cal_pk=calendar.pk %}" class="btn">{% trans "New Event" %}</a>
+{% endif %}
+</div>
+
+<div class="btn-group">
+{% if calendar %}
+ <a href="print/" class="btn window"><i class="icon-print"></i> {% trans "Print" %}</a>
+ <a href="{% url 'calendars-edit' request.user.username calendar.pk view %}" data-modal="#modal" class="btn"><i class="icon-pencil"></i> {% trans "Edit" %}</a>
+ {% if perms.servo.delete_calendar %}
+ <a href="{{ calendar.get_absolute_url }}delete/" data-modal="#modal" class="btn"><i class="icon-trash"></i> {% trans "Delete" %}</a>
+ {% else %}
+ <a href="" class="btn disabled">{% trans "Delete" %}</a>
+ {% endif %}
+{% endif %}
+</div>
+
+<div class="btn-group">
+ <a href="download/" class="btn {% if not calendar %}disabled{% endif %}"><i class="icon-download"></i> {% trans "Download" %}</a>
+</div>
+
+{% endblock toolbar %}
+
+{% block second_row %}
+
+<div class="row-fluid">
+ <div class="span3">
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Calendars" %}</li>
+ {% for c in calendars %}
+ <li class="{% active request c.pk '/' %}">
+ <a href="{% url 'calendars.view' pk=c.pk username=request.user.username view='week' %}">{{ c.title }}<span class="badge pull-right">{{ c.get_unfinished_count }}</span></a>
+ </li>
+ {% endfor %}
+ </ul>
+ </div>
+
+ <div class="span9">
+ {% block detail_view %}
+ <h1 class="muted text-center">{% trans "No calendar selected" %}</h1>
+ {% endblock detail_view %}
+ </div>
+</div>
+{% endblock second_row %}
+
+{% block crumbs %}
+ <li class="active"><a href="{% url 'calendars-list' username=request.user.username %}">{% trans "Calendars" %}</a></li>
+{% endblock crumbs %}
diff --git a/servo/templates/accounts/delete_calendar.html b/servo/templates/accounts/delete_calendar.html
new file mode 100755
index 0000000..bae2e16
--- /dev/null
+++ b/servo/templates/accounts/delete_calendar.html
@@ -0,0 +1,17 @@
+{% extends "snippets/modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {{ title }}
+{% endblock header %}
+
+{% block body %}
+ {% trans "This will also delete all events in this calendar" %}
+{% endblock body %}
+
+{% block footer %}
+ <form method="post" action="{{ action }}">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/accounts/delete_calendar_event.html b/servo/templates/accounts/delete_calendar_event.html
new file mode 100755
index 0000000..58fbef3
--- /dev/null
+++ b/servo/templates/accounts/delete_calendar_event.html
@@ -0,0 +1,13 @@
+{% extends "snippets/modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {{ title }}
+{% endblock header %}
+
+{% block footer %}
+ <form action="{{ action }}" method="post">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/accounts/edit_calendar_event.html b/servo/templates/accounts/edit_calendar_event.html
new file mode 100755
index 0000000..7316791
--- /dev/null
+++ b/servo/templates/accounts/edit_calendar_event.html
@@ -0,0 +1,14 @@
+{% extends "accounts/calendars.html" %}
+
+{% block detail_view %}
+ <form action="" method="post" accept-charset="utf-8">
+ {% csrf_token %}
+ {% include "form_field_snippet.html" with field=form.started_at %}
+ <div class="input-append">
+ {{ form.finished_at }}
+ <button class="btn" type="button" id="set_dt"><i class="icon-time"></i></button>
+ </div>
+ {% include "form_field_snippet.html" with field=form.notes %}
+ {% include "form_buttons.html" %}
+ </form>
+{% endblock detail_view %}
diff --git a/servo/templates/accounts/login.html b/servo/templates/accounts/login.html
new file mode 100755
index 0000000..80ba716
--- /dev/null
+++ b/servo/templates/accounts/login.html
@@ -0,0 +1,22 @@
+{% extends "login.html" %}
+{% load i18n %}
+
+{% block content %}
+<img src="{{ STATIC_URL }}images/logo_servoapp.png" class="servo-logo" alt=""/>
+<form action="{% url "accounts-login" %}" method="post" accept-charset="utf-8">
+ {% csrf_token %}
+ <div class="input-prepend">
+ <span class="add-on"><i class="icon-user"></i></span>
+ {{ form.username }}
+ </div>
+ <div class="input-prepend">
+ <span class="add-on"><i class="icon-lock"></i></span>
+ {{ form.password }}
+ </div>
+ <br/>
+ <div class="pull-right">
+ <a class="btn btn" href="{% url 'checkin-index' %}">{% trans "Check-in" %}</a>
+ <button class="btn btn-primary" type="submit">{% trans "Login" %}</button>
+ </div>
+</form>
+{% endblock content %}
diff --git a/servo/templates/accounts/logout.html b/servo/templates/accounts/logout.html
new file mode 100755
index 0000000..1b64d45
--- /dev/null
+++ b/servo/templates/accounts/logout.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+{% trans "Logging out?" %}
+{% endblock header %}
+
+{% block body %}
+{% trans "This will terminate your Servo session." %}
+{% endblock body %}
+
+{% block footer %}
+<form action="{% url 'accounts-logout' %}" method="post">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Log out" %}</button>
+</form>
+{% endblock footer %}
diff --git a/servo/templates/accounts/orders.html b/servo/templates/accounts/orders.html
new file mode 100755
index 0000000..8420ad8
--- /dev/null
+++ b/servo/templates/accounts/orders.html
@@ -0,0 +1,59 @@
+{% extends "default.html" %}
+{% load i18n %}
+{% load servo_tags %}
+
+{% block toolbar %}
+{% if perms.servo.add_order %}
+ <a href="{% url 'orders-create' %}" class="btn"><i class="icon-plus"></i> {% trans "Create Order" %}</a>
+{% endif %}
+{% endblock toolbar %}
+
+{% block content %}
+<div class="page-header clearfix">
+ <div class="pull-left">
+ <h2><i class="glyphicons-icon home"></i> {{ title }}<br/><small style="margin-left:60px">{{ subtitle }}</small></h2>
+ </div>
+ <form class="form-search pull-right">
+ <div class="input-append">
+ <input type="text" class="search-query filter" placeholder="{% trans "Filter results" %}"/>
+ <button type="button" class="btn" data-toggle="collapse" data-target="#collapsable"><i class="icon-search"></i></button>
+ </div>
+ </form>
+</div>
+
+<div class="row-fluid">
+ <div class="span12">
+ {% include "accounts/tabs.html" %}
+ </div>
+</div>
+
+{% block second_row %}
+
+<div id="collapsable" class="collapse out">
+ <div class="well clearfix">
+ <form action="" method="get" class="form-inline">
+ {% for field in form %}
+ <div class="control-group pull-left">
+ <label class="control-label">{{ field.label }}</label>
+ <div class="controls">{{ field }}</div>
+ </div>
+ {% endfor %}
+ <p class="clearfix"><hr/></p>
+ <div class="pull-right">
+ <a class="btn" href="{% url 'accounts-list_orders' username=request.user.username %}?user=state=1&amp;user={{ request.user.pk }}"><i class="icon-refresh"></i> {% trans "Reset" %}</a>
+ <button class="btn btn-primary" type="submit"><i class="icon-search icon-white"></i> {% trans "Search" %}</button>
+ </div>
+ </form>
+ </div>
+</div>
+{% block second_column %}
+ {% include "orders/list.html" %}
+{% endblock second_column %}
+</div>
+{% endblock second_row %}
+
+{% endblock content %}
+
+{% block crumbs %}
+<li class="active">{% trans "Orders" %}</li>
+{% endblock crumbs %}
diff --git a/servo/templates/accounts/print_calendar.html b/servo/templates/accounts/print_calendar.html
new file mode 100755
index 0000000..64edbe3
--- /dev/null
+++ b/servo/templates/accounts/print_calendar.html
@@ -0,0 +1,82 @@
+{% extends "default_print.html" %}
+{% load servo_tags %}
+{% load mptt_tags %}
+{% load static %}
+{% load i18n %}
+
+{% block content %}
+<div class="row">
+ <div class="span4">
+ {% if location.logo %}
+ <img src="{% get_media_prefix %}{{ location.logo }}" alt="logo" title="logo" class="media-object pull-left span2" style="margin:10px"/>
+ {% endif %}
+ </div>
+ <div class="span4">
+ {{ location.title }}<br/>
+ {{ location.address }}<br/>
+ {{ location.zip_code }}, {{ location.city }}<br/>
+ {{ location.notes }}
+ </div>
+ <div class="span4">
+ {% block location_info %}
+ {% endblock location_info %}
+ {% trans "Email Address" %}: {{ location.email }}<br/>
+ {% trans "Phone" %}: {{ location.phone }}<br/><br/>
+ </div>
+</div>
+<div class="row" style="margin-top:2em;margin-bottom:1em">
+ <div class="span6">
+ {% trans "Employee" %}: {{ calendar.user.get_full_name }}<br/>
+ {% trans "Date" %}: {% now "SHORT_DATE_FORMAT" %}
+ </div>
+</div>
+<div class="row">
+ <div class="span12 text-center"><h3>{{ title }}</h3></div>
+</div>
+<div class="row">
+ <div class="span12">
+ <table class="table">
+ <thead>
+ <tr>
+ <th>{% trans "Date" %}</th>
+ <th>{% trans "Started At" %}</th>
+ <th>{% trans "Finished At" %}</th>
+ <th>{% trans "Duration" %}</th>
+ <th>{% trans "Notes" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for i in events %}
+ <tr>
+ <td>{% ifchanged i.started_at|date %}{{ i.started_at|date:"SHORT_DATE_FORMAT" }}{% endifchanged %}</td>
+ <td>{{ i.started_at|time:"TIME_FORMAT" }}</td>
+ <td>{{ i.finished_at|time:"TIME_FORMAT"|default:"-" }}</td>
+ <td>{{ i.get_duration }}</td>
+ <td>{{ i.notes|default:'' }}</td>
+ </tr>
+ {% empty %}
+ <tr><td colspan="6" class="muted empty">{% trans "No events found" %}</td></tr>
+ {% endfor %}
+ </tbody>
+ <tfoot>
+ <tr>
+ <td><strong>{% trans "Total" %}</strong></td>
+ <td colspan="4"><strong>{{ subtitle }}</strong></td>
+ </tr>
+ </tfoot>
+ </table>
+ </div>
+</div>
+<br/>
+<br/>
+<div class="row">
+ <div class="span6">
+ <hr/>
+ {% trans "Manager" %}
+ </div>
+ <div class="span6">
+ <hr/>
+ {% trans "Employee" %}
+ </div>
+</div>
+{% endblock content %}
diff --git a/servo/templates/accounts/register.html b/servo/templates/accounts/register.html
new file mode 100755
index 0000000..e1410ff
--- /dev/null
+++ b/servo/templates/accounts/register.html
@@ -0,0 +1,14 @@
+{% extends "login.html" %}
+{% load i18n %}
+
+{% block content %}
+ <form method="post" action="">
+ <h2>{% trans "Register" %}</h2>
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ <div class="pull-right">
+ <a href="/login/" class="btn">{% trans "Back" %}</a>
+ <button type="submit" class="btn btn-primary">{% trans "Submit" %}</button>
+ </div>
+ </form>
+{% endblock content %}
diff --git a/servo/templates/accounts/settings.html b/servo/templates/accounts/settings.html
new file mode 100755
index 0000000..a48ab19
--- /dev/null
+++ b/servo/templates/accounts/settings.html
@@ -0,0 +1,46 @@
+{% extends "accounts/orders.html" %}
+{% load i18n %}
+
+{% block first_column %}
+{% endblock first_column %}
+
+{% block second_row %}
+<form action="" method="post" accept-charset="utf-8" class="form-horizontal" enctype="multipart/form-data">{% csrf_token %}
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "Profile" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Locale" %}</a></li>
+ <li><a href="#tab3" data-toggle="tab">{% trans "Password" %}</a></li>
+ <li><a href="#tab4" data-toggle="tab">{% trans "GSX" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ {% include "form_field_snippet.html" with field=form.location %}
+ {% include "form_field_snippet.html" with field=form.queues %}
+ {% include "form_field_snippet.html" with field=form.should_notify %}
+ {% include "form_field_snippet.html" with field=form.notify_by_email %}
+ {% include "form_field_snippet.html" with field=form.autoprint %}
+ {% include "form_field_snippet.html" with field=form.photo %}
+ </div>
+ <div class="tab-pane" id="tab2">
+ {% include "form_field_snippet.html" with field=form.locale %}
+ {% include "form_field_snippet.html" with field=form.region %}
+ {% include "form_field_snippet.html" with field=form.timezone %}
+ </div>
+ <div class="tab-pane" id="tab3">
+ {% include "form_field_snippet.html" with field=form.password1 %}
+ {% include "form_field_snippet.html" with field=form.password2 %}
+ </div>
+ <div class="tab-pane" id="tab4">
+ {% include "form_field_snippet.html" with field=form.tech_id %}
+ {% include "form_field_snippet.html" with field=form.gsx_userid %}
+ {% include "form_field_snippet.html" with field=form.gsx_password %}
+ {% include "form_field_snippet.html" with field=form.gsx_poprefix %}
+ </div>
+ </div>
+ {% include "form_buttons.html" %}
+</form>
+{% endblock second_row %}
+
+{% block crumbs %}
+ <li class="active">{% trans "Settings" %}</li>
+{% endblock crumbs %}
diff --git a/servo/templates/accounts/stats.html b/servo/templates/accounts/stats.html
new file mode 100755
index 0000000..d56e1a5
--- /dev/null
+++ b/servo/templates/accounts/stats.html
@@ -0,0 +1,42 @@
+{% extends "accounts/orders.html" %}
+{% load i18n %}
+
+{% block second_row %}
+<div class="row-fluid">
+ <div class="span12 well">
+ {% block filter_block %}
+ <form action="#" method="post" class="form-inline" id="stats-form">
+ {% csrf_token %}
+ {% for field in form %}
+ <div class="control-group pull-left">
+ <label class="control-label">{{ field.label }}</label>
+ <div class="controls">{{ field }}</div>
+ </div>
+ {% endfor %}
+ <div class="control-group">
+ <label class="control-label">&nbsp;</label>
+ <div class="controls">
+ <button class="btn btn-primary pull-right" type="submit"><i class="icon-search icon-white"></i> {% trans "Search" %}</button>
+ </div>
+ </div>
+ </form>
+ {% endblock filter_block %}
+ </div>
+</div>
+
+<div class="resizable">
+ <h2>{% trans "Runrate" %}</h2>
+ <p>{% trans "Shows you how many you've been assigned to during the selected period, averaged over the time scale." %}</p>
+ <div class="plot" data-source="/stats/data/runrate/personal/"></div>
+ <div class="legend-container"></div>
+</div>
+{% endblock second_row %}
+
+{% block media %}
+<script src="{{ STATIC_URL }}js/flot/jquery.flot.min.js"></script>
+<script src="{{ STATIC_URL }}js/flot/jquery.flot.time.min.js"></script>
+<script src="{{ STATIC_URL }}js/flot/jquery.flot.pie.min.js"></script>
+<script src="{{ STATIC_URL }}js/flot/jquery.flot.resize.min.js"></script>
+<script src="{{ STATIC_URL }}js/jquery.flot.tooltip.min.js"></script>
+<script src="{{ STATIC_URL }}js/stats.js" type="text/javascript"></script>
+{% endblock media %}
diff --git a/servo/templates/accounts/tabs.html b/servo/templates/accounts/tabs.html
new file mode 100755
index 0000000..4444ab8
--- /dev/null
+++ b/servo/templates/accounts/tabs.html
@@ -0,0 +1,22 @@
+{% load i18n %}
+{% load servo_tags %}
+
+<ul class="nav nav-tabs">
+{% with request.user.username as username %}
+ <li class="{% active request "orders" %}">
+ <a href="{% url 'accounts-list_orders' username=username %}">{% trans "Orders" %}</a>
+ </li>
+ <li class="{% active request "updates" %}">
+ <a href="{% url 'accounts-updates' username=username %}">{% trans "Updates" %}</a>
+ </li>
+ <li class="{% active request "calendars" %}">
+ <a href="{% url 'calendars-list' username=username %}">{% trans "Calendars" %}</a>
+ </li>
+ <li class="{% active request "stats" %}">
+ <a href="{% url 'accounts-stats' username=username %}">{% trans "Statistics" %}</a>
+ </li>
+ <li class="{% active request "settings" %}">
+ <a href="{% url 'accounts-settings' username=username %}">{% trans "Settings" %}</a>
+ </li>
+{% endwith %}
+</ul>
diff --git a/servo/templates/accounts/updates.html b/servo/templates/accounts/updates.html
new file mode 100644
index 0000000..121aea9
--- /dev/null
+++ b/servo/templates/accounts/updates.html
@@ -0,0 +1,65 @@
+{% extends "default.html" %}
+{% load humanize %}
+{% load i18n %}
+
+{% block toolbar %}
+{% if perms.servo.add_order %}
+ <a href="{% url 'accounts-clear_notifications' request.user.username %}?t={% now "Y/m/d/H/i" %}" class="btn"><i class="icon-ok"></i> {% trans "Clear all" %}</a>
+{% endif %}
+{% endblock toolbar %}
+
+{% block content %}
+<div class="page-header clearfix">
+ <div class="pull-left">
+ <h2><i class="glyphicons-icon home"></i> {{ title }}<br/><small style="margin-left:60px">{{ subtitle }}</small></h2>
+ </div>
+</div>
+<div class="row-fluid">
+ <div class="span12">
+ {% include "accounts/tabs.html" %}
+ </div>
+</div>
+{% block second_row %}
+<div class="row-fluid">
+ <div class="span3">
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Updates" %}</li>
+ <li {% if kind == 'note_added' %}class="active"{% endif %}><a href="?kind=note_added">{% trans "Messages" %}</a></li>
+ <li {% if kind == 'set_status' %}class="active"{% endif %}><a href="?kind=set_status">{% trans "Statuses" %}</a></li>
+ </ul>
+ </div>
+ <div class="span9">
+ <table class="table">
+ <thead>
+ <tr>
+ <th style="width:25px"></th>
+ <th>{% trans "Event" %}</th>
+ <th style="width:100px">{% trans "Order" %}</th>
+ <th style="width:150px"></th>
+ <th style="width:24px"></th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for event in events %}
+ <tr>
+ <td><img src="{{ STATIC_URL }}images/{{ event.get_icon }}.png" alt="{{ event.description }}" class="icon"/></td>
+ <td>{{ event.description }}</td>
+ <td><a href="{{ event.content_object.get_absolute_url }}">{{ event.content_object }}</a></td>
+ <td style="text-align:right">{{ event.triggered_by }}<br/>
+ <small class="muted">{{ event.triggered_at|naturaltime }}</small></td>
+ <td><a class="btn {% if event.handled_at %}disabled{% endif %}" href="{% url 'events-ack_event' event.pk %}?return=0"><i class="icon-ok"></i></a></td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% include "pagination.html" with items=events %}
+ </div>
+</div>
+
+{% endblock second_row %}
+
+{% endblock content %}
+
+{% block crumbs %}
+<li class="active">{% trans "Updates" %}</li>
+{% endblock crumbs %}
diff --git a/servo/templates/accounts/view_calendar.html b/servo/templates/accounts/view_calendar.html
new file mode 100755
index 0000000..2b063e2
--- /dev/null
+++ b/servo/templates/accounts/view_calendar.html
@@ -0,0 +1,66 @@
+{% extends "accounts/calendars.html" %}
+{% load i18n %}
+{% load servo_tags %}
+
+{% block detail_view %}
+
+<div class="text-center">
+{% block view_block %}
+<div class="btn-group">
+ <a class="btn {% active request 'day' %}" href="{{ calendar.get_absolute_url }}day/">{% trans "Day" %}</a>
+ <a class="btn {% active request 'week' %}" href="{{ calendar.get_absolute_url }}week/">{% trans "Week" %}</a>
+ <a class="btn {% active request 'month' %}" href="{{ calendar.get_absolute_url }}month/">{% trans "Month" %}</a>
+</div>
+{% endblock view_block %}
+
+{% block browse_block %}
+<div class="btn-group pull-right">
+ <a href="{% url 'calendars-view_calendar' username=request.user.username pk=calendar.pk view=view start_date=previous|date:'Y-m-d' %}" class="btn"><i class="icon-chevron-left"></i></a>
+ <a href="{{ base_url }}" class="btn">{% trans "Today" %}</a>
+ <a href="{% url 'calendars-view_calendar' username=request.user.username pk=calendar.pk view=view start_date=next|date:'Y-m-d' %}" class="btn"><i class="icon-chevron-right"></i></a>
+</div>
+{% endblock browse_block %}
+</div>
+
+<table class="table">
+ <thead>
+ <tr>
+ <th>{% trans "Date" %}</th>
+ <th>{% trans "Started At" %}</th>
+ <th>{% trans "Finished At" %}</th>
+ <th>{% trans "Duration" %}</th>
+ <th>{% trans "Notes" %}</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for i in events %}
+ <tr>
+ <td>{% ifchanged i.started_at|date %}{{ i.started_at|date:"SHORT_DATE_FORMAT" }}{% endifchanged %}</td>
+ <td>{{ i.started_at|time:"TIME_FORMAT" }}</td>
+ <td>{{ i.finished_at|time:"TIME_FORMAT"|default:"-" }}</td>
+ <td>{{ i.get_duration }}</td>
+ <td>{{ i.notes|default:'' }}</td>
+ <td style="text-align:right">
+ <div class="btn-group">
+ {% if i.finished_at %}
+ <a href="" class="btn disabled"><i class="icon-time"></i></a>
+ {% else %}
+ <a href="{{ calendar.get_absolute_url }}events/{{ i.pk }}/finish/" class="btn"><i class="icon-time"></i></a>
+ {% endif %}
+ <a href="{{ calendar.get_absolute_url }}events/{{ i.pk }}/edit/" class="btn btn-warning"><i class="icon-pencil icon-white"></i></a>
+ <a href="{{ calendar.get_absolute_url }}events/{{ i.pk }}/delete/" class="btn btn-danger" data-modal="#modal"><i class="icon-trash icon-white"></i></a>
+ </div>
+ </td>
+ </tr>
+ {% empty %}
+ <tr><td colspan="6" class="muted empty">{% trans "No events found" %}</td></tr>
+ {% endfor %}
+ </tbody>
+</table>
+{% endblock detail_view %}
+
+{% block crumbs %}
+ <li><a href="{% url 'calendars-list' username=request.user.username %}">{% trans "Calendars" %}</a> <span class="divider">/</span></li>
+ <li class="active">{{ calendar.title }}</li>
+{% endblock crumbs %}
diff --git a/servo/templates/admin/backups.html b/servo/templates/admin/backups.html
new file mode 100644
index 0000000..1670ea5
--- /dev/null
+++ b/servo/templates/admin/backups.html
@@ -0,0 +1,17 @@
+{% extends "admin/index.html" %}
+{% load i18n %}
+
+{% block second_column %}
+ <h2>{% trans "Backups" %}</h2>
+ <table class="table">
+ <tbody>
+ {% for b in backups %}
+ <tr>
+ <td>{{ b.filename }}</td>
+ <td>{{ b.filesize|filesizeformat }}</td>
+ <td><a href="?dl={{ b.filename }}" class="btn btn-default"><i class="icon-download"></i></a></td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+{% endblock second_column %}
diff --git a/servo/templates/admin/checklist/form.html b/servo/templates/admin/checklist/form.html
new file mode 100644
index 0000000..3b44576
--- /dev/null
+++ b/servo/templates/admin/checklist/form.html
@@ -0,0 +1,31 @@
+{% extends "admin/checklist/index.html" %}
+{% load i18n %}
+
+{% block third_column %}
+<form method="post" action="" accept-charset="utf-8" class="form-horizontal">
+ {% csrf_token %}
+ {{ formset.management_form }}
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "General" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Tasks" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ {% include "form_snippet.html" %}
+ </div>
+ <div class="tab-pane" id="tab2">
+ {% for f in formset %}
+ {% include "form_snippet.html" with form=f %}
+ {% endfor %}
+ </div>
+ </div>
+ <div class="form-actions">
+ {% if checklist.pk %}
+ <a class="btn btn-danger" data-modal="#modal" href="{% url 'admin-delete_checklist' checklist.pk %}">{% trans "Delete" %}</a>
+ {% else %}
+ <a class="btn btn-danger disabled">{% trans "Delete" %}</a>
+ {% endif %}
+ <button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
+ </div>
+</form>
+{% endblock third_column %}
diff --git a/servo/templates/admin/checklist/index.html b/servo/templates/admin/checklist/index.html
new file mode 100644
index 0000000..f4a2820
--- /dev/null
+++ b/servo/templates/admin/checklist/index.html
@@ -0,0 +1,6 @@
+{% extends "generic/admin_list.html" %}
+{% load i18n %}
+
+{% block toolbar %}
+ <a class="btn btn-default navbar-btn" href="{% url 'admin-create_checklist' %}"><i class="icon-plus"></i> {% trans "New Checklist" %}</a>
+{% endblock toolbar %}
diff --git a/servo/templates/admin/fields/form.html b/servo/templates/admin/fields/form.html
new file mode 100644
index 0000000..f377594
--- /dev/null
+++ b/servo/templates/admin/fields/form.html
@@ -0,0 +1,17 @@
+{% extends "admin/fields/index.html" %}
+{% load i18n %}
+
+{% block third_column %}
+ <form method="post" action="" accept-charset="utf-8" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ <div class="form-actions">
+ {% if field.pk %}
+ <a class="btn btn-danger" data-modal="#modal" href="{% url 'admin-delete_field' field.pk %}">{% trans "Delete" %}</a>
+ {% else %}
+ <a class="btn btn-danger disabled">{% trans "Delete" %}</a>
+ {% endif %}
+ <button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
+ </div>
+ </form>
+{% endblock third_column %}
diff --git a/servo/templates/admin/fields/index.html b/servo/templates/admin/fields/index.html
new file mode 100644
index 0000000..e005c75
--- /dev/null
+++ b/servo/templates/admin/fields/index.html
@@ -0,0 +1,30 @@
+{% extends "generic/admin_list.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+<a href="{% url 'admin-create_field' type=type %}" class="btn btn-default navbar-btn"><i class="icon-plus"></i> {% trans "New Field" %}</a>
+{% endblock toolbar %}
+
+{% block second_column %}
+<div class="row-fluid">
+ <ul class="nav nav-tabs">
+ {% for k, v in types %}
+ <li class="{% active request k %}"><a href="{% url 'admin-fields' type=k %}">{{ v }}</a></li>
+ {% endfor %}
+ </ul>
+</div>
+<div class="row-fluid">
+ <div class="span3">
+ <ul class="nav nav-pills nav-stacked">
+ {% for o in object_list %}
+ <li class="{% active_url request o.get_admin_url %}"><a href="{{ o.get_admin_url }}">{{ o.title|truncatechars:25 }}</a></li>
+ {% endfor %}
+ </ul>
+ </div>
+ <div class="span9">
+ {% block third_column %}
+ {% endblock third_column %}
+ </div>
+</div>
+{% endblock second_column %}
diff --git a/servo/templates/admin/fields/remove.html b/servo/templates/admin/fields/remove.html
new file mode 100644
index 0000000..04c2c93
--- /dev/null
+++ b/servo/templates/admin/fields/remove.html
@@ -0,0 +1,8 @@
+{% load i18n %}
+<form action="/fields/remove/" method="post" accept-charset="utf-8" rel="fields">
+ {% csrf_token %}
+ <input type="hidden" name="id" value="{{ id }}" />
+ <img src="/static/images/alert_48.png" alt="alert" class="alert" />
+ <h2>{% trans "Are you sure you want to delete this field?" %}</h2>
+ <p>{% trans "This action cannot be undone." %}</p>
+</form>
diff --git a/servo/templates/admin/gsx/form.html b/servo/templates/admin/gsx/form.html
new file mode 100755
index 0000000..b154d5d
--- /dev/null
+++ b/servo/templates/admin/gsx/form.html
@@ -0,0 +1,20 @@
+{% extends "admin/gsx/index.html" %}
+{% load i18n %}
+
+{% block third_column %}
+<ul class="nav nav-tabs">
+ <li class="active"><a href="#" data-toggle="tab">{% trans "General" %}</a></li>
+</ul>
+<form method="post" action="" accept-charset="utf-8" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ <div class="form-actions">
+ {% if act.pk %}
+ <a class="btn btn-danger" data-modal="#modal" href="{% url 'admin-delete_gsx_account' act.pk %}">{% trans "Delete" %}</a>
+ {% else %}
+ <a class="btn btn-danger disabled">{% trans "Delete" %}</a>
+ {% endif %}
+ <button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
+ </div>
+</form>
+{% endblock third_column %}
diff --git a/servo/templates/admin/gsx/index.html b/servo/templates/admin/gsx/index.html
new file mode 100755
index 0000000..f137e29
--- /dev/null
+++ b/servo/templates/admin/gsx/index.html
@@ -0,0 +1,6 @@
+{% extends "generic/admin_list.html" %}
+{% load i18n %}
+
+{% block toolbar %}
+ <a href="{% url 'admin-edit_gsx_account' %}" class="btn btn-default navbar-btn"><i class="icon-plus"></i> {% trans "New Account" %}</a>
+{% endblock toolbar %}
diff --git a/servo/templates/admin/gsx/remove.html b/servo/templates/admin/gsx/remove.html
new file mode 100755
index 0000000..184e154
--- /dev/null
+++ b/servo/templates/admin/gsx/remove.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Remove GSX account" %}?
+{% endblock header %}
+
+{% block footer %}
+ <form action="{{ action }}" method="post" accept-charset="utf-8">
+ {% csrf_token %}
+ <button class="btn btn-danger" type="submit">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/admin/index.html b/servo/templates/admin/index.html
new file mode 100644
index 0000000..e982e28
--- /dev/null
+++ b/servo/templates/admin/index.html
@@ -0,0 +1,50 @@
+{% extends "two_column_layout.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block first_column %}
+<ul class="nav nav-list">
+ <li class="nav-header">{% trans "System Settings" %}</li>
+ <li class="{% active request "settings" %}">
+ <a href="{% url 'admin-settings' %}"><i class="icon-cog"></i> {% trans "Settings" %}</a>
+ </li>
+ <li class="{% active request "gsx" %}">
+ <a href="{% url 'admin-list_gsx_accounts' %}"><i class="icon-globe"></i> {% trans "GSX Accounts" %}</a>
+ </li>
+ <li class="{% active request "locations" %}">
+ <a href="{% url 'admin-locations' %}"><i class="icon-map-marker"></i> {% trans "Locations" %}</a>
+ </li>
+ <li class="{% active request "statuses" %}">
+ <a href="{% url 'admin-statuses' %}"><i class="icon-tasks"></i> {% trans "Statuses" %}</a>
+ </li>
+ <li class="{% active request "queues" %}">
+ <a href="{% url 'admin-queues' %}"><i class="icon-inbox"></i> {% trans "Queues" %}</a>
+ </li>
+ <li class="{% active request "(users)|(groups)" %}">
+ <a href="{% url 'admin-list_users' %}"><i class="icon-user"></i> {% trans "Users & Groups" %}</a>
+ </li>
+ <li class="{% active request "fields" %}">
+ <a href="{% url 'admin-fields' type='customer' %}"><i class="icon-list-alt"></i> {% trans "Fields" %}</a>
+ </li>
+ <li class="{% active request "tags" %}">
+ <a href="{% url 'admin-tags' type='device' %}"><i class="icon-tags"></i> {% trans "Tags" %}</a>
+ </li>
+ <li class="{% active request "templates" %}">
+ <a href="{% url 'admin-list_templates' %}"><i class="icon-file"></i> {% trans "Templates" %}</a>
+ </li>
+ <li class="{% active request "checklists" %}">
+ <a href="{% url 'admin-checklists' %}"><i class="icon-cog"></i> {% trans "Checklists" %}</a>
+ </li>
+ <li class="{% active request "backups" %}">
+ <a href="{% url 'admin-backups' %}"><i class="icon-download"></i> {% trans "Backups" %}</a>
+ </li>
+</ul>
+{% endblock first_column %}
+
+{% block second_column %}
+
+{% endblock second_column %}
+
+{% block crumbs %}
+ <li class="active">{% trans "Systen Settings" %}</li>
+{% endblock crumbs %}
diff --git a/servo/templates/admin/inventory/index.html b/servo/templates/admin/inventory/index.html
new file mode 100644
index 0000000..ef31079
--- /dev/null
+++ b/servo/templates/admin/inventory/index.html
@@ -0,0 +1,18 @@
+{% extends "admin/index.html" %}
+{% load i18n %}
+
+{% block second_column %}
+<form method="post" accept-charset="utf-8" action="" class="form-horizontal">
+ {% csrf_token %}
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "Stock" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Categories" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ </div>
+ <div class="tab-pane" id="tab2">
+ </div>
+ </div>
+</form>
+{% endblock second_column %}
diff --git a/servo/templates/admin/locations/form.html b/servo/templates/admin/locations/form.html
new file mode 100644
index 0000000..777c9ab
--- /dev/null
+++ b/servo/templates/admin/locations/form.html
@@ -0,0 +1,40 @@
+{% extends "admin/locations/index.html" %}
+{% load i18n %}
+
+{% block third_column %}
+<ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "General" %}</a></li>
+ <li><a href="#tab3" data-toggle="tab">{% trans "GSX" %}</a></li>
+</ul>
+
+<form method="post" action="" accept-charset="utf-8" enctype="multipart/form-data" class="form-horizontal">
+ {% csrf_token %}
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ {% include "form_field_snippet.html" with field=form.title %}
+ {% include "form_field_snippet.html" with field=form.email %}
+ {% include "form_field_snippet.html" with field=form.phone %}
+ {% include "form_field_snippet.html" with field=form.address %}
+ {% include "form_field_snippet.html" with field=form.zip_code %}
+ {% include "form_field_snippet.html" with field=form.city %}
+ {% include "form_field_snippet.html" with field=form.timezone %}
+ {% include "form_field_snippet.html" with field=form.notes %}
+ {% include "form_field_snippet.html" with field=form.logo %}
+ {% include "form_field_snippet.html" with field=form.enabled %}
+ </div>
+ <div class="tab-pane" id="tab3">
+ {% include "form_field_snippet.html" with field=form.gsx_shipto %}
+ {% include "form_field_snippet.html" with field=form.gsx_accounts %}
+ {% include "form_field_snippet.html" with field=form.gsx_tz %}
+ </div>
+ </div>
+ <div class="form-actions">
+ {% if location.pk %}
+ <a class="btn btn-danger" data-modal="#modal" href="{% url 'admin-delete_location' location.pk %}">{% trans "Delete" %}</a>
+ {% else %}
+ <a class="btn btn-danger disabled">{% trans "Delete" %}</a>
+ {% endif %}
+ <button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
+ </div>
+</form>
+{% endblock third_column %}
diff --git a/servo/templates/admin/locations/index.html b/servo/templates/admin/locations/index.html
new file mode 100644
index 0000000..92fe940
--- /dev/null
+++ b/servo/templates/admin/locations/index.html
@@ -0,0 +1,6 @@
+{% extends "generic/admin_list.html" %}
+{% load i18n %}
+
+{% block toolbar %}
+ <a href="{% url 'admin-create_location' %}" class="btn btn-default navbar-btn"><i class="icon-plus"></i> {% trans "New Location" %}</a>
+{% endblock toolbar %}
diff --git a/servo/templates/admin/notifications/form.html b/servo/templates/admin/notifications/form.html
new file mode 100644
index 0000000..ce4a8f9
--- /dev/null
+++ b/servo/templates/admin/notifications/form.html
@@ -0,0 +1,5 @@
+{% extends "admin/index.html" %}
+
+{% block admin_content %}
+
+{% endblock admin_content %}
diff --git a/servo/templates/admin/notifications/index.html b/servo/templates/admin/notifications/index.html
new file mode 100644
index 0000000..1fd05a0
--- /dev/null
+++ b/servo/templates/admin/notifications/index.html
@@ -0,0 +1,39 @@
+{% extends "admin/index.html" %}
+{% load i18n %}
+
+{% block second_column %}
+<ul class="nav nav-tabs">
+ <li class="active"><a href="#">{% trans "Reports" %}</a></li>
+</ul>
+
+<form method="post" action="">
+ {% csrf_token %}
+ <table class="table">
+ <thead>
+ <tr>
+ <th></th>
+ <th>{% trans "Daily" %}</th>
+ <th>{% trans "Weekly" %}</th>
+ <th>{% trans "Monthly" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{% trans "Repairs aging beyond limits" %}</td>
+ <td><input type="checkbox"/></td>
+ <td><input type="checkbox"/></td>
+ <td><input type="checkbox"/></td>
+ </tr>
+ <tr>
+ <td>{% trans "Products below stocking limit" %}</td>
+ <td><input type="checkbox"/></td>
+ <td><input type="checkbox"/></td>
+ <td><input type="checkbox"/></td>
+ </tr>
+ </tbody>
+ </table>
+ <div class="form-actions">
+ <button type="submit" class="btn btn-primary pull-right">{% trans "Save" %}</button>
+ </div>
+</form>
+{% endblock second_column %}
diff --git a/servo/templates/admin/queues/form.html b/servo/templates/admin/queues/form.html
new file mode 100644
index 0000000..119275a
--- /dev/null
+++ b/servo/templates/admin/queues/form.html
@@ -0,0 +1,81 @@
+{% extends "admin/queues/index.html" %}
+{% load i18n %}
+
+{% block third_column %}
+<form method="post" action="" accept-charset="utf-8" class="form-horizontal" enctype="multipart/form-data">
+ {% csrf_token %}
+ {{ formset.management_form }}
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "General" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Statuses" %}</a></li>
+ <li><a href="#tab5" data-toggle="tab">{% trans "Defaults" %}</a></li>
+ <li><a href="#tab3" data-toggle="tab">{% trans "GSX" %}</a></li>
+ <li><a href="#tab4" data-toggle="tab">{% trans "Templates" %}</a></li>
+ <li><a href="#tab6" data-toggle="tab">{% trans "Users" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ {% include "form_field_snippet.html" with field=form.title %}
+ {% include "form_field_snippet.html" with field=form.priority %}
+ {% include "form_field_snippet.html" with field=form.description %}
+ <!--{% include "form_field_snippet.html" with field=form.keywords %}//-->
+ {% include "form_field_snippet.html" with field=form.locations %}
+ </div>
+ <div class="tab-pane" id="tab2">
+ <table class="table table-condensed" id="table-queue-status">
+ <thead>
+ <tr>
+ <th>{% trans "Status" %}</th>
+ <th colspan="3">{% trans "Time limits" %}</th>
+ <th style="width:30px" class="text-center">{% trans "Delete" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for form in formset %}
+ <tr class="form">
+ {% for field in form %}
+ {% if field.is_hidden %}
+ {{ field }}
+ {% else %}
+ <td>{{ field }}</td>
+ {% endif %}
+ {% endfor %}
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ <a class="btn" id="add_more"><i class="icon-plus"></i> {% trans "Add Status" %}</a>
+ </div>
+ <div class="tab-pane" id="tab5">
+ {% include "form_field_snippet.html" with field=form.status_created %}
+ {% include "form_field_snippet.html" with field=form.status_assigned %}
+ {% include "form_field_snippet.html" with field=form.status_products_ordered %}
+ {% include "form_field_snippet.html" with field=form.status_products_received %}
+ {% include "form_field_snippet.html" with field=form.status_repair_completed %}
+ {% include "form_field_snippet.html" with field=form.status_dispatched %}
+ {% include "form_field_snippet.html" with field=form.status_closed %}
+ </div>
+ <div class="tab-pane" id="tab3">
+ {% include "form_field_snippet.html" with field=form.gsx_soldto %}
+ </div>
+ <div class="tab-pane" id="tab4">
+ {% include "form_field_snippet.html" with field=form.order_template %}
+ {% include "form_field_snippet.html" with field=form.quote_template %}
+ {% include "form_field_snippet.html" with field=form.receipt_template %}
+ {% include "form_field_snippet.html" with field=form.dispatch_template %}
+ </div>
+ <div class="tab-pane" id="tab6">
+ {% include "form_field_snippet.html" with field=form.users %}
+ </div>
+ </div>
+ {% include "form_buttons.html" %}
+</form>
+{% endblock third_column %}
+
+{% block media %}
+<script type="text/javascript">
+ $('#add_more').click(function() {
+ cloneMore('tr.form:last', 'queuestatus_set', true);
+ });
+</script>
+{% endblock media %}
diff --git a/servo/templates/admin/queues/index.html b/servo/templates/admin/queues/index.html
new file mode 100644
index 0000000..d161dbb
--- /dev/null
+++ b/servo/templates/admin/queues/index.html
@@ -0,0 +1,6 @@
+{% extends "generic/admin_list.html" %}
+{% load i18n %}
+
+{% block toolbar %}
+ <a href="{% url 'admin-create_queue' %}" class="btn btn-default navbar-btn"><i class="icon-plus"></i> {% trans "New Queue" %}</a>
+{% endblock toolbar %}
diff --git a/servo/templates/admin/queues/remove.html b/servo/templates/admin/queues/remove.html
new file mode 100644
index 0000000..125f89e
--- /dev/null
+++ b/servo/templates/admin/queues/remove.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% blocktrans with queue.title as title %}Delete queue "{{ title }}"?{% endblocktrans %}
+{% endblock header %}
+
+{% block body %}
+ <p>{% trans "Orders in this queue will not be deleted." %}</p>
+{% endblock body %}
+
+{% block footer %}
+ <form action="{% url 'admin-delete_queue' queue.pk %}" method="post">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/admin/settings.html b/servo/templates/admin/settings.html
new file mode 100644
index 0000000..15266b7
--- /dev/null
+++ b/servo/templates/admin/settings.html
@@ -0,0 +1,136 @@
+{% extends "admin/index.html" %}
+{% load i18n %}
+
+{% block second_column %}
+<form method="post" accept-charset="utf-8" action="" enctype="multipart/form-data" class="form-horizontal">
+ {% csrf_token %}
+<!--
+ {{ formset.management_form }}
+//-->
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "General" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Stock" %}</a></li>
+ <li><a href="#tab3" data-toggle="tab">{% trans "Outgoing Mail" %}</a></li>
+ <li><a href="#tab4" data-toggle="tab">{% trans "Incoming Mail" %}</a></li>
+ <li><a href="#tab5" data-toggle="tab">{% trans "Text Messages" %}</a></li>
+ <li><a href="#tab6" data-toggle="tab">{% trans "Check-in" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ {% include "form_field_snippet.html" with field=form.company_name %}
+ {% include "form_field_snippet.html" with field=form.company_logo %}
+ {% include "form_field_snippet.html" with field=form.gsx_account %}
+ {% include "form_field_snippet.html" with field=form.terms_of_service %}
+ {% include "form_field_snippet.html" with field=form.autocomplete_repairs %}
+ </div>
+ <div class="tab-pane" id="tab2">
+ {% include "form_field_snippet.html" with field=form.currency %}
+ {% include "form_field_snippet.html" with field=form.pct_margin %}
+ {% include "form_field_snippet.html" with field=form.pct_vat %}
+ {% include "form_field_snippet.html" with field=form.shipping_cost %}
+ {% include "form_field_snippet.html" with field=form.track_inventory %}
+ <div class="control-group">
+ <div class="controls">
+ <label class="checkbox">
+ <input name="update_prices" type="checkbox" value="1"/> {% trans "Update prices" %}
+ </label>
+ <span class="help-block">{% trans "Applies the new settings to existing products after saving" %}</span>
+ </div>
+ </div>
+ </div>
+ <div class="tab-pane" id="tab3">
+ <fieldset>
+ {% include "form_field_snippet.html" with field=form.default_sender %}
+ {% include "form_field_snippet.html" with field=form.default_sender_custom %}
+ {% include "form_field_snippet.html" with field=form.default_subject %}
+ {% include "form_field_snippet.html" with field=form.smtp_host %}
+ {% include "form_field_snippet.html" with field=form.smtp_user %}
+ {% include "form_field_snippet.html" with field=form.smtp_password %}
+ {% include "form_field_snippet.html" with field=form.smtp_ssl %}
+ </fieldset>
+ <fieldset>
+ <legend>{% trans "Notifications" %}</legend>
+ {% include "form_field_snippet.html" with field=form.notify_address %}
+ {% include "form_field_snippet.html" with field=form.notify_location %}
+ </fieldset>
+ </div>
+ <div class="tab-pane" id="tab4">
+ {% include "form_field_snippet.html" with field=form.imap_act %}
+ {% include "form_field_snippet.html" with field=form.imap_host %}
+ {% include "form_field_snippet.html" with field=form.imap_user %}
+ {% include "form_field_snippet.html" with field=form.imap_password %}
+ {% include "form_field_snippet.html" with field=form.imap_ssl %}
+ </div>
+ <div class="tab-pane" id="tab5">
+ {% include "form_field_snippet.html" with field=form.sms_gateway %}
+ {% if config.sms_gateway == 'builtin' %}
+ <p class="text-muted text-center">{% trans "Sending SMS messages will be handled by Servo" %}</p>
+ {% endif %}
+ {% if config.sms_gateway == 'http' %}
+ {% include "form_field_snippet.html" with field=form.sms_http_url %}
+ {% include "form_field_snippet.html" with field=form.sms_http_user %}
+ {% include "form_field_snippet.html" with field=form.sms_http_password %}
+ {% endif %}
+ {% if config.sms_gateway == 'smtp' %}
+ {% include "form_field_snippet.html" with field=form.sms_smtp_address %}
+ {% endif %}
+ {% if config.sms_gateway == 'jazz' %}
+ {% include "form_field_snippet.html" with field=form.sms_http_user %}
+ {% include "form_field_snippet.html" with field=form.sms_http_password %}
+ {% include "form_field_snippet.html" with field=form.sms_http_sender %}
+ {% endif %}
+ {% if config.sms_gateway == 'hqsms' %}
+ {% include "form_field_snippet.html" with field=form.sms_http_user %}
+ {% include "form_field_snippet.html" with field=form.sms_http_password %}
+ {% include "form_field_snippet.html" with field=form.sms_http_sender %}
+ {% endif %}
+ </div>
+ <div class="tab-pane" id="tab6">
+ {% include "form_field_snippet.html" with field=form.checkin_user %}
+ {% include "form_field_snippet.html" with field=form.checkin_group %}
+ {% include "form_field_snippet.html" with field=form.checkin_queue %}
+ {% include "form_field_snippet.html" with field=form.checkin_checklist %}
+ {% include "form_field_snippet.html" with field=form.checkin_password %}
+ {% include "form_field_snippet.html" with field=form.checkin_require_password %}
+ {% include "form_field_snippet.html" with field=form.checkin_require_condition %}
+ {% include "form_field_snippet.html" with field=form.checkin_report_checklist %}
+ {% include "form_field_snippet.html" with field=form.checkin_timeline %}
+<!--
+ <fieldset>
+ <legend>{% trans "Shipping Methods" %}</legend>
+ {% for f in formset %}
+ <div class="form">
+ {% include "form_snippet.html" with form=f %}
+ </div>
+ {% endfor %}
+ </fieldset>
+ <a class="btn" id="add_more"><i class="icon-plus"></i> {% trans "Add Method" %}</a>
+//-->
+ </div>
+ </div>
+ <div class="form-actions">
+ <button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
+ </div>
+</form>
+{% endblock second_column %}
+
+{% block media %}
+<script type="text/javascript">
+ $(function(){
+ $('#id_default_sender').change(function(){
+ if( $(this).val() == 'custom' ) {
+ $('#id_default_sender_custom').attr('disabled', false);
+ $('#id_default_sender_custom').focus();
+ } else {
+ $('#id_default_sender_custom').attr('disabled', true);
+ }
+ });
+ $('#id_default_sender').trigger('change');
+
+ $('#add_more').click(function() {
+ cloneMore('div.form:last', 'form', false);
+ });
+
+ });
+</script>
+{% endblock media %}
diff --git a/servo/templates/admin/sites/edit_site.html b/servo/templates/admin/sites/edit_site.html
new file mode 100644
index 0000000..5c0004a
--- /dev/null
+++ b/servo/templates/admin/sites/edit_site.html
@@ -0,0 +1,9 @@
+{% extends "admin/sites/index.html" %}
+
+{% block detail_block %}
+ <form method="post" action="" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ {% include "form_buttons.html" %}
+ </form>
+{% endblock detail_block %}
diff --git a/servo/templates/admin/sites/index.html b/servo/templates/admin/sites/index.html
new file mode 100644
index 0000000..4cf96f3
--- /dev/null
+++ b/servo/templates/admin/sites/index.html
@@ -0,0 +1,23 @@
+{% extends "admin/index.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+ <a href="{% url 'admin-create_site' %}" class="btn btn-inverse"><i class="fa fa-plus icon-white"></i> {% trans "New Site" %}</a>
+{% endblock toolbar %}
+
+{% block second_column %}
+<div class="span3">
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Sites" %}</li>
+ {% for i in sites %}
+ <li class="{% active request "sites" i.pk %}"><a href="{% url 'admin-edit_site' i.pk %}">{{ i.name }}</a></li>
+ {% endfor %}
+ </ul>
+</div>
+<div class="span9">
+ {% block detail_block %}
+ <h1 class="text-muted">{% trans "No site selected" %}</h1>
+ {% endblock detail_block %}
+</div>
+{% endblock second_column %}
diff --git a/servo/templates/admin/statuses/form.html b/servo/templates/admin/statuses/form.html
new file mode 100644
index 0000000..7998ddf
--- /dev/null
+++ b/servo/templates/admin/statuses/form.html
@@ -0,0 +1,21 @@
+{% extends "admin/statuses/index.html" %}
+{% load i18n %}
+
+{% block third_column %}
+<ul class="nav nav-tabs">
+ <li class="active"><a href="#" data-toggle="tab">{% trans "General" %}</a></li>
+</ul>
+
+<form method="post" action="" accept-charset="utf-8" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ <div class="form-actions">
+ {% if status.pk %}
+ <a class="btn btn-danger" data-modal="#modal" href="{% url 'admin-delete_status' status.pk %}">{% trans "Delete" %}</a>
+ {% else %}
+ <a class="btn btn-danger disabled">{% trans "Delete" %}</a>
+ {% endif %}
+ <button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
+ </div>
+</form>
+{% endblock third_column %}
diff --git a/servo/templates/admin/statuses/index.html b/servo/templates/admin/statuses/index.html
new file mode 100644
index 0000000..01df5fa
--- /dev/null
+++ b/servo/templates/admin/statuses/index.html
@@ -0,0 +1,6 @@
+{% extends "generic/admin_list.html" %}
+{% load i18n %}
+
+{% block toolbar %}
+ <a href="{% url 'admin-create_status' %}" class="btn btn-default navbar-btn"><i class="icon-plus"></i> {% trans "New Status" %}</a>
+{% endblock toolbar %}
diff --git a/servo/templates/admin/statuses/remove.html b/servo/templates/admin/statuses/remove.html
new file mode 100644
index 0000000..78385a6
--- /dev/null
+++ b/servo/templates/admin/statuses/remove.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ <h2>{% blocktrans with status.title as title %}Delete status "{{ title }}"?{% endblocktrans %}</h2>
+{% endblock header %}
+
+{% block body %}
+ <p>{% trans "This action cannot be undone." %}</p>
+{% endblock body %}
+
+{% block footer %}
+ <form action="{{ action }}" method="post">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/admin/tags/form.html b/servo/templates/admin/tags/form.html
new file mode 100644
index 0000000..8f6d975
--- /dev/null
+++ b/servo/templates/admin/tags/form.html
@@ -0,0 +1,17 @@
+{% extends "admin/tags/index.html" %}
+{% load i18n %}
+
+{% block third_column %}
+<form action="" method="post" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ <div class="form-actions">
+ {% if tag.pk %}
+ <a class="btn btn-danger" data-modal="#modal" href="{% url 'admin-delete_tag' tag.pk %}">{% trans "Delete" %}</a>
+ {% else %}
+ <a class="btn btn-danger disabled">{% trans "Delete" %}</a>
+ {% endif %}
+ <button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
+ </div>
+</form>
+{% endblock third_column %}
diff --git a/servo/templates/admin/tags/index.html b/servo/templates/admin/tags/index.html
new file mode 100644
index 0000000..26ff6bd
--- /dev/null
+++ b/servo/templates/admin/tags/index.html
@@ -0,0 +1,37 @@
+{% extends "generic/admin_list.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+<a href="{% url 'admin-create_tag' type=type %}" class="btn btn-default navbar-btn"><i class="icon-plus"></i> {% trans "New Tag" %}</a>
+{% endblock toolbar %}
+
+{% block second_column %}
+
+<div class="row">
+ <ul class="nav nav-tabs">
+ {% for k, v in types %}
+ <li {% if k == type %} class="active"{% endif %}><a href="{% url 'admin-tags' type=k %}">{{ v }}</a></li>
+ {% endfor %}
+ </ul>
+</div>
+
+<div class="row">
+ <div class="span5">
+ <ul class="nav nav-pills nav-stacked">
+ {% for o in object_list %}
+ <li class="{% active_url request o.get_admin_url %}"><a href="{{ o.get_admin_url }}">{{ o.title }}</a></li>
+ {% empty %}
+ <li class="empty">{% blocktrans with objects=title %}No {{ objects }} found.{% endblocktrans %}</li>
+ {% endfor %}
+ </ul>
+ </div>
+ <div class="span7">
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "General" %}</a></li>
+ </ul>
+ {% block third_column %}
+ {% endblock third_column %}
+ </div>
+</div>
+{% endblock second_column %}
diff --git a/servo/templates/admin/templates/form.html b/servo/templates/admin/templates/form.html
new file mode 100644
index 0000000..a55803a
--- /dev/null
+++ b/servo/templates/admin/templates/form.html
@@ -0,0 +1,21 @@
+{% extends "admin/templates/list_templates.html" %}
+{% load i18n %}
+
+{% block third_column %}
+<ul class="nav nav-tabs">
+ <li class="active"><a href="#" data-toggle="tab">{% trans "General" %}</a></li>
+</ul>
+
+<form method="post" action="" accept-charset="utf-8" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ <div class="form-actions">
+ {% if template.pk %}
+ <a class="btn btn-danger" data-modal="#modal" href="{% url 'admin-delete_template' template.pk %}">{% trans "Delete" %}</a>
+ {% else %}
+ <a class="btn btn-danger disabled">{% trans "Delete" %}</a>
+ {% endif %}
+ <button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
+ </div>
+</form>
+{% endblock third_column %}
diff --git a/servo/templates/admin/templates/list_templates.html b/servo/templates/admin/templates/list_templates.html
new file mode 100644
index 0000000..3af70d3
--- /dev/null
+++ b/servo/templates/admin/templates/list_templates.html
@@ -0,0 +1,7 @@
+{% extends "generic/admin_list.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+ <a class="btn btn-default navbar-btn" href="{% url 'admin-edit_template' %}"><i class="icon-plus"></i> {% trans "New Template" %}</a>
+{% endblock toolbar %}
diff --git a/servo/templates/admin/users/delete_group.html b/servo/templates/admin/users/delete_group.html
new file mode 100644
index 0000000..2c733df
--- /dev/null
+++ b/servo/templates/admin/users/delete_group.html
@@ -0,0 +1,11 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}{% trans "Really delete this group?" %}{% endblock header %}
+{% block body %}{% trans "Group member accounts will not be deleted." %}{% endblock body %}
+{% block footer %}
+<form action="{{ action }}" method="post">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+</form>
+{% endblock footer %}
diff --git a/servo/templates/admin/users/form.html b/servo/templates/admin/users/form.html
new file mode 100644
index 0000000..34764ab
--- /dev/null
+++ b/servo/templates/admin/users/form.html
@@ -0,0 +1,70 @@
+{% extends "admin/users/index.html" %}
+{% load i18n %}
+
+{% block third_column %}
+<form action="" method="post" accept-charset="utf-8" class="form-horizontal">
+ {% csrf_token %}
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "General" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Permissions" %}</a></li>
+ <li><a href="#tab3" data-toggle="tab">{% trans "Location" %}</a></li>
+ <li><a href="#tab4" data-toggle="tab">{% trans "Profile" %}</a></li>
+ <li><a href="#tab5" data-toggle="tab">{% trans "GSX" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ {% include "form_field_snippet.html" with field=form.first_name %}
+ {% include "form_field_snippet.html" with field=form.last_name %}
+ {% include "form_field_snippet.html" with field=form.username %}
+ {% include "form_field_snippet.html" with field=form.email %}
+ {% include "form_field_snippet.html" with field=form.password1 %}
+ {% include "form_field_snippet.html" with field=form.password2 %}
+ {% include "form_field_snippet.html" with field=form.is_active %}
+ </div>
+ <div class="tab-pane" id="tab2">
+ {% include "form_field_snippet.html" with field=form.groups %}
+ {% include "form_field_snippet.html" with field=form.is_staff %}
+ {% include "form_field_snippet.html" with field=form.customer %}
+ <div class="control-group ">
+ <label class="control-label">{% trans "API Tokens" %}</label>
+ <div class="controls">
+ <ul style="padding:5px">
+ {% for t in user.get_tokens %}
+ <li class="muted">{{ t.key }}<a href="{% url 'admin-delete_user_token' user.pk %}"><i class="icon-trash"></i></a></li>
+ {% endfor %}
+ </ul>
+ {% if user.pk %}
+ <a class="btn btn-default btn-small" href="{% url 'admin-create_user_token' user.pk %}">{% trans "New Token" %}</a>
+ {% else %}
+ <a class="btn btn-default btn-small disabled" href="#">{% trans "New Token" %}</a>
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ <div class="tab-pane" id="tab3">
+ {% include "form_field_snippet.html" with field=form.location %}
+ {% include "form_field_snippet.html" with field=form.locations %}
+ </div>
+ <div class="tab-pane" id="tab4">
+ {% include "form_field_snippet.html" with field=form.locale %}
+ {% include "form_field_snippet.html" with field=form.region %}
+ {% include "form_field_snippet.html" with field=form.timezone %}
+ {% include "form_field_snippet.html" with field=form.queues %}
+ </div>
+ <div class="tab-pane" id="tab5">
+ {% include "form_field_snippet.html" with field=form.tech_id %}
+ {% include "form_field_snippet.html" with field=form.gsx_userid %}
+ {% include "form_field_snippet.html" with field=form.gsx_poprefix %}
+ </div>
+ </div>
+ <div class="form-actions">
+ {% if user.pk %}
+ <a href="{% url 'admin-delete_user' user.pk %}" class="btn btn-danger" data-modal="#modal">{% trans "Delete" %}</a>
+ {% else %}
+ <a href="#" class="btn btn-danger disabled">{% trans "Delete" %}</a>
+ {% endif %}
+ <button type="button" class="btn" onclick="javascript:history.back();">{% trans "Back" %}</button>
+ <button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
+ </div>
+</form>
+{% endblock third_column %}
diff --git a/servo/templates/admin/users/group_form.html b/servo/templates/admin/users/group_form.html
new file mode 100644
index 0000000..07b9785
--- /dev/null
+++ b/servo/templates/admin/users/group_form.html
@@ -0,0 +1,23 @@
+{% extends "admin/users/groups.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block third_column %}
+<div class="row-fluid">
+ <div class="span3">
+ <ul class="nav nav-pills nav-stacked">
+ {% for o in object_list %}
+ <li class="{% active_url request o.get_admin_url %}"><a href="{% url 'admin-edit_group' o.pk %}">{{ o.name }}</a></li>
+ {% endfor %}
+ </ul>
+ </ul>
+ </div>
+ <div class="span9">
+ <form action="" method="post" accept-charset="utf-8" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ {% include "form_buttons.html" %}
+ </form>
+ </div>
+</div>
+{% endblock third_column %}
diff --git a/servo/templates/admin/users/groups.html b/servo/templates/admin/users/groups.html
new file mode 100644
index 0000000..0d81c3b
--- /dev/null
+++ b/servo/templates/admin/users/groups.html
@@ -0,0 +1,37 @@
+{% extends "admin/users/index.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block second_column %}
+{% include "admin/users/tabs.html" %}
+
+{% block third_column %}
+<table class="table">
+ <thead>
+ <tr>
+ <th>{% trans "Group" %}</th>
+ <th>{% trans "Members" %}</th>
+ <th style="width:100px"></th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for group in object_list %}
+ <tr>
+ <td><a href="{% url 'admin-edit_group' group.pk %}">{{ group.name }}</a></td>
+ <td>{{ group.user_set.all|join:", "}}</td>
+ <td style="text-align:right">
+ <div class="btn-group">
+ <a href="{% url 'admin-edit_group' group.pk %}" class="btn btn-warning"><i class="icon-pencil icon-white"></i></a>
+ <a href="{% url 'admin-delete_group' group.pk %}" class="btn btn-danger" data-modal="#modal"><i class="icon-trash icon-white"></i></a>
+ </div>
+ </td>
+ </tr>
+ {% empty %}
+ <tr>
+ <td colspan="3" class="text-muted empty">{% trans "No groups defined" %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
+{% endblock third_column %}
+{% endblock second_column %}
diff --git a/servo/templates/admin/users/index.html b/servo/templates/admin/users/index.html
new file mode 100644
index 0000000..c85ced1
--- /dev/null
+++ b/servo/templates/admin/users/index.html
@@ -0,0 +1,51 @@
+{% extends "admin/index.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+<div class="btn-group">
+ <a class="btn" href="{% url 'admin-create_user' %}"><i class="icon-plus"></i> {% trans "New User" %}</a>
+ <a class="btn btn-default navbar-btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'admin-create_group' %}">{% trans "New Group" %}</a></li>
+ <li><a href="{% url 'admin-upload_users' %}" data-modal="#modal">{% trans "Upload Users" %}</a></li>
+ </ul>
+</div>
+{% endblock toolbar %}
+
+{% block second_column %}
+<div class="row-fluid">
+ {% include "admin/users/tabs.html" %}
+</div>
+
+<div class="row-fluid">
+ <div class="span3">
+ <div class="btn-group">
+ <a class="btn btn-mini dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-search"></i>
+ <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% for l in locations %}
+ <li><a href="?l={{ l.pk|safe }}">{{ l }}</a></li>
+ {% endfor %}
+ </ul>
+ </div>
+ <ul class="nav nav-pills nav-stacked">
+ {% for o in object_list %}
+ {% if o.is_active %}
+ <li class="{% active_url request o.get_admin_url %}"><a href="{{ o.get_admin_url }}"><i class="{{ o.get_icon }}"></i> {{ o.get_name|truncatechars:"25" }}</a></li>
+ {% else %}
+ <li class="{% active_url request o.get_admin_url %}"><a href="{{ o.get_admin_url }}" class="muted"><i class="{{ o.get_icon }}"></i> {{ o.get_name }}</a></li>
+ {% endif %}
+ {% endfor %}
+ </ul>
+ </div>
+ <div class="span9">
+ {% block third_column %}
+ {% endblock third_column %}
+ </div>
+</div>
+{% endblock second_column %}
diff --git a/servo/templates/admin/users/remove.html b/servo/templates/admin/users/remove.html
new file mode 100644
index 0000000..5c80d29
--- /dev/null
+++ b/servo/templates/admin/users/remove.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% blocktrans with user=user.get_full_name %}Delete user {{ user }}?{% endblocktrans %}
+{% endblock header %}
+
+{% block body %}
+ <p>{% trans 'This action cannot be undone.' %}</p>
+{% endblock body %}
+
+{% block footer %}
+ <form action="{% url 'admin-delete_user' user.id %}" method="post" accept-charset="utf-8">
+ {% csrf_token %}
+ <button class="btn btn-danger" type="submit">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/admin/users/tabs.html b/servo/templates/admin/users/tabs.html
new file mode 100644
index 0000000..576e5da
--- /dev/null
+++ b/servo/templates/admin/users/tabs.html
@@ -0,0 +1,7 @@
+{% load i18n %}
+{% load servo_tags %}
+
+<ul class="nav nav-tabs">
+ <li class="{% active request "users" %}"><a href="{% url 'admin-list_users' %}">{% trans "Users" %}</a></li>
+ <li class="{% active request "groups" %}"><a href="{% url 'admin-list_groups' %}">{% trans "Groups" %}</a></li>
+</ul>
diff --git a/servo/templates/admin/users/upload_users.html b/servo/templates/admin/users/upload_users.html
new file mode 100644
index 0000000..746842b
--- /dev/null
+++ b/servo/templates/admin/users/upload_users.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {{ title }}
+{% endblock header %}
+
+{% block body %}
+<form method="post" action="{{ action }}" enctype="multipart/form-data" class="form-horizontal" accept-charset="utf-8">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+</form>
+{% endblock body %}
diff --git a/servo/templates/checkin/confirmation.html b/servo/templates/checkin/confirmation.html
new file mode 100644
index 0000000..00125c3
--- /dev/null
+++ b/servo/templates/checkin/confirmation.html
@@ -0,0 +1,13 @@
+{% extends "checkin/index.html" %}
+{% load i18n %}
+
+{% block main %}
+<div class="page-header">
+ <h2>{% trans "Confirmation" %}</h2>
+</div>
+<form method="post" action="">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ <button type="submit" class="btn btn-primary">{% trans "Submit" %}</button>
+</form>
+{% endblock main %}
diff --git a/servo/templates/checkin/customer_form.html b/servo/templates/checkin/customer_form.html
new file mode 100644
index 0000000..305c67a
--- /dev/null
+++ b/servo/templates/checkin/customer_form.html
@@ -0,0 +1,87 @@
+{% load i18n %}
+{% load bootstrap3 %}
+
+<div class="row">
+ <div class="col-md-6">
+ {% bootstrap_field customer_form.phone %}
+ </div>
+ <div class="col-md-6">
+ {% bootstrap_field customer_form.email %}
+ </div>
+</div>
+
+<div class="row">
+ <div class="col-md-6">
+ {% bootstrap_field customer_form.fname %}
+ </div>
+ <div class="col-md-6">
+ {% bootstrap_field customer_form.lname %}
+ </div>
+</div>
+<div class="row">
+ <div class="col-md-6">
+ {% bootstrap_field customer_form.address %}
+ </div>
+ <div class="col-md-6">
+ {% bootstrap_field customer_form.company %}
+ </div>
+</div>
+<div class="row">
+ <div class="col-md-6">
+ <div class="row">
+ <div class="col-md-6">
+ {% bootstrap_field customer_form.postal_code %}
+ </div>
+ <div class="col-md-6">
+ {% bootstrap_field customer_form.city %}
+ </div>
+ </div>
+ </div>
+ <div class="col-md-6">
+ {% bootstrap_field customer_form.country %}
+ </div>
+</div>
+{% comment %}
+<div class="row">
+ <div class="col-md-12">
+ {% bootstrap_field customer_form.notify_by_sms %}
+ {% bootstrap_field customer_form.notify_by_email %}
+ </div>
+</div>
+{% endcomment %}
+
+{% block media %}
+{% if request.user.is_authenticated %}
+<script type="text/javascript">
+
+ function SearchViewModel() {
+ var self = this;
+ self.results = ko.observableArray();
+
+ self.loadCustomer = function(c){
+ $.get('{% url "checkin-get_customer" %}?c=' + c.id, function(r){
+ $('#id_fname').val(r.fname);
+ $('#id_lname').val(r.lname);
+ $('#id_address').val(r.address);
+ $('#id_postal_code').val(r.postal_code);
+ $('#id_city').val(r.city);
+ $('#id_country').val(r.country);
+ $('#id_email').val(r.email);
+ $('#modal').modal('hide');
+ });
+ }
+ }
+
+ var svm = new SearchViewModel();
+ ko.applyBindings(svm);
+
+ $('#id_phone').next('span').on('click', function(){
+ var q = $('#id_phone').val();
+ $.get('?phone=' + q, function(r){
+ svm.results(r);
+ $('#modal').modal();
+ });
+ });
+</script>
+{% endif %}
+{% endblock media %}
diff --git a/servo/templates/checkin/device_form.html b/servo/templates/checkin/device_form.html
new file mode 100644
index 0000000..16450e7
--- /dev/null
+++ b/servo/templates/checkin/device_form.html
@@ -0,0 +1,62 @@
+{% load i18n %}
+{% load bootstrap3 %}
+
+{% if device.fmip_active %}
+ <div class="alert alert-danger" role="alert">
+ {% trans "Find My iPhone is active!" %}
+ <button type="button" class="close" data-dismiss="alert" aria-label="{% trans "Close" %}"><span aria-hidden="true">&times;</span></button>
+ </div>
+{% endif %}
+
+{% if error %}
+ <div class="alert alert-danger" role="alert">
+ {{ error }}
+ <button type="button" class="close" data-dismiss="alert" aria-label="{% trans "Close" %}"><span aria-hidden="true">&times;</span></button>
+ </div>
+{% endif %}
+
+<div class="col-md-4">
+ <img src="{{ device.get_image_url }}" alt="{{ device.description }}" class="device-image"/>
+</div>
+<div class="col-md-8">
+ <div class="row">
+ <div class="col-md-6">
+ {% bootstrap_field device_form.sn %}
+ </div>
+ <div class="col-md-6">
+ {% bootstrap_field device_form.description %}
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label" for="id_warranty_status">{% trans "Warranty Status" %}</label>
+ <p>{{ device.get_warranty_status_display }}</p>
+ </div>
+ {% bootstrap_field device_form.purchased_on %}
+ {% bootstrap_field device_form.purchase_country %}
+ <div class="row">
+ <div class="col-md-6">
+ {% if device.is_mac %}
+ {% bootstrap_field device_form.username %}
+ {% endif %}
+ </div>
+ <div class="col-md-6">
+ {% bootstrap_field device_form.password %}
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-12">
+ {% bootstrap_field device_form.accessories %}
+ </div>
+ </div>
+</div>
+<script type="text/javascript">
+ $('#id_sn').next('span').on('click', function(){
+ var v = $('#id_sn').val().trim();
+ if (v.length < 3) return false;
+ var target = document.getElementById('main');
+ var spinner = new Spinner().spin(target);
+ $('#device_details').load('?sn='+v, function(r){
+ spinner.stop();
+ });
+ });
+</script> \ No newline at end of file
diff --git a/servo/templates/checkin/error.html b/servo/templates/checkin/error.html
new file mode 100644
index 0000000..eaa45d5
--- /dev/null
+++ b/servo/templates/checkin/error.html
@@ -0,0 +1,15 @@
+{% extends "checkin/index.html" %}
+{% load i18n %}
+
+{% block title %}{% trans "An error occurred" %}{% endblock title %}
+
+{% block main %}
+<div class="container-narrow">
+ <div class="jumbotron">
+ <h1>{% trans "Oops!" %}</h1>
+ <p class="lead">{% trans "It appears that an error has occurred." %}</p>
+ <p>{{ message }}</p>
+ <a class="btn btn-large btn-success" href="{% url 'checkin-index' %}"><i class="icon-refresh icon-white"></i> {% trans "Try again" %}</a>
+ </div>
+</div>
+{% endblock main %}
diff --git a/servo/templates/checkin/index.html b/servo/templates/checkin/index.html
new file mode 100644
index 0000000..9ecc884
--- /dev/null
+++ b/servo/templates/checkin/index.html
@@ -0,0 +1,95 @@
+{% load i18n %}{% load bootstrap3 %}<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>{% block title %}{{ title }}{% endblock title %}</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link href="{{ STATIC_URL }}css/checkin.css" rel="stylesheet">
+ <link href="{{ STATIC_URL }}bs3/css/timeline.css" rel="stylesheet">
+ <link rel="stylesheet" href="{{ STATIC_URL }}bs3/css/bootstrap.min.css">
+ <link rel="stylesheet" href="{{ STATIC_URL }}bs3/css/bootstrap-theme.min.css">
+ <script src="{{ STATIC_URL }}js/jquery.min.js"></script>
+ <script src="{{ STATIC_URL }}bs3/js/bootstrap.min.js"></script>
+ <script src="{{ STATIC_URL }}js/knockout.js"></script>
+ </head>
+ <body id="main">
+ <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+ <div class="container">
+ <div class="collapse navbar-collapse">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ {% if request.user.is_authenticated %}
+ <ul class="nav navbar-nav">
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">{% bootstrap_icon "map-marker" %} {{ request.session.checkin_location_name }} <b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ {% for l in request.session.checkin_locations %}
+ <li{% if l.pk == request.session.checkin_location %} class="active"{% endif %}><a href="?l={{ l.pk|safe }}">{{ l.name }}</a></li>
+ {% endfor %}
+ </ul>
+ </li>
+ </ul>
+ {% endif %}
+ <ul class="nav navbar-nav pull-right">
+ {% if request.user.is_authenticated %}
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">{% bootstrap_icon "user" %} {{ request.session.checkin_user_name }} <b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ {% for u in request.session.checkin_users %}
+ <li{% if u.pk == request.session.checkin_user %} class="active"{% endif %}><a href="?u={{ u.pk|safe }}">{{ u.name }}</a></li>
+ {% endfor %}
+ <li class="divider"></li>
+ <li><a href="{% url 'accounts-list_orders' user.username %}">{% bootstrap_icon "log-in" %} {% trans "Go to Servo" %}</a></li>
+ <li><a href="{% url 'accounts-logout' %}" data-modal="#modal">{% bootstrap_icon "off" %} {% trans "Log out" %}...</a></li>
+ </ul>
+ </li>
+ {% endif %}
+ </ul>
+ </div><!--/.nav-collapse -->
+ </div>
+ </div>
+ </div>
+ <div class="main container">
+ {% if request.user.is_authenticated %}
+ <div class="modal fade" id="modal">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+ <h4 class="modal-title">{% trans "Search results" %}</h4>
+ </div>
+ <div class="modal-body">
+ <ul class="nav nav-pills nav-stacked" data-bind="foreach: results">
+ <li><a href="#" data-bind="text: title, click: $parent.loadCustomer"></a></li>
+ </ul>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
+ </div>
+ </div>
+ </div>
+ </div>
+ {% endif %}
+ <div class="row">
+ <div class="col-md-12">
+ {% bootstrap_messages %}
+ {% block main %}(no content){% endblock main %}
+ </div>
+ </div>
+ </div><!-- /container -->
+ <script type="text/javascript" src="{{ STATIC_URL }}js/spin.js-2.1.0.min.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL }}js/jquery.spin.new.js"></script>
+ <script src="{{ STATIC_URL }}js/common.js"></script>
+ {% block media %}{% endblock media %}
+ <script type="text/javascript">
+ $(function(){
+ $( "#id_agree_to_terms" ).click(function() {
+ $('#id_btn_submit').prop('disabled', !$(this).prop('checked'));
+ });
+ });
+ </script>
+ </body>
+</html>
diff --git a/servo/templates/checkin/newindex.html b/servo/templates/checkin/newindex.html
new file mode 100644
index 0000000..41a6a05
--- /dev/null
+++ b/servo/templates/checkin/newindex.html
@@ -0,0 +1,146 @@
+{% extends "checkin/index.html" %}
+{% load servo_tags %}
+{% load bootstrap3 %}
+{% load i18n %}
+
+{% block main %}
+
+
+<div class="page-header">
+ <h2>{% trans "Device" %}</h2>
+</div>
+
+{% comment %}
+ <div class="container choose-device">
+ <div class="row">
+ <div class="col-md-3">
+ <a href="{% url 'checkin-new' %}?d=mac">
+ <img src="{{ STATIC_URL }}images/checkin/mac.jpg" alt="Mac"/>
+ <p>{% trans "Mac" %}</p>
+ </a>
+ </div>
+ <div class="col-md-3">
+ <a href="{% url 'checkin-new' %}?d=iphone">
+ <img src="{{ STATIC_URL }}images/checkin/iphone.jpg" alt="iPhone"/>
+ <p>{% trans "iPhone" %}</p>
+ </a>
+ </div>
+ <div class="col-md-3">
+ <a href="{% url 'checkin-new' %}?d=ipad">
+ <img src="{{ STATIC_URL }}images/checkin/ipad.jpg" alt="iPad"/>
+ <p>{% trans "iPad" %}</p>
+ </a>
+ </div>
+ <div class="col-md-3">
+ <a href="{% url 'checkin-new' %}?d=ipod">
+ <img src="{{ STATIC_URL }}images/checkin/ipod.jpg" alt="iPod"/>
+ <p>{% trans "iPod" %}</p>
+ </a>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-3">
+ <a href="{% url 'checkin-new' %}?d=acc">
+ <img src="{{ STATIC_URL }}images/checkin/appleacc.jpg" alt="Apple Accessory"/>
+ <p>{% trans "Apple Accessory" %}</p>
+ </a>
+ </div>
+ <div class="col-md-3">
+ <a href="{% url 'checkin-new' %}?d=beats">
+ <img src="{{ STATIC_URL }}images/checkin/beats.png" alt="Beats Products"/>
+ <p>{% trans "Beats Products" %}</p>
+ </a>
+ </div>
+ <div class="col-md-3">
+ <a href="{% url 'checkin-new' %}?d=other">
+ <img src="{{ STATIC_URL }}images/models/macbookair.jpg" alt="Other Device"/>
+ <p>{% trans "Other Device" %}</p>
+ </a>
+ </div>
+ </div>
+ </div>
+{% endcomment %}
+<div class="container">
+ <form action="{% url 'checkin-index' %}" method="post" enctype="multipart/form-data">
+ {% csrf_token %}
+ <div class="row" id="device_details">
+ {% include "checkin/device_form.html" %}
+ </div>
+ <div class="page-header">
+ <h2>{% trans "Customer" %}</h2>
+ </div>
+ <div id="customer">
+ {% include "checkin/customer_form.html" %}
+ </div>
+ <div class="page-header">
+ <h2>{% trans "Problem description" %}</h2>
+ </div>
+ {% if request.user.is_authenticated %}
+ <div class="row">
+ <div class="col-md-12">
+ <div class="form-group">
+ <label class="control-label">{% trans "Tags" %}</label>
+ <div class="row bootstrap3-multi-input select-tags">
+ {% for t in tags %}
+ <div class="btn-group" data-toggle="buttons">
+ <label class="btn btn-sm btn-{{ t.color|replace:"important,danger" }}">
+ <input type="checkbox" name="tags" value="{{ t.id|safe }}"/> {% bootstrap_icon "tag" %} {{ t.title }}
+ </label>
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ </div>
+ </div>
+ {% endif %}
+ <div class="row">
+ <div class="col-md-6">
+ {% bootstrap_field issue_form.issue_description %}
+ {% bootstrap_field issue_form.notes %}
+ {% bootstrap_field device_form.condition %}
+ </div>
+ <div class="col-md-6">
+ {% bootstrap_field device_form.pop %}
+ <table class="table">
+ <thead>
+ <tr>
+ <th></th>
+ <th>{% trans "Yes" %}</th>
+ <th>{% trans "No" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for q in questions %}
+ <tr>
+ <td>
+ <strong>{{ q }}</strong>
+ <p class="small">{{ q.description }}</p>
+ </td>
+ <td><input type="radio" name="__cl__{{ q }}" value="{% trans "Yes" %}"/></td>
+ <td><input type="radio" name="__cl__{{ q }}" value="{% trans "No" %}"/></td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% bootstrap_field customer_form.checkin_location %}
+ {% bootstrap_field customer_form.checkout_location %}
+ </div>
+ </div>
+ <hr/>
+ <div class="row">
+ <div class="col-md-12">
+ {% buttons %}
+ {% if not request.user.is_authenticated %}
+ {% bootstrap_field customer_form.agree_to_terms %}
+ {% endif %}
+ {% if request.user.is_authenticated %}
+ <button type="submit" id="id_btn_submit" class="btn btn-primary pull-right">{% trans "Submit" %}</button>
+ {% else %}
+ <button type="submit" id="id_btn_submit" class="btn btn-primary pull-right" disabled="disabled">{% trans "Submit" %}</button>
+ {% endif %}
+ {% endbuttons %}
+ </div>
+ </div>
+ </form>
+</div>
+{% endblock main %}
diff --git a/servo/templates/checkin/status-show.html b/servo/templates/checkin/status-show.html
new file mode 100644
index 0000000..fcd503c
--- /dev/null
+++ b/servo/templates/checkin/status-show.html
@@ -0,0 +1,35 @@
+{% extends "checkin/index.html" %}
+{% load bootstrap3 %}
+{% load humanize %}
+{% load i18n %}
+
+{% block main %}
+ <div class="page-header">
+ <h2>{{ order.status_name }} {{ order.status_started_at|naturaltime|default:"" }}</h2>
+ <p class="lead">{{ order.status.status.description }}</p>
+ </div>
+ {% if timeline|length %}
+ <ul class="timeline">
+ {% for i in timeline %}
+ <li class="{% cycle '' 'timeline-inverted' %}">
+ <div class="timeline-badge {{ i.get_badge }}">{% bootstrap_icon "ok" %}</i></div>
+ <div class="timeline-panel">
+ {% with i.status as status %}
+ <div class="timeline-heading">
+ <h4 class="timeline-title">{{ status.title }}</h4>
+ <p>
+ <small class="text-muted"><i class="fa fa-time"></i> {{ i.started_at|naturaltime }}</small>
+ </p>
+ </div>
+ <div class="timeline-body">
+ <p>{{ status.description }}</p>
+ </div>
+ {% endwith %}
+ </div>
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ <a href="" class="btn btn-default">{% bootstrap_icon "refresh" %} {% trans "Refresh" %}</a>
+ <a href="{% url 'checkin-index' %}" class="btn btn-primary">{% trans "Return" %}</a>
+{% endblock main %}
diff --git a/servo/templates/checkin/status.html b/servo/templates/checkin/status.html
new file mode 100644
index 0000000..ddb49fb
--- /dev/null
+++ b/servo/templates/checkin/status.html
@@ -0,0 +1,21 @@
+{% extends "checkin/index.html" %}
+{% load bootstrap3 %}
+{% load i18n %}
+
+{% block main %}
+ <div class="page-header">
+ <h2>{% trans "Please enter your Service Order number" %}</h2>
+ </div>
+ <p>{% trans "The Service Order number is an 8-digit code printed on your work confirmation" %}</p>
+ <form method="get" action="" class="nolabel">
+ {% bootstrap_form form %}
+ {% buttons %}
+ <div class="pull-right">
+ <a class="btn btn-default" href="{% url 'checkin-index' %}">{% trans "Back" %}</a>
+ <button type="submit" class="btn btn-primary">
+ {% bootstrap_icon "search" %} Submit
+ </button>
+ </div>
+ {% endbuttons %}
+ </form>
+{% endblock main %}
diff --git a/servo/templates/checkin/terms.html b/servo/templates/checkin/terms.html
new file mode 100644
index 0000000..72d1fa6
--- /dev/null
+++ b/servo/templates/checkin/terms.html
@@ -0,0 +1,9 @@
+{% extends "checkin/index.html" %}
+{% load servo_tags %}
+{% load i18n %}
+{% block main %}
+<div class="page-header">
+ <h1>{% blocktrans with company=conf.company_name %}{{ company }} terms of service{% endblocktrans %}</h1>
+</div>
+{{ conf.terms_of_service|markdown }}
+{% endblock main %}
diff --git a/servo/templates/checkin/thanks.html b/servo/templates/checkin/thanks.html
new file mode 100644
index 0000000..ae5b8da
--- /dev/null
+++ b/servo/templates/checkin/thanks.html
@@ -0,0 +1,26 @@
+{% extends "checkin/index.html" %}
+{% load bootstrap3 %}
+{% load i18n %}
+
+{% block main %}
+<div class="page-header">
+ <h2>{% trans "Done!" %}</h2>
+ <p class="lead">{% blocktrans with code=order.code %}Your service order <strong>{{ code }}</strong> has been submitted. {% endblocktrans %} {% blocktrans %}Please click <strong>Print</strong> to print the confirmation.{% endblocktrans %}</p>
+</div>
+<div class="thanks text-center">
+ <img src="{{ STATIC_URL }}images/ok_256.png" alt="Done!"/>
+ <br/>
+ <a href="{% url 'checkin-index' %}" class="btn btn-default btn-large">{% bootstrap_icon "plus" %} {% trans "Create New" %}</a>
+ <a href="{% url 'checkin-print' order.url_code %}" class="btn btn-primary btn-large" target="_blank">{% bootstrap_icon "print" %} {% trans "Print" %}</a>
+</div>
+{% endblock main %}
+
+{% block media %}
+{% comment %}
+<script type="text/javascript">
+ window.setTimeout(function(){
+ window.location = "{% url 'checkin-reset' %}";
+ }, 20*1000);
+</script>
+{% endcomment %}
+{% endblock media %}
diff --git a/servo/templates/customers/choose-list.html b/servo/templates/customers/choose-list.html
new file mode 100755
index 0000000..84efa7d
--- /dev/null
+++ b/servo/templates/customers/choose-list.html
@@ -0,0 +1,8 @@
+{% load i18n %}
+<ul class="nav nav-pills nav-stacked">
+{% for c in customers %}
+ <li><a href="{% url 'orders-select_customer' pk=order_id customer_id=c.id %}"><i class="{{ c.get_icon }}"></i> <strong>{{ c.fullname }}</strong><br/>{{ c.email }}, {{ c.phone }}</a></li>
+{% empty %}
+ <li class="text-center muted">{% trans "No customers found" %}</li>
+{% endfor %}
+</ul>
diff --git a/servo/templates/customers/choose.html b/servo/templates/customers/choose.html
new file mode 100755
index 0000000..cf812a6
--- /dev/null
+++ b/servo/templates/customers/choose.html
@@ -0,0 +1,45 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Search for customer" %}
+{% endblock header %}
+
+{% block body %}
+<form action="{{ action }}" method="post" accept-charset="utf-8" id="search-form" data-target="#search-results" style="margin:0">
+ {% csrf_token %}
+ <div class="input-prepend">
+ <div class="btn-group">
+ <button class="btn dropdown-toggle" data-toggle="dropdown" type="button" style="width:120px">
+ <span id="filter-label">{% trans "Search" %}</span>
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu">
+ <li class="active"><a href="#" data-search="all">{% trans "All" %}</a></li>
+ <li><a href="#" data-search="companies">{% trans "Companies" %}</a></li>
+ <li><a href="#" data-search="contacts">{% trans "People" %}</a></li>
+ </ul>
+ </div>
+ <input type="text" name="name" style="width:390px" autocomplete="off" id="customer_name" placeholder="{% trans "Name, email or phone number" %}"/>
+ <input type="hidden" name="kind" value="all" id="value-kind"/>
+ </div>
+</form>
+<div id="search-results" style="height:250px"><p class="empty muted" style="line-height:250px">{% trans "Enter search query" %}</p></div>
+{% endblock body %}
+
+{% block footer %}
+ <a id="create_customer" href="{% url 'customers-create_customer' group='all' %}" class="btn">{% trans "New Customer" %}</a>
+ <a class="btn btn-primary submit-search" href="#">{% trans "Search" %}</a>
+ <script type="text/javascript">
+ $('.dropdown-menu li a').click(function(e){
+ $('.dropdown-menu li').removeClass('active');
+ $(this).parent().addClass('active');
+ $('#filter-label').text($(this).text());
+ $('#value-kind').val($(this).data('search'));
+ });
+ $('.submit-search').click(function(e){
+ $('#search-form').submit();
+ e.preventDefault();
+ });
+ </script>
+{% endblock footer %}
diff --git a/servo/templates/customers/delete_group.html b/servo/templates/customers/delete_group.html
new file mode 100755
index 0000000..1c06e0f
--- /dev/null
+++ b/servo/templates/customers/delete_group.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Delete customer group?" %}
+{% endblock header %}
+
+{% block body %}
+ {% trans "This action will not delete the customers in this group." %}
+{% endblock body %}
+
+{% block footer %}
+ <form method="post" action="{{ request.path }}">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/customers/edit_group.html b/servo/templates/customers/edit_group.html
new file mode 100755
index 0000000..3f5fe5c
--- /dev/null
+++ b/servo/templates/customers/edit_group.html
@@ -0,0 +1,8 @@
+{% extends "modal.html" %}
+
+{% block body %}
+<form action="{{ request.path }}" method="post" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+</form>
+{% endblock body %}
diff --git a/servo/templates/customers/find.html b/servo/templates/customers/find.html
new file mode 100644
index 0000000..6d8cb14
--- /dev/null
+++ b/servo/templates/customers/find.html
@@ -0,0 +1,95 @@
+{% extends "customers/index.html" %}
+{% load i18n %}
+
+{% block toolbar %}
+<div class="btn-group">
+{% if request.session.customer_query %}
+ <a class="btn" href="{% url 'customers-download' %}"><i class="icon-download-alt"></i> {% trans "Download" %}</a>
+{% else %}
+ <a class="btn disabled" href="#"><i class="icon-download-alt"></i> {% trans "Download" %}</a>
+{% endif %}
+</div>
+{% endblock toolbar %}
+
+{% block tabs %}
+ <li><a href="{% url 'customers-list_all' %}">{% trans "Browse" %}</a></li>
+ <li class="active"><a href="{% url 'customers-find' %}">{% trans "Search" %}</a></li>
+{% endblock tabs %}
+
+{% block customers %}
+<form action="" method="post" class="form-inline well clearfix">
+ {% csrf_token %}
+ {% for field in form %}
+ <div class="control-group pull-left">
+ <label class="control-label">{{ field.label }}</label>
+ <div class="controls">{{ field }}</div>
+ </div>
+ {% endfor %}
+ <div class="control-group pull-right">
+ <label class="control-label">&nbsp;</label>
+ <div class="controls">
+ <button class="btn btn-primary pull-right" type="submit"><i class="icon-search icon-white"></i> {% trans "Search" %}</button>
+ </div>
+ </div>
+</form>
+
+{% if form.errors %}
+ <div class="alert alert-danger">
+ {% for k, v in form.errors.items %}
+ {{ v }}
+ {% endfor %}
+ </div>
+{% endif %}
+
+<table class="table table-hover sortable">
+ <thead>
+ <tr>
+ <th>{% trans "Name" %}</th>
+ <th>{% trans "Email" %}</th>
+ <th>{% trans "Phone" %}</th>
+ <th>{% trans "Address" %}</th>
+ <th>{% trans "Postal Code" %}</th>
+ <th>{% trans "City" %}</th>
+ <th data-defaultsort="disabled"></th>
+ </tr>
+ </thead>
+ <tbody>
+{% for i in customers %}
+ <tr>
+ <td><a href="{{ i.get_absolute_url }}">{{ i.fullname }}</a></td>
+ <td><a href="{% url 'notes-create_to_customer' customer=i.pk %}">{{ i.email }}</a></td>
+ <td>{{ i.phone }}</td>
+ <td>{{ i.street_address }}</td>
+ <td>{{ i.zip_code }}</td>
+ <td>{{ i.city }}</td>
+ <td>
+ <div class="btn-group pull-right">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="{{ i.get_absolute_url }}">{% trans "View" %}</a></li>
+ {% if perms.servo.change_customer %}
+ <li><a href="{{ i.get_absolute_url }}edit/">{% trans "Edit" %}</a></li>
+ {% else %}
+ <li><a href="#" class="disabled">{% trans "Edit" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ {% if perms.servo.delete_customer %}
+ <li><a href="{{ i.get_absolute_url }}delete/" data-modal="#modal"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% else %}
+ <li><a href="#" class="disabled"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% endif %}
+ </ul>
+ </div>
+ </td>
+ </tr>
+{% empty %}
+ <tr>
+ <td class="muted text-center empty" colspan="7">{% trans "No customers found" %}</td>
+ </tr>
+{% endfor %}
+ </tbody>
+ </table>
+ {% include "pagination.html" with items=customers %}
+{% endblock customers %}
diff --git a/servo/templates/customers/form.html b/servo/templates/customers/form.html
new file mode 100755
index 0000000..69c6138
--- /dev/null
+++ b/servo/templates/customers/form.html
@@ -0,0 +1,51 @@
+{% extends "customers/view.html" %}
+{% load i18n %}
+
+{% block third_column %}
+<form method="post" action="" accept-charset="utf-8" class="form-horizontal">
+ {% csrf_token %}
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "General" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Details" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ {% include "form_field_snippet.html" with field=form.name %}
+ {% include "form_field_snippet.html" with field=form.phone %}
+ {% include "form_field_snippet.html" with field=form.email %}
+ {% include "form_field_snippet.html" with field=form.street_address %}
+ {% include "form_field_snippet.html" with field=form.zip_code %}
+ {% include "form_field_snippet.html" with field=form.city %}
+ {% include "form_field_snippet.html" with field=form.is_company %}
+ </div>
+ <div class="tab-pane" id="tab2">
+ {% include "form_field_snippet.html" with field=form.parent %}
+ {% include "form_field_snippet.html" with field=form.country %}
+ {% for p in customer.contactinfo_set.all %}
+ <div class="control-group">
+ <select name="keys" class="control-label">
+ <option>{{ p.key }}</option>
+ </select>
+ <div class="controls">
+ <input type="text" name="values" value="{{ p.value }}"/>
+ </div>
+ </div>
+ {% endfor %}
+ <div class="control-group property">
+ <select name="keys" class="control-label" data-value="{{ fields.0.title }}">
+ {% for f in fields %}
+ <option>{{ f.title }}</option>
+ {% endfor %}
+ </select>
+ <div class="controls">
+ <input type="text" name="values"/>
+ </div>
+ </div>
+ {% include "form_field_snippet.html" with field=form.photo %}
+ {% include "form_field_snippet.html" with field=form.groups %}
+ {% include "form_field_snippet.html" with field=form.notes %}
+ </div>
+ </div>
+ {% include "form_buttons.html" %}
+</form>
+{% endblock third_column %}
diff --git a/servo/templates/customers/index.html b/servo/templates/customers/index.html
new file mode 100755
index 0000000..84407d9
--- /dev/null
+++ b/servo/templates/customers/index.html
@@ -0,0 +1,84 @@
+{% extends "default.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+<div class="btn-group">
+ <a class="btn" href="{% url 'customers-create_customer' group=group %}"><i class="icon-plus"></i> {% trans "New Customer" %}</a>
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
+ <ul class="dropdown-menu">
+ {% if customer.is_company %}
+ <li><a href="{% url 'customers-create_contact' parent_id=customer.id %}">{% trans "New Contact" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "New Contact" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ <li><a href="{% url 'customers-create_group' %}" data-modal="#modal">{% trans "New Group" %}</a></li>
+ </ul>
+</div>
+<div class="btn-group">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'customers-upload' group=group %}" data-modal="#modal">{% trans "Import" %}</a></li>
+ <li><a href="{% url 'customers-download' group=group %}">{% trans "Export" %}</a></li>
+ <li class="divider"></li>
+ {% if group != 'all' %}
+ <li><a href="{% url 'customers-edit_group' group %}" data-modal="#modal">{% trans "Edit Group" %}</a></li>
+ <li><a href="{% url 'customers-delete_group' group %}" data-modal="#modal">{% trans "Delete Group" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Edit Group" %}</a></li>
+ <li class="disabled"><a href="#">{% trans "Delete Group" %}</a></li>
+ {% endif %}
+ </ul>
+</div>
+{% endblock toolbar %}
+
+{% block content %}
+
+<div class="row-fluid">
+ <div class="span12">
+ <ul class="nav nav-tabs" style="margin-top:30px">
+ {% block tabs %}
+ <li class="active"><a href="{% url 'customers-list_all' %}">{% trans "Browse" %}</a></li>
+ <li><a href="{% url 'customers-find' %}">{% trans "Search" %}</a></li>
+ {% endblock tabs %}
+ </ul>
+ </div>
+</div>
+
+<div class="row-fluid">
+{% block customers %}
+ <div class="span2">
+ {% block first_column %}
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Groups" %}</li>
+ <li {% if group == 'all' %}class="active"{% endif %}>
+ <a href="{% url 'customers-list_all' %}">{% trans "All" %}<span class="badge pull-right">{{ customer_count }}</span></a>
+ </li>
+ {% for i in groups %}
+ <li class="{% active request i.slug "/" %}">
+ <a href="{% url 'customers-list' group=i.slug %}">{{ i.name|truncatechars:16 }}<span class="badge pull-right">{{ i.customer_set.all.count }}</span></a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% endblock first_column %}
+ </div>
+ <div class="span3">
+ {% block second_column %}
+ {% include "customers/list.html" %}
+ {% endblock second_column %}
+ </div>
+ <div class="span7">
+ {% block third_column %}
+ <h2 class="muted text-center">{% trans "No customer selected" %}</h2>
+ {% endblock third_column %}
+ </div>
+{% endblock customers %}
+</div>
+{% endblock content %}
+
+{% block crumbs %}
+<li class="active">{% trans "Customers" %}</li>
+{% endblock crumbs %}
diff --git a/servo/templates/customers/list.html b/servo/templates/customers/list.html
new file mode 100755
index 0000000..ee1e926
--- /dev/null
+++ b/servo/templates/customers/list.html
@@ -0,0 +1,11 @@
+{% load servo_tags %}
+{% load i18n %}
+
+<ul class="nav nav-list">
+ <li class="nav-header">{% trans "Customers" %}</li>
+{% for node in customers %}
+ <li class="{% active request group.slug node.pk %}"><a href="{% url 'customers-view_customer' group=group pk=node.pk %}"><i class="icon {{ node.get_icon }}"></i> {{ node.name }}</a>
+ </li>
+{% endfor %}
+</ul>
+{% include "pagination.html" with items=customers %}
diff --git a/servo/templates/customers/merge.html b/servo/templates/customers/merge.html
new file mode 100644
index 0000000..942286d
--- /dev/null
+++ b/servo/templates/customers/merge.html
@@ -0,0 +1,19 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {{ title }}
+{% endblock header %}
+
+{% block body %}
+<form action="{% url 'customers-merge_customer' pk=customer.pk %}" method="post" accept-charset="utf-8" id="search-form" data-target="#search-results">
+ {% csrf_token %}
+ <input type="hidden" name="id" value="{{ customer.pk|safe }}"/>
+ <input type="text" class="search-query" name="name" autocomplete="off" placeholder="{% trans "Customer name" %}"/>
+</form>
+<div id="search-results"></div>
+{% endblock body %}
+
+{% block footer %}
+<button class="btn btn-primary" data-dismiss="modal">{% trans "Close" %}</button>
+{% endblock footer %}
diff --git a/servo/templates/customers/move.html b/servo/templates/customers/move.html
new file mode 100755
index 0000000..8bed17b
--- /dev/null
+++ b/servo/templates/customers/move.html
@@ -0,0 +1,20 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+{% trans "Move customer" %}
+{% endblock header %}
+
+{% block body %}
+<form action="{% url 'customers-filter' %}" method="post" accept-charset="utf-8" id="search-form" data-target="#search-results">
+ {% csrf_token %}
+ <input type="hidden" name="id" value="{{ customer.pk|safe }}"/>
+ <input type="text" class="search-query" name="name" autocomplete="off" placeholder="{% trans "Customer name" %}"/>
+</form>
+<div id="search-results"></div>
+{% endblock body %}
+
+{% block footer %}
+<a href="{% url 'customers-move_customer' pk=customer.pk new_parent=0 %}" class="btn">{% trans "Move to top" %}</a>
+<button class="btn btn-primary" data-dismiss="modal">{% trans "Close" %}</button>
+{% endblock footer %}
diff --git a/servo/templates/customers/remove.html b/servo/templates/customers/remove.html
new file mode 100755
index 0000000..faa2cbc
--- /dev/null
+++ b/servo/templates/customers/remove.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans 'Delete' %} {{ customer.name }}?
+{% endblock header %}
+
+{% block body %}
+ <p>{% trans "This will also delete all customer's contacts. Customer's orders will not be deleted" %}</p>
+{% endblock body %}
+
+{% block footer %}
+ <form action="{{ action }}" method="post" accept-charset="utf-8">
+ {% csrf_token %}
+ <button class="btn btn-danger" type="submit">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/customers/results-merge.html b/servo/templates/customers/results-merge.html
new file mode 100644
index 0000000..a3c6a43
--- /dev/null
+++ b/servo/templates/customers/results-merge.html
@@ -0,0 +1,5 @@
+<ul class="nav nav-pills nav-stacked">
+{% for c in results %}
+ <li><a href="{% url 'customers-merge_customer' pk=customer.pk target=c.pk %}">{{ c.name }}</a></li>
+{% endfor %}
+</ul>
diff --git a/servo/templates/customers/search-results.html b/servo/templates/customers/search-results.html
new file mode 100755
index 0000000..2af581e
--- /dev/null
+++ b/servo/templates/customers/search-results.html
@@ -0,0 +1,5 @@
+<ul class="nav nav-pills nav-stacked">
+{% for c in results %}
+ <li><a href="{% url 'customers-move_customer' pk=id new_parent=c.id %}">{{ c.name }}</a></li>
+{% endfor %}
+</ul>
diff --git a/servo/templates/customers/search.html b/servo/templates/customers/search.html
new file mode 100755
index 0000000..39cccb8
--- /dev/null
+++ b/servo/templates/customers/search.html
@@ -0,0 +1,44 @@
+{% extends "two_column_layout.html" %}
+{% load i18n %}
+
+{% block toolbar %}
+<a href="{% url 'customers-create_customer' group='all' %}?name={{ query }}" class="btn"><i class="icon-plus"></i> {% trans "New Customer" %}</a>
+{% endblock toolbar %}
+
+{% block first_column %}
+<ul class="nav nav-list">
+ <li class="nav-header">{% trans "Show" %}</li>
+ <li{% if not kind %} class="active"{% endif %}><a href="{% url 'customers-search' %}?q={{ query }}">{% trans "All" %}</a></li>
+ <li{% if kind == 'company' %} class="active"{% endif %}><a href="{% url 'customers-search' %}?q={{ query }}&amp;kind=company">{% trans "Companies" %}</a></li>
+ <li{% if kind == 'contact' %} class="active"{% endif %}><a href="{% url 'customers-search' %}?q={{ query }}&amp;kind=contact">{% trans "People" %}</a></li>
+</ul>
+{% endblock first_column %}
+
+{% block second_column %}
+{% if customers %}
+{% for i in customers %}
+ <address>
+ <strong><a href="{{ i.get_absolute_url }}">{{ i.fullname }}</a></strong><br>
+ {% if i.street_address %}
+ {{ i.street_address }}<br/>
+ {{ i.zip_code }}, {{ i.city }}<br/>
+ {% endif %}
+ {% if i.phone %}
+ <abbr title="{% trans "Phone" %}">P:</abbr> {{ i.phone }}
+ {% endif %}
+ {% if i.email %}
+ <br/>
+ <a href="{% url 'notes-create_to_customer' customer=i.pk %}"><i class="icon-envelope"></i> {{ i.email }}</a>
+ {% endif %}
+ </address>
+ <hr/>
+{% endfor %}
+{% else %}
+ <h1 class="muted text-center">{% trans "No customers found" %}</h1>
+{% endif %}
+{% endblock second_column %}
+
+{% block crumbs %}
+ <li><a href="{% url 'customers-list_all' %}">{% trans "Customers" %}</a> <span class="divider">/</span></li>
+ <li class="active">{{ title }}</li>
+{% endblock crumbs %}
diff --git a/servo/templates/customers/upload.html b/servo/templates/customers/upload.html
new file mode 100644
index 0000000..9c5447c
--- /dev/null
+++ b/servo/templates/customers/upload.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+{% trans "Import customer data" %}
+{% endblock header %}
+
+{% block body %}
+<form action="{{ action }}" method="post" enctype="multipart/form-data" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+</form>
+{% endblock body %}
diff --git a/servo/templates/customers/view.html b/servo/templates/customers/view.html
new file mode 100755
index 0000000..6e28643
--- /dev/null
+++ b/servo/templates/customers/view.html
@@ -0,0 +1,119 @@
+{% extends "customers/index.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block third_column %}
+<ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "Customer" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Orders" %}</a></li>
+ <li><a href="#tab3" data-toggle="tab">{% trans "Devices" %}</a></li>
+ <li><a href="#tab4" data-toggle="tab">{% trans "Messages" %}</a></li>
+</ul>
+<div class="tab-content customer-view">
+ <div class="tab-pane active" id="tab1">
+ <legend>
+ {{ customer.name }}
+ {% if customer.parent %}<br/>
+ <small class="muted">{{ customer.parent.name }} <a href="{{ customer.parent.get_absolute_url }}"><i class="icon icon-circle-arrow-right"></i></a></small>
+ {% endif %}
+ </legend>
+ <dl class="dl-horizontal">
+ {% if customer.email %}
+ <dt>{% trans "Email" %}</dt>
+ <dd><a href="{% url 'notes-create_with_recipient' recipient=customer.email %}">{{ customer.email }}</a></dd>
+ {% endif %}
+ {% if customer.phone %}
+ <dt>{% trans "Phone" %}</dt>
+ <dd><a href="{% url 'notes-create_with_recipient' recipient=customer.get_standard_phone %}">{{ customer.get_international_phone }}</a></dd>
+ {% endif %}
+ {% if customer.street_address %}
+ <dt>{% trans "Address" %}</dt>
+ <dd>{{ customer.street_address }}<br/>{{ customer.zip_code }} {{ customer.city }}</dd>
+ {% endif %}
+ {% for ci in customer.contactinfo_set.all %}
+ <dt>{{ ci.key }}</dt>
+ <dd>{{ ci.value }}</dd>
+ {% endfor %}
+ {% if customer.country %}
+ <dt>{% trans "Country" %}</dt>
+ <dd>{{ customer.get_country_display }}</dd>
+ {% endif %}
+ {% if customer.notes %}
+ <dt>{% trans "Notes" %}</dt>
+ <dd>{{ customer.notes }}</dd>
+ {% endif %}
+ </dl>
+ {% if customer.is_company %}
+ <dl class="dl-horizontal">
+ <dt>{% trans "Contacts" %}</dt>
+ <dd>{% for c in customer.get_contacts %}{{ c }} <a href="{{ c.get_absolute_url }}"><i class="icon icon-circle-arrow-right"></i></a><br/>{% endfor %}</dd>
+ </dl>
+ {% endif %}
+ <hr/>
+ {% with request.session.current_order_id as order_id %}
+ {% if order_id and not request.session.current_order_customer %}
+ <a href="{% url 'customers-add_to_order' customer.pk order_id %}" class="btn btn-primary"><i class="icon-share-alt icon-white"></i> {% trans "Use in " %} #{{ request.session.current_order_code }}</a>
+ {% else %}
+ <a href="#" class="btn btn-primary disabled"><i class="icon-share-alt icon-white"></i>{% trans "Use in current order" %}</a>
+ {% endif %}
+ {% endwith %}
+ <div class="btn-group">
+ <a href="{% url 'orders-create_with_customer' customer_id=customer.pk %}" class="btn">{% trans "Create Service Order" %}</a>
+ </div>
+ <div class="btn-group">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% if perms.servo.change_customer %}
+ <li><a href="{% url 'customers-move_customer' pk=customer.pk %}" data-modal="#modal">{% trans "Move Customer" %}</a></li>
+ <li><a href="{% url 'customers-merge_customer' pk=customer.pk %}" data-modal="#modal">{% trans "Merge Customer" %}</a></li>
+ {% else %}
+ <li><a href="#" class="disabled">{% trans "Move Customer" %}</a></li>
+ <li><a href="#" class="disabled">{% trans "Merge Customer" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ {% if perms.servo.delete_customer %}
+ <li><a href="delete/" data-modal="#modal"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% else %}
+ <li><a href="#" class="disabled"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% endif %}
+ </ul>
+ </div>
+ <div class="pull-right">
+ {% if perms.servo.change_customer %}
+ <a href="edit/" class="btn">{% trans "Edit" %}</a>
+ {% else %}
+ <a href="#" class="btn disabled">{% trans "Edit" %}</a>
+ {% endif %}
+ </div>
+ </div>
+ <div class="tab-pane" id="tab2">
+ {% include "orders/list.html" %}
+ </div>
+ <div class="tab-pane" id="tab3">
+ {% include "devices/list.html" with devices=customer.devices.all tag_id=None %}
+ </div>
+ <div class="tab-pane" id="tab4">
+ <table class="table">
+ <tbody>
+ {% for i in customer.note_set.all %}
+ <tr>
+ <td><a href="{% url 'notes-view_note' 'sent' i.pk %}">{{ i.code }}</a></td>
+ <td>{{ i.subject }}</td>
+ <td>{{ i.created_at|date:"SHORT_DATE_FORMAT" }}</td>
+ <td>{{ i.sender }}</td>
+ </tr>
+ {% empty %}
+ <tr><td colspan="4" class="empty muted">{% trans "No messages found" %}</td></tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+</div>
+{% endblock third_column %}
+
+{% block crumbs %}
+ <li><a href="{% url 'customers-list_all' %}">{% trans "Customers" %}</a> <span class="divider">/</span></li>
+ <li class="active">{{ customer.name }}</li>
+{% endblock crumbs %}
diff --git a/servo/templates/default.html b/servo/templates/default.html
new file mode 100755
index 0000000..922d567
--- /dev/null
+++ b/servo/templates/default.html
@@ -0,0 +1,185 @@
+{% load servo_tags %}
+{% load humanize %}
+{% load cache %}
+{% load i18n %}
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel="icon" type="image/png" href="{{ STATIC_URL }}images/favicon.png">
+ <link rel="apple-touch-icon" type="image/png" href="{{ STATIC_URL }}images/apple-touch-icon.png">
+ <link href="{{ STATIC_URL }}js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+ <link href="{{ STATIC_URL }}js/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">
+ <link href="{{ STATIC_URL }}css/bootstrap-datetimepicker.min.css" rel="stylesheet">
+ <link href="{{ STATIC_URL }}css/bootstrap-sortable.css" rel="stylesheet">
+ <link href="{{ STATIC_URL }}css/glyphicons.css" rel="stylesheet">
+ <link href="{{ STATIC_URL }}css/halflings.css" rel="stylesheet">
+ <link href="{{ STATIC_URL }}css/servo.css" rel="stylesheet">
+ <title>{{ title }} | Servo</title>
+</head>
+<body>
+ <div class="wrapper">
+ <div class="modal hide" id="modal"></div>
+ <div class="navbar navbar-fixed-top navbar-inverse">
+ <div class="navbar-inner">
+ <div class="container-fluid">
+ <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </a>
+ <div class="nav-collapse collapse">
+ <ul class="nav">
+ <li class="{% active request request.user.username %}"><a href="{% url 'accounts-list_orders' request.user.username %}" title="{% trans "Homepage" %}"><i class="icon-home icon-white"></i></a></li>
+ <li class="{% active request '^orders' %}"><a href="{% url 'orders-index' %}?page=1"><i class="icon-inbox icon-white"></i> {% trans "Orders" %}</a></li>
+ <li class="{% active request '^sales' %}"><a href="{% url 'products-list_products' %}"><i class="icon-shopping-cart icon-white"></i> {% trans "Inventory" %}</a></li>
+ <li class="{% active request '^devices' %}"><a href="{% url 'devices-list' %}"><i class="icon-hdd icon-white"></i> {% trans "Devices" %}</a></li>
+ <li class="{% active request '^customers' %}"><a href="{% url 'customers-list_all' %}"><i class="icon-book icon-white"></i> {% trans 'Customers' %}</a></li>
+ <li class="{% active request '^notes' %}"><a href="{% url 'notes-list_notes' 'inbox' %}"><i class="icon-comment icon-white"></i> {% trans "Messages" %}</a></li>
+ <li class="{% active request '^stats' %}"><a href="{% url 'stats-index' %}"><i class="halflings stats white"></i> {% trans "Statistics" %}</a></li>
+ </ul>
+ <div class="nav-collapse collapse">
+ <form class="navbar-search pull-right" method="get" action="{{ request|search_url }}">
+ <input type="text" class="search-query" name="q" placeholder="{% trans "Search" %}" autocomplete="off" value="{{ request.session.search_query }}" id="toolbar-search" autofocus/>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="navbar navbar-fixed-top" style="top:41px;z-index:3">
+ <div class="navbar-inner">
+ <div class="container-fluid">
+ <div class="pull-left">
+ {% block toolbar %}
+ {% endblock toolbar %}
+ </div>
+ <div class="pull-right">
+ <ul class="nav pull-right">
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+ <i class="icon-user"></i> <b class="caret"></b>
+ </a>
+ {% with request.user as user %}
+ <ul class="dropdown-menu">
+ <li><a href="#"><i class="icon-user"></i> {{ request.user.get_name }}</a></li>
+ <li class="divider"></li>
+ <li><a href="{% url 'accounts-list_orders' user.username %}"><i class="icon-home"></i> {% trans "Homepage" %}</a></li>
+ <li><a href="{% url 'calendars-list' user.username %}"><i class="icon-calendar"></i> {% trans "Calendars" %}</a></li>
+ <li><a href="{% url 'accounts-settings' user.username %}"><i class="icon-wrench"></i> {% trans "Profile" %}</a></li>
+ {% if request.user.is_staff %}
+ <li><a href="{% url 'admin-settings' %}"><i class="icon-cog"></i> {% trans "System Settings" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ <li><a href="{% url 'checkin-index' %}"><i class="icon-check"></i> {% trans "Go to check-in" %}</a></li>
+ <li><a href="{% url 'accounts-logout' %}" data-modal="#modal"><i class="icon-off"></i> {% trans "Log out" %}...</a></li>
+ </ul>
+ {% endwith %}
+ </li>
+ </ul>
+ {% with request.user.notifications as notifications %}
+ <ul class="nav pull-right">
+ {% with notifications|unread_notifications as alerts %}
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+ <i class="icon-bell"></i> <span class="badge event-counter">{{ alerts|count_or_empty }}</span> <b class="caret"></b>
+ </a>
+ <ul class="dropdown-menu dropdown-messages">
+ {% for i in alerts|slice:":10" %}
+ <li class="{{ i.get_class }}">
+ <a href="{% url 'events-ack_event' i.pk %}" class="alt" data-rel=".event-counter">
+ <div>
+ <i class="icon-tasks"></i> {{ i.description }}
+ <br/>
+ <small class="muted">{{ i.triggered_at|naturaltime }}</small>
+ </div>
+ </a>
+ </li>
+ {% if not forloop.last %}
+ <li class="divider"></li>
+ {% endif %}
+ {% empty %}
+ <li class="disabled"><a href="#" class="text-center">{% trans "No new alerts" %}</a></li>
+ {% endfor %}
+ <li class="divider"></li>
+ <li>
+ <a class="text-center" href="{% url 'accounts-updates' request.user.username %}?kind=set_status">
+ <strong>{% trans "See All Alerts" %}</strong> <i class="icon-chevron-right"></i>
+ </a>
+ </li>
+ </ul>
+ </li>
+ {% endwith %}
+ </ul>
+ <ul class="nav pull-right">
+ <li class="dropdown">
+ {% with notifications|unread_messages as messages %}
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+ <i class="icon-envelope"></i> <span class="badge msg-counter">{{ messages|count_or_empty }}</span> <b class="caret"></b>
+ </a>
+ <ul class="dropdown-menu dropdown-messages">
+ {% for i in messages|slice:":10" %}
+ <li class="{{ i.get_class }}">
+ <a href="{% url 'events-ack_event' i.pk %}" class="alt" data-rel=".msg-counter">
+ <div class="clearfix">
+ <strong class="pull-left">{{ i.triggered_by }}</strong>
+ <small class="pull-right muted">{{ i.triggered_at|naturaltime }}</small>
+ </div>
+ <div style="overflow:hidden">{{ i.description }}</div>
+ </a>
+ </li>
+ {% if not forloop.last %}
+ <li class="divider"></li>
+ {% endif %}
+ {% empty %}
+ <li class="disabled"><a href="#" class="text-center">{% trans "No new messages" %}</a></li>
+ {% endfor %}
+ {% endwith %}
+ <li class="divider"></li>
+ <li>
+ <a class="text-center" href="{% url 'accounts-updates' request.user.username %}?kind=note_added">
+ <strong>{% trans "Read All Messages" %}</strong> <i class="icon-chevron-right"></i>
+ </a>
+ </li>
+ </ul>
+ {% endwith %}
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="container-fluid container-main">
+ {% for message in messages %}
+ <div class="alert alert-block alert-{{ message.tags }}">
+ <button type="button" class="close" data-dismiss="alert">&times;</button>
+ <i class="icon-exclamation-sign"></i> <strong>{{ message }}</strong>
+ </div>
+ {% endfor %}
+ {% block content %}
+ {% endblock content %}
+ </div>
+ <div class="push"></div>
+ </div>
+ <div class="footer">
+ <div class="container-fluid">
+ <ul class="breadcrumb pull-left">
+ <li><i class="icon-home"></i> <a href="{% url 'accounts-list_orders' request.user.username %}">{{ request.user.get_full_name }}</a> <span class="divider">/</span></li>
+ {% block crumbs %}{% endblock crumbs %}
+ </ul>
+ <small class="copyright pull-right muted">&copy; {% now "Y" %} First Party Software | <a href="https://docs.servoapp.com/terms/" target="_blank">{% trans "Terms" %}</a></small>
+ </div>
+ </div>
+ <script type="text/javascript" src="{{ STATIC_URL }}js/jquery.min.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap/js/bootstrap.min.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap-sortable.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL }}js/spin.min.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL }}js/jquery.spin.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap-datetimepicker.min.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL }}js/common.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL }}js/modernizr.js"></script>
+ <script type="text/javascript" src="{{ STATIC_URL }}js/servo.js"></script>
+ {% block media %}{% endblock media %}
+</body>
+</html>
diff --git a/servo/templates/default_print.html b/servo/templates/default_print.html
new file mode 100755
index 0000000..ed3f4de
--- /dev/null
+++ b/servo/templates/default_print.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>{{ title }}</title>
+ <meta charset="utf-8">
+ <link rel="icon" type="image/png" href="{{ STATIC_URL }}images/favicon.png">
+ <link href="{{ STATIC_URL }}js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+</head>
+<body>
+ <div class="container">
+ {% block content %}
+ {% endblock content %}
+ </div>
+ <script src="{{ STATIC_URL }}js/jquery.min.js"></script>
+ {% if request.user.autoprint %}
+ <script type="text/javascript">
+ $(function() {
+ window.print();
+ });
+ </script>
+ {% endif %}
+</body>
+</html>
diff --git a/servo/templates/devices/accessories_edit.html b/servo/templates/devices/accessories_edit.html
new file mode 100755
index 0000000..db390b3
--- /dev/null
+++ b/servo/templates/devices/accessories_edit.html
@@ -0,0 +1,40 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}{% trans "Manage Accessories" %}{% endblock header %}
+
+{% block body %}
+<form method="post" action="{{ action }}" class="form-search" id="acc-form">
+ {% csrf_token %}
+ <input type="text" id="filter-acc" autocomplete="off" name="name" style="width:500px"/>
+ <div id="acc-choices" style="margin-top:10px">
+ {% for a in selected %}
+ <div class="row-fluid">
+ <div class="span10">{{ a.name }}</div>
+ <div class="span1">
+ <a href="{{ action }}{{ a.id|safe }}/delete/" class="btn btn-small delete">{% trans "Remove" %}</a>
+ </div>
+ </div>
+ {% empty %}
+ <p class="empty muted">{% trans "No accessories added" %}</p>
+ {% endfor %}
+ </div>
+</form>
+<script type="text/javascript">
+ $(function() {
+ $('#acc-choices').on('click', 'a.delete', function() {
+ $('#acc-choices').load($(this).attr('href') + ' #acc-choices');
+ return false;
+ });
+ $('#filter-acc').typeahead({source: {{ choices_json }}});
+ $('#acc-form').submit(function(e) {
+ e.preventDefault();
+ url = $(this).attr('action');
+ $('#acc-choices').load(url + ' #acc-choices', $(this).serializeArray(),
+ function() {
+ $('#filter-acc').val('');
+ });
+ });
+ });
+</script>
+{% endblock body %}
diff --git a/servo/templates/devices/choose-error.html b/servo/templates/devices/choose-error.html
new file mode 100755
index 0000000..73da7e2
--- /dev/null
+++ b/servo/templates/devices/choose-error.html
@@ -0,0 +1,5 @@
+{% load i18n %}
+{% load servo_tags %}
+<ul class="nav nav-pills nav-stacked">
+ <li class="text-center muted">{{ error }}</li>
+</ul>
diff --git a/servo/templates/devices/choose-list.html b/servo/templates/devices/choose-list.html
new file mode 100755
index 0000000..8f5d3f4
--- /dev/null
+++ b/servo/templates/devices/choose-list.html
@@ -0,0 +1,12 @@
+{% load i18n %}
+<ul class="nav nav-list">
+{% for i in results %}
+{% if i.pk %}
+ <li><a href="{% url 'orders-add_device' pk=order device_id=i.pk %}"><strong>{{ i.description }}</strong><br/><small>{{ i.configuration }}</small></a></li>
+{% else %}
+ <li><a href="{% url 'orders-add_device' pk=order sn=i.sn %}"><strong>{{ i.description }}</strong><br/><small>{{ i.configuration }}</small></a></li>
+{% endif %}
+{% empty %}
+ <li style="text-align:center">{% trans "No search results" %}</li>
+{% endfor %}
+</ul>
diff --git a/servo/templates/devices/choose.html b/servo/templates/devices/choose.html
new file mode 100755
index 0000000..49d7151
--- /dev/null
+++ b/servo/templates/devices/choose.html
@@ -0,0 +1,26 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+{% trans "Search for device" %}
+{% endblock header %}
+
+{% block body %}
+<form method="post" action="{% url 'devices-choose' order %}" accept-charset="utf-8" data-target="#search-results" id="search-form">
+ {% csrf_token %}
+ <input type="text" style="width:500px" class="search-query" name="q" autocomplete="off" placeholder="{% trans "Serial number or IMEI code" %}" id="device-sn"/>
+</form>
+<div id="search-results"></div>
+{% endblock body %}
+
+{% block footer %}
+<a id="add-device" href="{% url 'devices-add' %}" class="btn">{% trans "New Device" %}</a>
+<a class="btn btn-primary trigger-search" href="#">{% trans "Search" %}</a>
+<script type="text/javascript">
+ $('#add-device').on('click', function() {
+ var url = $(this).attr('href') + '?sn=' + $('#device-sn').val();
+ document.location = url;
+ return false;
+ });
+</script>
+{% endblock footer %}
diff --git a/servo/templates/devices/diagnostic_error.html b/servo/templates/devices/diagnostic_error.html
new file mode 100644
index 0000000..242b340
--- /dev/null
+++ b/servo/templates/devices/diagnostic_error.html
@@ -0,0 +1 @@
+<div class="muted text-center">{{ error }}</div>
diff --git a/servo/templates/devices/diagnostic_init.html b/servo/templates/devices/diagnostic_init.html
new file mode 100644
index 0000000..6363ca9
--- /dev/null
+++ b/servo/templates/devices/diagnostic_init.html
@@ -0,0 +1,16 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}{% trans "Initiate iOS diagnostics" %}{% endblock header %}
+
+{% block body %}
+ <form action="{{ url }}?a=init" method="post" class="form-horizontal">{% csrf_token %}
+ <input type="hidden" name="order" value="{{ order.pk|safe }}"/>
+ <div class="control-group">
+ <label class="control-label" for="id_email">{% trans "Email" %}</label>
+ <div class="controls">
+ <input id="id_email" maxlength="128" name="email" type="email" value="{{ customer.email }}"/>
+ </div>
+ </div>
+ </form>
+{% endblock body %}
diff --git a/servo/templates/devices/diagnostic_ios.html b/servo/templates/devices/diagnostic_ios.html
new file mode 100644
index 0000000..7dee528
--- /dev/null
+++ b/servo/templates/devices/diagnostic_ios.html
@@ -0,0 +1,20 @@
+<dl class="dl-horizontal">
+{% for k, v in diagnostics.diags.result.items %}
+ <dt>{{ k }}</dt>
+ <dd>{{ v }}</dd>
+{% endfor %}
+</dl>
+
+<dl class="dl-horizontal">
+{% for k, v in diagnostics.diags.profile.items %}
+ <dt>{{ k }}</dt>
+ <dd>{{ v }}</dd>
+{% endfor %}
+</dl>
+
+<dl class="dl-horizontal">
+{% for k, v in diagnostics.diags.report.items %}
+ <dt>{{ k }}</dt>
+ <dd>{{ v }}</dd>
+{% endfor %}
+</dl>
diff --git a/servo/templates/devices/diagnostic_results.html b/servo/templates/devices/diagnostic_results.html
new file mode 100755
index 0000000..85b9748
--- /dev/null
+++ b/servo/templates/devices/diagnostic_results.html
@@ -0,0 +1,22 @@
+{% load i18n %}
+<dl class="dl-horizontal">
+{% with diagnostics.eventHeader as header %}
+ <dt>{% trans "Result" %}</dt>
+ <dd>{{ header.diagnosticEventEndResult|default:"-" }}</dd>
+ <dt>{% trans "Tool" %}</dt>
+ <dd>{{ header.toolID|default:"-" }} ({{ header.toolVersion|default:"-" }})</dd>
+ <dt>{% trans "Passed modules" %}</dt>
+ <dd>{{ header.modulePassCount|default:"-" }}</dd>
+{% endwith %}
+</dl>
+
+<table class="table">
+{% for i in diagnostics.eventItems %}
+ <tr>
+ <td>{{ i.moduleName }}</td>
+ <td>{{ i.moduleLocation }}</td>
+ <td>{{ i.moduleTestName }}</td>
+ <td>{{ i.moduleTestResult }}</td>
+ </tr>
+{% endfor %}
+</table>
diff --git a/servo/templates/devices/diagnostics.html b/servo/templates/devices/diagnostics.html
new file mode 100755
index 0000000..eb146c0
--- /dev/null
+++ b/servo/templates/devices/diagnostics.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}{% trans "Diagnostics" %}{% endblock header %}
+
+{% block body %}
+ <div id="gsx-container" data-source="{% url 'devices-diagnostics' pk=device.id %}?a=get">
+ <div class="progress progress-striped active">
+ <div class="bar" style="width:100%;" data-progress="0"></div>
+ </div>
+ <div class="text-center muted">{% trans "Fetching diagnostics..." %}</div>
+ </div>
+{% endblock body %}
diff --git a/servo/templates/devices/find.html b/servo/templates/devices/find.html
new file mode 100755
index 0000000..1f8e291
--- /dev/null
+++ b/servo/templates/devices/find.html
@@ -0,0 +1,66 @@
+{% extends "devices/index.html" %}
+{% load i18n %}
+
+{% block content %}
+
+<ul class="nav nav-tabs" style="margin-top:30px">
+ <li><a href="{% url 'devices-list' %}">{% trans "Browse" %}</a></li>
+ <li class="active"><a href="{% url 'devices-find' %}">{% trans "Search" %}</a></li>
+</ul>
+
+<form action="" method="post" class="form-inline well clearfix">
+ {% csrf_token %}
+ {% for field in form %}
+ <div class="control-group pull-left">
+ <label class="control-label">{{ field.label }}</label>
+ <div class="controls">{{ field }}</div>
+ </div>
+ {% endfor %}
+ <p class="clearfix">
+ <hr/>
+ <button class="btn btn-primary pull-right" type="submit"><i class="icon-search icon-white"></i> {% trans "Search" %}</button>
+ </p>
+</form>
+
+<table class="table table-striped sortable">
+ <thead>
+ <th>{% trans "Serial Number" %}</th>
+ <th>{% trans "Description" %}</th>
+ <th>{% trans "Created" %}</th>
+ <th>{% trans "Warranty Status" %}</th>
+ <th data-defaultsort="disabled"></th>
+ </thead>
+ <tbody>
+ {% for i in devices %}
+ <tr>
+ <td>{{ i.sn|safe }}</td>
+ <td>{{ i.description }}</td>
+ <td>{{ i.created_at|date:"SHORT_DATE_FORMAT" }}</td>
+ <td>{{ i.get_warranty_status_display }}</td>
+ <td>
+ <div class="btn-group pull-right">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% if request.session.current_order_id %}
+ <li><a href="{% url 'orders-add_device' request.session.current_order_id i.id %}">{% trans "Use in" %} #{{ request.session.current_order_code }}</a></li>
+ <li class="divider"></li>
+ {% endif %}
+ <li><a href="{% url 'orders-create_with_sn' sn=i.sn|safe %}">{% trans "Create Service Order" %}</a></li>
+ <li class="divider"></li>
+ <li><a href="{{ i.get_absolute_url }}">{% trans "View" %}</a></li>
+ <li><a href="{{ i.get_absolute_url }}edit/">{% trans "Edit" %}</a></li>
+ <li class="divider"></li>
+ <li><a href="{{ i.get_absolute_url }}delete/" data-modal="#modal"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ </ul>
+ </div>
+ </td>
+ </tr>
+ {% empty %}
+ <tr><td colspan="5" class="empty muted">{% trans "No search results" %}</td></tr>
+ {% endfor %}
+ </tbody>
+</table>
+{% include "pagination.html" with items=devices %}
+{% endblock content %}
diff --git a/servo/templates/devices/form.html b/servo/templates/devices/form.html
new file mode 100755
index 0000000..8682101
--- /dev/null
+++ b/servo/templates/devices/form.html
@@ -0,0 +1,44 @@
+{% extends "devices/view.html" %}
+{% load i18n %}
+
+{% block fourth_column %}
+<form method="post" action="" accept-charset="utf-8" class="form-horizontal" enctype="multipart/form-data">
+ {% csrf_token %}
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "General" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Details" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ {% include "form_field_snippet.html" with field=form.description %}
+ {% include "form_field_snippet.html" with field=form.sn %}
+ {% include "form_field_snippet.html" with field=form.warranty_status %}
+ {% include "form_field_snippet.html" with field=form.username %}
+ {% include "form_field_snippet.html" with field=form.password %}
+ </div>
+ <div class="tab-pane" id="tab2">
+ {% include "form_field_snippet.html" with field=form.purchased_on %}
+ {% include "form_field_snippet.html" with field=form.brand %}
+ {% include "form_field_snippet.html" with field=form.reseller %}
+ {% include "form_field_snippet.html" with field=form.product_line %}
+ {% include "form_field_snippet.html" with field=form.configuration %}
+ <div class="control-group">
+ <label class="control-label">{% trans "Tags" %}</label>
+ <div class="controls">
+ <input type="text" name="tag" class="input typeahead" placeholder="{% trans "Enter tag" %}" data-provide="typeahead" data-source="{% url 'api-tags' %}?type=device" autocomplete="off"/>
+ <div class="clearfix" style="margin-top:10px">
+ {% for t in device.tags.all %}
+ <span class="label"><div class="pull-left">{{ t.tag }}</div><a class="close" href="{% url 'tags-clear' t.pk %}"><i class="icon-remove icon-white"></i></a></span>
+ {% endfor %}
+ </div>
+ </div>
+ </div>
+ {% include "form_field_snippet.html" with field=form.photo %}
+ {% include "form_field_snippet.html" with field=form.notes %}
+ {% include "form_field_snippet.html" with field=form.has_onsite %}
+ {% include "form_field_snippet.html" with field=form.is_vintage %}
+ </div>
+ </div>
+ {% include "form_buttons.html" %}
+</form>
+{% endblock fourth_column %}
diff --git a/servo/templates/devices/get_info.html b/servo/templates/devices/get_info.html
new file mode 100755
index 0000000..e16b1c5
--- /dev/null
+++ b/servo/templates/devices/get_info.html
@@ -0,0 +1,45 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+{{ device.description }}
+{% endblock header %}
+
+{% block body %}
+<dl class="dl-horizontal">
+ <dt>{% trans "Warranty Status" %}</dt>
+ <dd>{{ device.get_warranty_status_display }}</dd>
+ <dt>{% trans "Purchase Date" %}</dt>
+ <dd>{{ device.purchased_on|date:"SHORT_DATE_FORMAT"|default:"-" }}, {{ device.purchase_country|default:"-" }}</dd>
+ <dt>{% trans "Serial Number" %}</dt>
+ <dd>{{ device.sn }}</dd>
+ {% if device.configuration %}
+ <dt>{% trans "Configration" %}</dt>
+ <dd>{{ device.configuration }}</dd>
+ {% endif %}
+ {% if device.imei %}
+ <dt>IMEI</dt>
+ <dd>{{ device.imei }}</dd>
+ <dt>{% trans "Activation Profile" %}</dt>
+ <dd>{{ device.initial_activation_policy }}</dd>
+ <dt>{% trans "Unlocked" %}</dt>
+ <dd>{{ device.unlocked|yesno }}</dd>
+ {% endif %}
+ {% if device.username %}
+ <dt>{% trans "Username" %}</dt>
+ <dd>{{ device.username }}</dd>
+ {% endif %}
+ {% if device.password %}
+ <dt>{% trans "Password" %}</dt>
+ <dd>{{ device.password }}</dd>
+ {% endif %}
+ {% if device.get_coverage_details %}
+ <dt>{% trans "Details" %}</dt>
+ <dd>{{ device.get_coverage_details|join:"<br/>" }}</dd>
+ {% endif %}
+ {% if device.notes %}
+ <dt>{% trans "Notes" %}</dt>
+ <dd>{{ device.notes }}</dd>
+ {% endif %}
+</dl>
+{% endblock body %}
diff --git a/servo/templates/devices/index.html b/servo/templates/devices/index.html
new file mode 100755
index 0000000..aba62b1
--- /dev/null
+++ b/servo/templates/devices/index.html
@@ -0,0 +1,78 @@
+{% extends "default.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+{% if model %}
+<a href="{% url 'devices-create_device' product_line=product_line model=model %}" class="btn"><i class="icon-plus"></i> {% trans "New Device" %}</a>
+<a href="{% url 'devices-model_parts' product_line=product_line model=model %}" class="btn"><i class="icon-wrench"></i> {% trans "Show Parts" %}</a>
+{% else %}
+<a href="#" class="btn disabled"><i class="icon-plus"></i> {% trans "New Device" %}</a>
+<a href="#" class="btn disabled"><i class="icon-wrench"></i> {% trans "Show Parts" %}</a>
+{% endif %}
+<a href="{% url 'devices-upload_devices' %}" class="btn" data-modal="#modal"><i class="icon-upload"></i> {% trans "Upload" %}</a>
+{% endblock toolbar %}
+
+{% block content %}
+
+<ul class="nav nav-tabs" style="margin-top:30px">
+ <li class="active"><a href="{% url 'devices-list' %}">{% trans "Browse" %}</a></li>
+ <li><a href="{% url 'devices-find' %}">{% trans "Search" %}</a></li>
+</ul>
+
+<div class="row-fluid">
+ <div class="span2">
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Product Line" %}</li>
+ {% for k, v in product_lines.items %}
+ <li {% if k == product_line %}class="active"{% endif %}><a href="{% url 'devices-list_devices' product_line=k %}">{{ v.name }}</a></li>
+ {% endfor %}
+ </ul>
+ </div>
+
+ <div class="span2">
+ {% block second_column %}
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Model" %}</li>
+ {% for k, v in models.items %}
+ <li {% if k == model %}class="active"{% endif %}><a href="{% url 'devices-list_devices' product_line=product_line model=k %}">{{ v }}</a></li>
+ {% empty %}
+ <li class="disabled"><a href="">{% trans "No Product Line selected" %}</a></li>
+ {% endfor %}
+ </ul>
+ {% endblock second_column %}
+ </div>
+
+ <div class="span2">
+ {% block third_column %}
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Device" %}</li>
+ {% for i in devices %}
+ <li {% if i.pk == device.pk %}class="active"{% endif %}>
+ <a href="{% url 'devices-view_device' product_line=product_line model=model pk=i.pk %}">
+ <strong>{{ i.sn }}</strong><br/>
+ <small>{{ i.get_warranty_status_display|truncatechars:30 }}</small>
+ </a>
+ </li>
+ {% empty %}
+ <li class="disabled"><a href="">{% trans "No devices found" %}</a></li>
+ {% endfor %}
+ </ul>
+ {% endblock third_column %}
+ </div>
+ <div class="span6">
+ {% block fourth_column %}
+ {% if query %}
+ {% include "devices/parts.html" %}
+ {% else %}
+ <h2 class="muted text-center">{% trans "No device selected" %}</h2>
+ {% endif %}
+ {% endblock fourth_column %}
+ </div>
+</div>
+
+{% endblock content %}
+
+{% block crumbs %}
+ <li><a href="{% url 'devices-list' %}">{% trans "Devices" %}</a></li>{% block path %}{% endblock path %}
+{% endblock crumbs %}
diff --git a/servo/templates/devices/list.html b/servo/templates/devices/list.html
new file mode 100755
index 0000000..b11cab8
--- /dev/null
+++ b/servo/templates/devices/list.html
@@ -0,0 +1,38 @@
+{% load i18n %}
+
+<table class="table">
+ <tbody class="searchable">
+ {% for device in devices %}
+ <tr>
+ <td><a href="{{ device.get_absolute_url }}">{{ device.sn }}</a></td>
+ <td>{{ device.description }}</td>
+ <td>{{ device.purchased_on|default:"-" }}</td>
+ <td>{{ device.get_warranty_status_display }}</td>
+ <td>
+ <div class="btn-group pull-right">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% with request.session.current_order_id as co %}
+ {% if co %}
+ <li><a href="{% url 'orders-add_device' co device.pk %}">{% trans "Use in" %} #{{ request.session.current_order_code }}</a></li>
+ <li class="divider"></li>
+ {% endif %}
+ {% endwith %}
+ <li><a href="{% url 'orders-create_with_device' device_id=device.pk %}">{% trans "Create Service Order" %}</a></li>
+ <li {% if device.order_set.count < 1 %}class="disabled"{% endif %}><a href="{% url 'orders-index' %}?device={{ device.pk|safe }}">{% trans "Show Service Orders" %}</a></li>
+ <li class="divider"></li>
+ <li><a href="{{ device.get_absolute_url }}">{% trans "View" %}</a></li>
+ <li><a href="{{ device.get_absolute_url }}edit/">{% trans "Edit" %}</a></li>
+ <li class="divider"></li>
+ <li><a href="{{ device.get_absolute_url }}delete/" data-modal="#modal"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ </ul>
+ </div>
+ </td>
+ </tr>
+ {% empty %}
+ <tr><td colspan="5" class="empty muted">{% trans "No devices found" %}</td></tr>
+ {% endfor %}
+ </tbody>
+</table>
diff --git a/servo/templates/devices/parts.html b/servo/templates/devices/parts.html
new file mode 100755
index 0000000..1f4f12c
--- /dev/null
+++ b/servo/templates/devices/parts.html
@@ -0,0 +1,42 @@
+{% load i18n %}
+{% load servo_tags %}
+<table class="table table-hover">
+ <thead>
+ <tr>
+ {% if order.is_editable %}
+ <th style="width:20px"></th>
+ {% endif %}
+ <th>{% trans "Part" %}</th>
+ <th>{% trans "Stock Price" %}</th>
+ <th>{% trans "Exchange Price" %}</th>
+ </tr>
+ </thead>
+ <tbody class="searchable">
+ {% for p in products %}
+ <tr>
+ {% if order.is_editable %}
+ <td><input type="checkbox" data-url="{% url 'orders-add_part' pk=order.pk device=device.pk code=p.code %}" class="async" data-reload="#products"/></td>
+ {% endif %}
+ <td>
+ <a href="{% url 'products-get_info' p.code request.user.get_location.pk %}" data-modal="#modal"><strong>{{ p.code }}</strong></a>{% if p.subst_code %}<br/><small class="muted">{% blocktrans with code=p.subst_code %}Substituted to {{ code }}{% endblocktrans %}</small>{% endif %}<br/>
+ {{ p.title }}<br/><small class="muted">{{ p.eee_code|default:"-"|addspace }}</small></td>
+ <td>{{ p.price_sales_stock|currency }}</td>
+ <td>{{ p.price_sales_exchange|currency }}</td>
+ </tr>
+ {% empty %}
+ <tr><td colspan="5" class="muted empty">{% trans "No products found" %}</td></tr>
+ {% endfor %}
+ </tbody>
+ </table>
+
+ <script type="text/javascript">
+ $('input.async').click(function(){
+ var that = $(this);
+ var url = $(this).data('url');
+ var reload = $(this).data('reload');
+ $.get(url, function(r) {
+ $(reload).html(r);
+ $(that).attr('disabled', 'disabled');
+ });
+ });
+ </script>
diff --git a/servo/templates/devices/remove.html b/servo/templates/devices/remove.html
new file mode 100755
index 0000000..8bd7def
--- /dev/null
+++ b/servo/templates/devices/remove.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% blocktrans with sn=device.sn%}Delete device {{ sn }}"?{% endblocktrans %}
+{% endblock header %}
+
+{% block body %}
+ {% trans "This will also remove it from all service orders." %}
+{% endblock body %}
+
+{% block footer %}
+ <form action="{{ action }}" method="post" accept-charset="utf-8">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/devices/search.html b/servo/templates/devices/search.html
new file mode 100755
index 0000000..28760b5
--- /dev/null
+++ b/servo/templates/devices/search.html
@@ -0,0 +1,15 @@
+{% extends "two_column_layout.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block first_column %}
+<input type="text" class="input-large search-query filter" placeholder="{% trans "Filter results" %}"/>
+{% endblock first_column %}
+
+{% block second_column %}
+{% include "devices/list.html" %}
+{% endblock second_column %}
+
+{% block crumbs %}
+<li><a href="{% url 'devices-list' %}">{% trans "Devices" %}</a></li><li class="active"><span class="divider">/</span>{{ title }}</li>
+{% endblock crumbs %}
diff --git a/servo/templates/devices/search_gsx.html b/servo/templates/devices/search_gsx.html
new file mode 100755
index 0000000..4f06b81
--- /dev/null
+++ b/servo/templates/devices/search_gsx.html
@@ -0,0 +1,41 @@
+{% extends "devices/search.html" %}
+{% load i18n %}
+
+{% block second_column %}
+{% block tabs %}
+ <ul class="nav nav-tabs" id="gsx-tabs">
+ {% if param == 'serialNumber' or param == 'alternateDeviceId' %}
+ <li><a href="{% url 'devices-search_gsx' 'warranty' param query %}">{% trans "Device" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Device" %}</a></li>
+ {% endif %}
+ {% if param == 'serialNumber' or param == 'alternateDeviceId' %}
+ <li><a href="{% url 'devices-search_gsx' 'orders' param query %}">{% trans "Orders" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Orders" %}</a></li>
+ {% endif %}
+ {% if param == 'serialNumber' or param == 'partNumber' %}
+ <li><a href="{% url 'devices-search_gsx' 'parts' param query %}">{% trans "Parts" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Parts" %}</a></li>
+ {% endif %}
+ {% if param == 'serialNumber' or param == 'dispatchId' %}
+ <li><a href="{% url 'devices-search_gsx' 'repairs' param query %}">{% trans "Repairs" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Repairs" %}</a></li>
+ {% endif %}
+ </ul>
+{% endblock tabs %}
+
+{% block results %}
+ {% include "devices/search_gsx_results.html" %}
+{% endblock results %}
+
+{% endblock second_column %}
+
+{% block media %}
+<script type="text/javascript">
+ var loc = location.pathname + location.search;
+ $('#gsx-tabs>li>a[href="'+loc+'"]').parent().addClass('active');
+</script>
+{% endblock media %}
diff --git a/servo/templates/devices/search_gsx_error.html b/servo/templates/devices/search_gsx_error.html
new file mode 100755
index 0000000..1a0de98
--- /dev/null
+++ b/servo/templates/devices/search_gsx_error.html
@@ -0,0 +1,19 @@
+{% extends "devices/search.html" %}
+{% load i18n %}
+
+{% block second_column %}
+{% block tabs %}
+ <ul class="nav nav-tabs" id="gsx-tabs">
+ {% if param == 'serialNumber' or 'alternateDeviceId' %}
+ <li class="active"><a href="#">{% trans "Device" %}</a></li>
+ {% endif %}
+ <li class="disabled"><a href="#">{% trans "Parts" %}</a></li>
+ <li class="disabled"><a href="#">{% trans "Repairs" %}</a></li>
+ </ul>
+{% endblock tabs %}
+
+{% block results %}
+ {% include "search/results/gsx_error.html" %}
+{% endblock results %}
+
+{% endblock second_column %}
diff --git a/servo/templates/devices/search_gsx_parts.html b/servo/templates/devices/search_gsx_parts.html
new file mode 100755
index 0000000..63bfdb9
--- /dev/null
+++ b/servo/templates/devices/search_gsx_parts.html
@@ -0,0 +1,30 @@
+{% load i18n %}
+{% load servo_tags %}
+
+{% autoescape on %}
+{% for p in results %}
+ <tr>
+ <td><a href="{% url 'products-view_product' code=p.code %}">{{ p.code }}</a></td>
+ <td>{{ p.title }}<br/><span class="muted small" title="{{ p.eee_code }}">{{ p.eee_code|truncatechars:40 }}</td>
+ <td>{{ p.price_sales_exchange|currency }}</td>
+ <td>{{ p.price_sales_stock|currency }}</td>
+ <td>0</td>
+ <td>
+ <div class="btn-group pull-right">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <li{% if not perms.servo.add_product %} class="disabled"{% endif %}>
+ {% if device %}
+ <a href="{% url 'products-create' group=device.get_product_category code=p.code %}">{% trans "Create Product" %}</a>
+ {% else %}
+ <a href="{% url 'products-create' code=p.code %}">{% trans "Create Product" %}</a>
+ {% endif %}
+ </li>
+ </ul>
+ </div>
+ </td>
+ </tr>
+{% endfor %}
+{% endautoescape %}
diff --git a/servo/templates/devices/search_gsx_repairs.html b/servo/templates/devices/search_gsx_repairs.html
new file mode 100755
index 0000000..6cb9f7f
--- /dev/null
+++ b/servo/templates/devices/search_gsx_repairs.html
@@ -0,0 +1,27 @@
+{% load i18n %}
+<table class="table table-hover">
+ <thead>
+ <tr>
+ <th>{% trans "Number" %}</th>
+ <th>{% trans "Reference" %}</th>
+ <th>{% trans "Created" %}</th>
+ <th>{% trans "Customer" %}</th>
+ <th>{% trans "Status" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for r in results %}
+ <tr>
+ {% with r.repairConfirmationNumber as repconf %}
+ <td><a href="{% url 'repairs-get_details' repconf %}" data-modal="#modal">{{ repconf }}</a></td>
+ {% endwith %}
+ <td>{{ r.purchaseOrderNumber|safe }}</td>
+ <td>{{ r.createdOn }}</td>
+ <td>{{ r.customerName }}</td>
+ <td>{{ r.repairStatus }}</td>
+ </tr>
+ {% empty %}
+ <tr><td colspan="5" class="muted text-center">{% trans "No search results" %}</td></tr>
+ {% endfor %}
+ </tbody>
+</table>
diff --git a/servo/templates/devices/search_gsx_results.html b/servo/templates/devices/search_gsx_results.html
new file mode 100755
index 0000000..b7a0926
--- /dev/null
+++ b/servo/templates/devices/search_gsx_results.html
@@ -0,0 +1,5 @@
+<div id="gsx-container" data-source="{% url 'devices-get_gsx_search_results' what param query %}">
+ <div class="progress active">
+ <div class="bar" style="width:1%;" data-progress="0"></div>
+ </div>
+</div>
diff --git a/servo/templates/devices/search_gsx_warranty.html b/servo/templates/devices/search_gsx_warranty.html
new file mode 100755
index 0000000..e278001
--- /dev/null
+++ b/servo/templates/devices/search_gsx_warranty.html
@@ -0,0 +1,71 @@
+{% load i18n %}
+
+{% for d in results %}
+<div class="row-fluid">
+ <div class="span3">
+ <img class="img-rounded" src="{{ d.get_image_url }}" alt="{{ d.description }}" title="{{ d.description }}"/>
+ </div>
+ <div class="span9" id="gsx-results">
+ <h3>{{ d.description }}</h3>
+ {% if d.tags %}
+ {% for t in d.tags.all %}<span class="label pull-right"><i class="icon icon-tag"></i>{{ t.tag }}</span>{% endfor %}
+ {% endif %}
+ <dl class="dl-horizontal">
+ <dt>{% trans "Warranty Status" %}</dt>
+ <dd>{{ d.get_warranty_status_display }}</dd>
+ <dt>{% trans "Purchase Date" %}</dt>
+ <dd>{{ d.purchased_on|date:"SHORT_DATE_FORMAT"|default:"-" }}, {{ d.purchase_country|default:"-" }}</dd>
+ <dt>{% trans "Serial Number" %}</dt>
+ <dd>{{ d.sn }}</dd>
+ <dt>{% trans "Configration" %}</dt>
+ <dd>{{ d.configuration }}</dd>
+ {% if d.imei %}
+ <dt>{% trans "IMEI" %}</dt>
+ <dd>{{ d.imei|safe }}</dd>
+ <dt>{% trans "Applied Activation Policy" %}</dt>
+ <dd>{{ d.applied_activation_policy }}</dd>
+ <dt>{% trans "Initial Activation Policy" %}</dt>
+ <dd>{{ d.initial_activation_policy }}</dd>
+ <dt>{% trans "Next Tether Policy" %}</dt>
+ <dd>{{ d.next_tether_policy }}</dd>
+ <dt>{% trans "Find My iPhone" %}</dt>
+ <dd>{{ d.get_fmip_status }}</dd>
+ <dt>{% trans "Unlocked" %}</dt>
+ <dd>{{ d.unlocked|yesno }}</dd>
+ {% endif %}
+ {% if d.repeat_service %}
+ {% with d.repeat_service as order %}
+ <dt>{% trans "Sales Order" %}</dt>
+ <dd><a href="{{ order.get_absolute_url }}">{{ d.repeat_service.code }}</a> ({{ order.created_at|date:"SHORT_DATE_FORMAT" }})</dd>
+ {% endwith %}
+ {% endif %}
+ {% if d.get_coverage_details %}
+ <dt>{% trans "Details" %}</dt>
+ <dd>{{ d.get_coverage_details|join:"<br/>" }}</dd>
+ {% endif %}
+ {% if d.has_onsite %}
+ <dt>{% trans "Onsite Coverage" %}</dt>
+ <dd>{{ d.onsite_start_date }} - {{ d.onsite_end_date }}</dd>
+ {% endif %}
+ {% if d.contract_start_date %}
+ <dt>{% trans "Contract Coverage" %}</dt>
+ <dd>{{ d.contract_start_date }} - {{ d.contract_end_date }}</dd>
+ {% endif %}
+ {% if d.notes %}
+ <dt>{% trans "Notes" %}</dt>
+ <dd>{{ d.notes }}</dd>
+ {% endif %}
+ </dl>
+ <hr/>
+ {% if request.session.current_order_id %}
+ {% with request.session.current_order_id as co %}
+ <a class="btn btn-primary" href="{% url 'orders-add_device' pk=co sn=d.sn %}"><i class="icon-share-alt icon-white"></i> {% trans "Use in order" %} #{{ request.session.current_order_code }}</a>
+ {% endwith %}
+ {% endif %}
+ <a class="btn btn-default" href="{% url 'orders-create_with_sn' sn=d.sn %}"><i class="icon-plus"></i> {% trans "Create Service Order" %}</a>
+ {% if d.manual_url %}
+ <a class="btn" href="{{ d.manual_url }}"><i class="icon-download"></i> {% trans "Download Manual" %}</a></li>
+ {% endif %}
+ </div>
+</div>
+{% endfor %}
diff --git a/servo/templates/devices/specs.html b/servo/templates/devices/specs.html
new file mode 100755
index 0000000..dcad375
--- /dev/null
+++ b/servo/templates/devices/specs.html
@@ -0,0 +1,42 @@
+{% extends "devices/index.html" %}
+{% load mptt_tags %}
+{% load i18n %}
+
+{% block navtabs %}
+<ul class="nav nav-tabs" id="navtabs">
+ <li><a href="/devices/">{% trans "All" %}</a></li>
+ <li><a href="/devices/specs/">{% trans "Specs" %}</a></li>
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans "Tagi" %} <b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ {% for t in tags %}
+ <li><a href="/customers/index/tag/{{ t.id }}/">{{ t.title }}</a></li>
+ {% endfor %}
+ </ul>
+ </li>
+ <li class="pull-right"><a href="/devices/specs/new/">{% trans "Luo malli" %}</a></li>
+</ul>
+{% endblock navtabs %}
+
+{% block content %}
+<div class="row">
+<div class="span3">
+ <ul>
+ {% recursetree specs %}
+ <li><a href="/devices/specs/{{ node.id }}/">{{ node.title }}</a>
+ {% if not node.is_leaf_node %}
+ <ul class="children">
+ {{ children }}
+ </ul>
+ {% endif %}
+ </li>
+ {% endrecursetree %}
+ </ul>
+ </div>
+
+ <div class="span9">
+ {% block specs %}
+ {% endblock specs %}
+ </div>
+</div>
+{% endblock content %}
diff --git a/servo/templates/devices/summary.html b/servo/templates/devices/summary.html
new file mode 100755
index 0000000..cc6b4dc
--- /dev/null
+++ b/servo/templates/devices/summary.html
@@ -0,0 +1,48 @@
+{% load i18n %}
+<div class="row-fluid">
+ <div class="span3">
+ <img src="{{ device.get_photo }}" alt="{{ device.description }}" title="{{ device.description }}" class="img-rounded"/>
+ </div>
+ <div class="span9">
+ <h3>{{ device.description }}</h3>
+ <dl class="dl-horizontal">
+ <dt>{% trans "Warranty Status" %}</dt>
+ <dd>{{ device.get_warranty_status_display }}</dd>
+ <dt>{% trans "Purchase Date" %}</dt>
+ <dd>{{ device.purchased_on|date:"SHORT_DATE_FORMAT"|default:"-" }}, {{ device.get_purchase_country|default:"-" }}</dd>
+ <dt>{% trans "Serial Number" %}</dt>
+ <dd>{{ device.sn|default:"-" }}</dd>
+ {% if device.configuration %}
+ <dt>{% trans "Configration" %}</dt>
+ <dd>{{ device.configuration }}</dd>
+ {% endif %}
+ {% if device.username %}
+ <dt>{% trans "Username" %}</dt>
+ <dd>{{ device.username }}</dd>
+ {% endif %}
+ {% if device.password %}
+ <dt>{% trans "Password" %}</dt>
+ <dd>{{ device.password }}</dd>
+ {% endif %}
+ {% if device.imei %}
+ <dt>{% trans "IMEI" %}</dt>
+ <dd>{{ device.imei }}</dd>
+ <dt>{% trans "Applied Activation Policy" %}</dt>
+ <dd>{{ device.applied_activation_policy }}</dd>
+ <dt>{% trans "Initial Activation Policy" %}</dt>
+ <dd>{{ device.initial_activation_policy }}</dd>
+ <dt>{% trans "Find My iPhone" %}</dt>
+ <dd>{{ device.get_fmip_status }}</dd>
+ <dt>{% trans "Unlocked" %}</dt>
+ <dd>{{ device.unlocked }}</dd>
+ {% endif %}
+ {% if device.notes %}
+ <dt>{% trans "Notes" %}</dt>
+ <dd>{{ device.notes }}</dd>
+ {% endif %}
+ </dl>
+ {% for t in device.tags.all %}
+ <span class="label">{{ t.tag }}</span>
+ {% endfor %}
+ </div>
+</div>
diff --git a/servo/templates/devices/upload_devices.html b/servo/templates/devices/upload_devices.html
new file mode 100755
index 0000000..1d30242
--- /dev/null
+++ b/servo/templates/devices/upload_devices.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+{% trans "Upload devices" %}
+{% endblock header %}
+
+{% block body %}
+<form action="{{ action }}" method="post" enctype="multipart/form-data" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+</form>
+{% endblock body %}
diff --git a/servo/templates/devices/view.html b/servo/templates/devices/view.html
new file mode 100755
index 0000000..fd6d3a9
--- /dev/null
+++ b/servo/templates/devices/view.html
@@ -0,0 +1,83 @@
+{% extends "devices/index.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block fourth_column %}
+<ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "Device" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Orders" %}</a></li>
+ {% if device.is_apple_device %}
+ <li><a href="#tab3" data-toggle="tab">{% trans "GSX Repairs" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#" data-toggle="tab">{% trans "GSX Repairs" %}</a></li>
+ {% endif %}
+</ul>
+<div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ {% include "devices/summary.html" %}
+ <hr/>
+ {% if request.session.current_order_id and device.id %}
+ <a href="{% url 'orders-add_device' request.session.current_order_id device.id %}" class="btn btn-primary"><i class="icon-share-alt icon-white"></i> {% trans "Use in" %} #{{ request.session.current_order_code }}</a>
+ {% else %}
+ <a href="#" class="btn btn-primary disabled"><i class="icon-share-alt icon-white"></i> {% trans "Use in current order" %}</a>
+ {% endif %}
+ {% if device.pk %}
+ <a href="{% url 'devices-create_order' device.pk %}" class="btn"><i class="icon-plus"></i> {% trans "Create Service Order" %}</a>
+ {% endif %}
+ <div class="btn-group">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% if device.manual_url %}
+ <li><a href="{{ device.manual_url }}">{% trans "Service Manual" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Service Manual" %}</a></li>
+ {% endif %}
+ {% if device.exploded_view_url %}
+ <li><a href="{{ device.exploded_view_url }}">{% trans "Exploded View" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Exploded View" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ {% if device.is_apple_device %}
+ <li><a href="{% url 'devices-update_gsx_details' device.pk %}" class="spin">{% trans "Update Warranty Status" %}</a></li>
+ <li><a href="{% url 'devices-diagnostics' pk=device.id %}?a=get" data-modal="#modal">{% trans "Fetch Diagnostics" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#" class="spin">{% trans "Update Warranty Status" %}</a></li>
+ <li class="disabled"><a href="#" data-modal="#modal">{% trans "Fetch Diagnostics" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ {% if perms.servo.change_device %}
+ <li><a href="delete/" data-modal="#modal"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% endif %}
+ </ul>
+ </div>
+ <div class="pull-right">
+ {% if perms.servo.change_device %}
+ <a href="edit/" class="btn">{% trans "Edit" %}</a>
+ {% endif %}
+ </div>
+ </div>
+ <div class="tab-pane" id="tab2">
+ {% include "orders/list.html" with orders=device.order_set.all %}
+ </div>
+ {% if device.is_apple_device %}
+ <div class="tab-pane" id="tab3">
+ <div id="gsx-container" data-source="{% url 'devices-search_gsx' what='repairs' param='serialNumber' query=device.sn %}">
+ <div class="progress active">
+ <div class="bar" style="width:100%;" data-progress="0"></div>
+ </div>
+ <p class="text-center muted">{% trans "Fetching repairs..." %}</p>
+ </div>
+ </div>
+ {% endif %}
+</div>
+{% endblock fourth_column %}
+</div>
+
+{% block path %}
+ <li class="active"><span class="divider">/</span> {{ device.description }}</li>
+{% endblock path %}
diff --git a/servo/templates/dropdown_snippet.html b/servo/templates/dropdown_snippet.html
new file mode 100755
index 0000000..52d496f
--- /dev/null
+++ b/servo/templates/dropdown_snippet.html
@@ -0,0 +1,8 @@
+<div class="btn-group">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">{{ title }} <span class="caret"></span></a>
+ <ul class="dropdown-menu">
+ {% for i in items %}
+ <li><a href="#"></a></li>
+ {% endfor %}
+ </ul>
+</div>
diff --git a/servo/templates/error.html b/servo/templates/error.html
new file mode 100644
index 0000000..db3ce21
--- /dev/null
+++ b/servo/templates/error.html
@@ -0,0 +1,49 @@
+{% load i18n %}
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <link rel="icon" type="image/png" href="{{ STATIC_URL }}images/favicon.png">
+ <link rel="apple-touch-icon" type="image/png" href="{{ STATIC_URL }}images/apple-touch-icon.png">
+ <link href="{{ STATIC_URL }}js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+ <link href="{{ STATIC_URL }}js/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">
+ <link href="{{ STATIC_URL }}css/glyphicons.css" rel="stylesheet">
+ <title>{% trans "An Error Occurred" %}</title>
+ <style type="text/css">
+ label {
+ display: none;
+ }
+ </style>
+</head>
+<body>
+ <div class="main container">
+ {% block main %}
+ <div class="container-narrow">
+ <div class="row">
+ <div class="span12">
+ <div class="jumbotron">
+ {% if crashed %}
+ <h1>{% trans "Oops!" %}</h1>
+ <p class="lead">{% trans "It appears that an error has occurred." %} {% trans "I've notified the developers, but I'm sure they would really appreciate if you could briefly describe what you were doing before this happened." %}</p>
+ <form action="" method="post">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ <div class="pull-right">
+ <a class="btn btn-large" href="{% url 'home' %}">{% trans "Cancel" %}</a>
+ <button type="submit" class="btn btn-primary btn-large">{% trans "Submit" %}</button>
+ </div>
+ </form>
+ {% else %}
+ <h1>{% trans "Thanks!" %}</h1>
+ <p class="lead">{% trans "Your error report has been submitted. Thanks for helping make Servo better!" %}</p>
+ <a class="btn btn-large" href="{% url 'home' %}"><i class="icon-home"></i> {% trans "Return Home" %}</a>
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ </div>
+ {% endblock main %}
+ </div>
+</body>
+</html>
diff --git a/servo/templates/form_buttons.html b/servo/templates/form_buttons.html
new file mode 100755
index 0000000..d67cd3f
--- /dev/null
+++ b/servo/templates/form_buttons.html
@@ -0,0 +1,5 @@
+{% load i18n %}
+<div class="form-actions">
+ <button type="button" class="btn" onclick="javascript:history.back();">{% trans "Back" %}</button>
+ <button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
+</div>
diff --git a/servo/templates/form_field_snippet.html b/servo/templates/form_field_snippet.html
new file mode 100755
index 0000000..c4d1ab7
--- /dev/null
+++ b/servo/templates/form_field_snippet.html
@@ -0,0 +1,30 @@
+{% load i18n %}
+{% load servo_tags %}
+<div class="control-group{% for e in field.errors %} error{% endfor %} {{ classes }}">
+{% if field|widget_is:"CheckboxInput" %}
+ <div class="controls">
+ <label class="checkbox" for="{{ field.id }}">
+ {{ field }} {% trans field.label %}
+ {% if field.help_text %}
+ <span class="help-block">{% trans field.help_text %}</span>
+ {% endif %}
+ </label>
+ </div>
+{% elif field|widget_is:"CheckboxSelectMultiple" %}
+ <label class="control-label {{ field.css_classes }}">{% trans field.label %}</label>
+ <div class="controls">
+ {{ field }}
+ </div>
+{% else %}
+ <label class="control-label {{ field.css_classes }}" for="{{ field.id }}">{% trans field.label %}</label>
+ <div class="controls">
+ {{ field }}
+ {% if field.help_text %}
+ <span class="help-block">{% trans field.help_text %}</span>
+ {% endif %}
+ {% for e in field.errors %}
+ <span class="help-inline">{{ e }}</span>
+ {% endfor %}
+ </div>
+{% endif %}
+</div>
diff --git a/servo/templates/form_snippet.html b/servo/templates/form_snippet.html
new file mode 100755
index 0000000..c9264c8
--- /dev/null
+++ b/servo/templates/form_snippet.html
@@ -0,0 +1,7 @@
+{% for hidden in form.hidden_fields %}
+ {{ hidden }}
+{% endfor %}
+{% for field in form.visible_fields %}
+ {% include "form_field_snippet.html" with field=field %}
+{% endfor %}
+{{ form.media }}
diff --git a/servo/templates/generic/admin_list.html b/servo/templates/generic/admin_list.html
new file mode 100644
index 0000000..25a29c6
--- /dev/null
+++ b/servo/templates/generic/admin_list.html
@@ -0,0 +1,18 @@
+{% extends "admin/index.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block second_column %}
+<div class="span3">
+ <ul class="nav nav-list">
+ <li class="nav-header">{{ title }}</li>
+ {% for o in object_list %}
+ <li class="{% active_url request o.get_admin_url %}"><a href="{{ o.get_admin_url }}">{{ o.title|truncatechars:25 }}</a></li>
+ {% endfor %}
+ </ul>
+</div>
+<div class="span9">
+ {% block third_column %}
+ {% endblock third_column %}
+</div>
+{% endblock second_column %}
diff --git a/servo/templates/generic/button_dropdown.html b/servo/templates/generic/button_dropdown.html
new file mode 100755
index 0000000..39aba25
--- /dev/null
+++ b/servo/templates/generic/button_dropdown.html
@@ -0,0 +1,12 @@
+{% if items.count %}
+<div class="btn-group">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-file"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% for i in items %}
+ <li><a href="{{ i.get_absolute_url }}">{{ i }}</a></li>
+ {% endfor %}
+ </ul>
+</div>
+{% endif %}
diff --git a/servo/templates/generic/delete.html b/servo/templates/generic/delete.html
new file mode 100755
index 0000000..0503ce5
--- /dev/null
+++ b/servo/templates/generic/delete.html
@@ -0,0 +1,17 @@
+{% extends "snippets/modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {{ title }}
+{% endblock header %}
+
+{% block body %}
+ {{ explanation }}
+{% endblock body %}
+
+{% block footer %}
+ <form method="post" action="{{ action }}">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/generic/index.html b/servo/templates/generic/index.html
new file mode 100755
index 0000000..379db1c
--- /dev/null
+++ b/servo/templates/generic/index.html
@@ -0,0 +1,23 @@
+{% extends "admin/index.html" %}
+{% load i18n %}
+
+{% block second_column %}
+<ul class="nav nav-tabs">
+ <li class="active"><a href="#">{% trans "Browse" %}</a></li>
+</ul>
+
+<table class="table">
+{% for item in object_list %}
+ <tr>
+ <td><a href="{{ item.id }}/edit/">{{ item.title }}</a></td>
+ <td style="text-align:right">
+ <div class="btn-group">
+ <a href="{{ item.pk }}/edit/" class="btn btn-warning" title="{% trans "Edit" %}"><i class="icon-pencil icon-white"></i></a>
+ <a href="{{ item.pk }}/delete/" class="btn btn-danger" data-modal="#modal" title="{% trans "Delete" %}"><i class="icon-trash icon-white"></i></a>
+ </div>
+ </td>
+ </tr>
+{% endfor %}
+</table>
+<a class="btn" href="new/"><i class="icon-plus"></i> {% trans "Create New" %}</a>
+{% endblock second_column %}
diff --git a/servo/templates/invoices/index.html b/servo/templates/invoices/index.html
new file mode 100755
index 0000000..94bf6ae
--- /dev/null
+++ b/servo/templates/invoices/index.html
@@ -0,0 +1,106 @@
+{% extends "products/index.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block first_column %}
+<ul class="nav nav-list">
+ <li class="nav-header">{% trans "Invoices" %}</li>
+ <li class="active"><a href="{% url 'invoices-index' %}">{% trans "Sales Invoices" %}</a></li>
+ <li><a href="{% url 'invoices-gsx_invoices' %}">{% trans "Apple Invoices" %}</a></li>
+</ul>
+{% endblock first_column %}
+
+{% block toolbar %}
+{% endblock toolbar %}
+
+{% block second_column %}
+{% block filter_bar %}
+<div class="row-fluid">
+ <div class="span12 well">
+ <form action="" method="post" class="form-inline">
+ {% csrf_token %}
+ {% for field in form %}
+ <div class="control-group pull-left">
+ <label class="control-label">{{ field.label }}</label>
+ <div class="controls">{{ field }}</div>
+ </div>
+ {% endfor %}
+ <div class="control-group">
+ <label class="control-label">&nbsp;</label>
+ <div class="controls">
+ <button class="btn btn-primary pull-right" type="submit"><i class="icon-search icon-white"></i> {% trans "Search" %}</button>
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
+{% endblock filter_bar %}
+<div class="row-fluid">
+ <div class="span12">
+ <table class="table table-hover">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>{% trans "Order" %}</th>
+ <th>{% trans "Customer" %}</th>
+ <th>{% trans "Date Created" %}</th>
+ <th>{% trans "Status" %}</th>
+ <th>{% trans "Total" %}</th>
+ <th>{% trans "Date Paid" %}</th>
+ <th>{% trans "Payment Method" %}</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for i in invoices %}
+ <tr>
+ <td>{{ i.pk|safe }}</td>
+ <td><a href="{{ i.order.get_absolute_url }}">{{ i.order.code }}</a></td>
+ <td>{{ i.customer_name }}</td>
+ <td>{{ i.created_at|date:"SHORT_DATE_FORMAT" }}</td>
+ <td>{{ i.order.status_name }}</td>
+ <td>{{ i.total_gross|currency }}</td>
+ <td>{{ i.paid_at|date:"SHORT_DATE_FORMAT" }}</td>
+ <td>{{ i.get_payment_methods|join:", " }}</td>
+ <td>
+ <div class="btn-group pull-right">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'invoices-print_invoice' i.pk %}" class="window">{% trans "Print receipt" %}</a></li>
+ </ul>
+ </div>
+ </td>
+ </tr>
+ {% empty %}
+ <tr>
+ <td colspan="9" class="empty muted">{% trans "No invoices found" %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ <tfoot>
+ <tr>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td><strong>{{ total.total_net__sum|currency|default:"" }}<br/>{{ total_purchases.total__sum|currency|default:"" }}</strong></td>
+ <td><strong>{{ total_paid.total_net__sum|currency|default:"" }}</strong></td>
+ <td></td>
+ <td></td>
+ </tr>
+ </tfoot>
+ </table>
+ {% include "pagination.html" with items=invoices %}
+ </div>
+</div>
+{% endblock second_column %}
+
+{% block third_column %}
+{% endblock third_column %}
+
+{% block crumbs %}
+<li class="active"><span class="divider"></span> <a href="{% url 'invoices-index' %}">{% trans "Invoices" %}</a></li>
+{% endblock crumbs %}
diff --git a/servo/templates/invoices/view_invoice.html b/servo/templates/invoices/view_invoice.html
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/servo/templates/invoices/view_invoice.html
diff --git a/servo/templates/login.html b/servo/templates/login.html
new file mode 100755
index 0000000..d7e6fac
--- /dev/null
+++ b/servo/templates/login.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="icon" type="image/png" href="{{ STATIC_URL }}images/favicon.png">
+ <link rel="apple-touch-icon" type="image/png" href="{{ STATIC_URL }}images/apple-touch-icon.png">
+ <script src="{{ STATIC_URL }}js/jquery.min.js"></script>
+ <script src="{{ STATIC_URL }}js/bootstrap/js/bootstrap.min.js"></script>
+ <link href="{{ STATIC_URL }}js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
+ <link href="{{ STATIC_URL }}css/login.css" rel="stylesheet">
+ <title>{{ title }} | Servo</title>
+</head>
+<body>
+{% if messages %}
+ {% for message in messages %}
+ <div class="alert alert-block alert-{{ message.tags }}">
+ <button type="button" class="close" data-dismiss="alert">&times;</button>
+ <i class="icon-warning-sign"></i> <strong>{{ message }}</strong>
+ </div>
+ {% endfor %}
+ {% endif %}
+ <div class="login-container">
+ {% block content %}{% endblock content %}
+ </div>
+</body>
+</html>
diff --git a/servo/templates/modal.html b/servo/templates/modal.html
new file mode 100755
index 0000000..d6f75db
--- /dev/null
+++ b/servo/templates/modal.html
@@ -0,0 +1,19 @@
+{% load i18n %}
+<div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal">&times;</button>
+ <h3>{% block header %} {{ title }} {% endblock header %}</h3>
+ </div>
+ <div class="modal-body">
+ {% block body %}
+ {% trans "This action cannot be undone." %}
+ {% endblock body %}
+ </div>
+ <div class="modal-footer">
+ {% block footer %}
+ <button type="submit" class="btn btn-primary" data-dismiss="modal">{% trans "Done" %}</button>
+ {% endblock footer %}
+ </div>
+ </div>
+</div>
diff --git a/servo/templates/notes/edit_escalation.html b/servo/templates/notes/edit_escalation.html
new file mode 100755
index 0000000..c4e34c1
--- /dev/null
+++ b/servo/templates/notes/edit_escalation.html
@@ -0,0 +1,17 @@
+{% extends "notes/view_note.html" %}
+{% load i18n %}
+
+{% block note_buttons %}
+{% endblock note_buttons %}
+
+{% block view_message %}
+ <form action="{{ request.path }}" method="post" class="form-horizontal" enctype="multipart/form-data">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ <div class="form-actions">
+ <div class="pull-right">
+ <button class="btn btn-primary" type="submit">{% trans "Submit" %}</button>
+ </div>
+ </div>
+ </form>
+{% endblock view_message %}
diff --git a/servo/templates/notes/find.html b/servo/templates/notes/find.html
new file mode 100755
index 0000000..1a55793
--- /dev/null
+++ b/servo/templates/notes/find.html
@@ -0,0 +1,39 @@
+{% extends "notes/list_notes.html" %}
+{% load i18n %}
+
+{% block second_row %}
+<div class="row-fluid" style="margin-top:30px">
+ <div class="span12">
+ <ul class="nav nav-tabs">
+ <li><a href="{% url 'notes-list_notes' 'inbox' %}">{% trans "Browse" %}</a></li>
+ <li class="active"><a href="{% url 'notes-find' %}">{% trans "Search" %}</a></li>
+ </ul>
+ </div>
+</div>
+<div class="row-fluid">
+ <div class="span12 well">
+ <form action="" method="get">
+ {% for field in form %}
+ <div class="control-group pull-left" style="margin-right:10px">
+ <label class="control-label">{{ field.label }}</label>
+ <div class="controls">{{ field }}</div>
+ </div>
+ {% endfor %}
+ <div class="control-group">
+ <label class="control-label">&nbsp;</label>
+ <div class="controls">
+ <button class="btn btn-primary pull-right" type="submit"><i class="icon-search icon-white"></i> {% trans "Search" %}</button>
+ </div>
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+ {% include "notes/search-results.html" %}
+ </div>
+ </div>
+</div>
+{% endblock second_row %}
diff --git a/servo/templates/notes/form.html b/servo/templates/notes/form.html
new file mode 100755
index 0000000..372da30
--- /dev/null
+++ b/servo/templates/notes/form.html
@@ -0,0 +1,112 @@
+{% extends "two_column_layout.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block first_column %}
+{% with note.order as order %}
+{% if order %}
+{% if order.customer %}
+{% include "orders/customer.html" with nodes=order.customer_list %}
+<hr/>
+{% endif %}
+{% for device in order.devices.all %}
+<p>
+ <strong>{{ device.description }}</strong><br/>
+ <small class="muted">{{ device.configuration }}</small><br/>
+ <small class="muted"><i class="icon-barcode"></i> {{ device.sn }}</small>
+</p>
+{% endfor %}
+<hr/>
+{% for p in order.products %}
+<small><strong>{{ p.code }}</strong></small><small class="pull-right">{{ p.price|currency }}</small><br/>
+<small class="muted">{{ p.title }}</small><br/>
+{% endfor %}
+<hr/>
+<strong>{% trans "Total" %}:</strong>
+<span class="pull-right"><strong>{{ order.gross_total|currency }}</strong></span>
+{% endif %}
+{% endwith %}
+{% endblock first_column %}
+
+{% block second_column %}
+
+<form action="" method="post" accept-charset="utf-8" enctype="multipart/form-data" class="form-horizontal">
+ {% csrf_token %}
+ {{ form.customer }}
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "Note" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Attachments" %}</a></li>
+ <li><a href="#tab3" data-toggle="tab">{% trans "Labels" %}</a></li>
+ <li><a href="#tab4" data-toggle="tab">{% trans "Escalation" %}</a></li>
+ </ul>
+ {{ formset.management_form }}
+ {{ form.order }}
+ {% if note.parent %}
+ {{ form.parent }}
+ {% endif %}
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ {% include "form_field_snippet.html" with field=form.recipient %}
+ {% include "form_field_snippet.html" with field=form.subject %}
+ {% include "form_field_snippet.html" with field=form.sender %}
+ {% include "form_field_snippet.html" with field=form.body %}
+ {% include "form_field_snippet.html" with field=form.is_reported %}
+ </div>
+ <div class="tab-pane" id="tab2">
+ {% for f in formset %}
+ {% include "form_snippet.html" with form=f %}
+ {% endfor %}
+ </div>
+ <div class="tab-pane" id="tab3">
+ {% include "form_field_snippet.html" with field=form.labels %}
+ </div>
+ <div class="tab-pane" id="tab4">
+ {% include "form_field_snippet.html" with field=escalation_form.issue_type %}
+ {% include "form_field_snippet.html" with field=escalation_form.status %}
+ {% include "form_field_snippet.html" with field=escalation_form.gsx_account %}
+ {% for k, v in contexts.items %}
+ <div class="control-group">
+ <select name="keys" class="control-label">
+ {% for i, f in fields %}
+ <option{% if i == k %} selected="selected"{% endif %} value="{{ i }}">{{ f }}</option>
+ {% endfor %}
+ </select>
+ <div class="controls">
+ <div class="input-append">
+ <input type="text" name="values" value="{{ v }}"/>
+ <a class="btn remove_field"><i class="icon-remove"></i></a>
+ </div>
+ </div>
+ </div>
+ {% endfor %}
+ <div class="control-group property">
+ <select name="keys" class="control-label">
+ {% for i, f in fields %}
+ <option value="{{ i }}">{{ f }}</option>
+ {% endfor %}
+ </select>
+ <div class="controls">
+ <div class="input-append">
+ <input type="text" name="values"/>
+ <a class="btn remove_field disabled"><i class="icon-remove"></i></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="form-actions">
+ {% if note.pk %}
+ <a class="btn btn-danger" href="{% url 'notes-delete_note' note.pk %}" data-modal="#modal">{% trans "Delete" %}</a>
+ {% endif %}
+ <input type="submit" class="btn btn-primary" value="{% trans "Save" %}"/>
+ </div>
+</form>
+{% endblock second_column %}
+
+{% block crumbs %}
+{% if note.order %}
+ <li><a href="{{ order.get_queue_url }}">{{ order.get_queue_title }}</a> <span class="divider">/</span></li>
+ <li><a href="{{ order.get_absolute_url }}">{% trans "Order" %} {{ order.code }}</a> <span class="divider">/</span></li>
+ <li class="active">{% trans "Edit Note" %}</li>
+{% endif %}
+{% endblock crumbs %}
diff --git a/servo/templates/notes/list_notes.html b/servo/templates/notes/list_notes.html
new file mode 100755
index 0000000..fdbc853
--- /dev/null
+++ b/servo/templates/notes/list_notes.html
@@ -0,0 +1,75 @@
+{% extends "default.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+<div class="btn-group">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-file"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'notes-create' %}">{% trans "New Message" %}</a></li>
+ <!--<li><a href="{% url 'notes-create_escalation' %}">{% trans "New Escalation" %}</a></li>//-->
+ </ul>
+</div>
+{% block note_buttons %}
+<div class="btn-group">
+ <a class="btn dropdown-toggle disabled" data-toggle="dropdown" href="#">
+ <i class="icon-flag"></i> <span class="caret"></span>
+ </a>
+</div>
+{% endblock note_buttons %}
+{% endblock toolbar %}
+
+{% block content %}
+
+{% block second_row %}
+<ul class="nav nav-tabs" style="margin-top:30px">
+ <li class="active"><a href="{% url 'notes-list_notes' 'inbox' %}">{% trans "Browse" %}</a></li>
+ <li><a href="{% url 'notes-find' %}">{% trans "Search" %}</a></li>
+</ul>
+
+<div class="row-fluid">
+ <div class="span2">
+ {% block first_column %}
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Messages" %}</li>
+ <li class="{% active request "inbox" %}"><a href="{% url 'notes-list_notes' kind="inbox" %}">{% trans "Inbox" %} <span class="badge pull-right">{{ inbox_count|safe }}</span></a></li>
+ <li class="{% active request "flagged" %}"><a href="{% url 'notes-list_notes' kind="flagged" %}">{% trans "Flagged" %}</a></li>
+ <li class="{% active request "sent" %}"><a href="{% url 'notes-list_notes' kind="sent" %}">{% trans "Sent" %}</a></li>
+ <!--<li class="{% active request "escalations" %}"><a href="{% url 'notes-list_notes' kind="escalations" %}">{% trans "Escalations" %}</a></li>//-->
+ </ul>
+ {% endblock first_column %}
+ </div>
+ <div class="span3">
+ {% block second_column %}
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans kind %}</li>
+ {% for note in notes %}
+ <li class="{% active request 'notes' kind note.pk 'view' %}">
+ <a href="{% url 'notes-view_note' kind note.pk %}">
+ <strong>{{ note.sender }}</strong><span class="pull-right">{{ note.created_at|date:"SHORT_DATE_FORMAT" }}</span>
+ <br/>
+ <small>{{ note.body|truncatechars:30 }}</small>
+ </a>
+ </li>
+ {% empty %}
+ <li class="disabled text-center"><a href="#">{% trans "No messages found" %}</a></li>
+ {% endfor %}
+ </ul>
+ {% include "pagination.html" with items=notes %}
+ {% endblock second_column %}
+ </div>
+ <div class="span7">
+ {% block view_message %}
+ <h2 class="muted text-center">{% trans "No message selected" %}</h2>
+ {% endblock view_message %}
+ </div>
+</div>
+{% endblock second_row %}
+
+{% endblock content %}
+
+{% block crumbs %}
+<li class="active">{% trans "Notes" %}</li>
+{% endblock crumbs %}
diff --git a/servo/templates/notes/messages.html b/servo/templates/notes/messages.html
new file mode 100644
index 0000000..84bbd42
--- /dev/null
+++ b/servo/templates/notes/messages.html
@@ -0,0 +1,22 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Message Log" %}
+{% endblock header %}
+
+{% block body %}
+<table class="table">
+ <tbody>
+ {% for m in messages %}
+ <tr>
+ <td>{{ m.sent_at|date:"SHORT_DATETIME_FORMAT" }}</td>
+ <td>{{ m.recipient }}</td>
+ <td>{{ m.status }}</td>
+ </tr>
+ {% empty %}
+ <tr><td colspan="3" class="muted empty">{% trans "No messages to display" %}</td></tr>
+ {% endfor %}
+ </tbody>
+</table>
+{% endblock body %}
diff --git a/servo/templates/notes/remove.html b/servo/templates/notes/remove.html
new file mode 100755
index 0000000..c79f4b1
--- /dev/null
+++ b/servo/templates/notes/remove.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Delete this note?" %}
+{% endblock header %}
+
+{% block body %}
+ <p>{% trans "This will also delete any replies to this note." %}</p>
+{% endblock body %}
+
+{% block footer %}
+ <form action="{% url 'notes-delete_note' note.pk %}" method="post">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/notes/search-results.html b/servo/templates/notes/search-results.html
new file mode 100755
index 0000000..a1ed78d
--- /dev/null
+++ b/servo/templates/notes/search-results.html
@@ -0,0 +1,25 @@
+{% load i18n %}
+{% load humanize %}
+{% load servo_tags %}
+
+<ul class="media-list">
+ {% for note in notes %}
+ <li class="media">
+ <a class="pull-left" href="#">
+ <img src="{{ note.created_by.get_avatar }}" alt="{{ note.created_by }}" title="{{ note.created_by }}" class="img-rounded avatar"/>
+ </a>
+ <div class="media-body">
+ <h5 class="media-heading">{{ note.get_sender_name }} {{ note.created_at|naturaltime }}{% if note.order %} <a href="{% url 'orders-edit' note.order.pk %}#note-{{ note.pk }}"><i class="icon-share-alt"></i></a>{% endif %}</h5>
+ {{ note.body|markdown }}
+ {% for a in note.attachments.all %}
+ <a class="label label-info window" href="{{ a.content.url }}"><i class="icon-download icon-white"></i> {{ a }}</a>
+ {% endfor %}
+ </div>
+ <hr/>
+ </li>
+ {% empty %}
+ <li class="muted empty">{% trans "No notes found" %}</li>
+ {% endfor %}
+</ul>
+
+{% include "pagination.html" with items=notes %}
diff --git a/servo/templates/notes/search.html b/servo/templates/notes/search.html
new file mode 100755
index 0000000..023bb07
--- /dev/null
+++ b/servo/templates/notes/search.html
@@ -0,0 +1,18 @@
+{% extends "notes/list_notes.html" %}
+{% load servo_tags %}
+{% load humanize %}
+{% load i18n %}
+
+{% block toolbar %}
+ <a href="{% url 'notes-create' %}" class="btn"><i class="icon-plus"></i> {% trans "Create Note" %}</a>
+{% endblock toolbar %}
+
+{% block content %}
+
+<div class="page-header">
+ <h1>{{ title }} <small>{{ subtitle }}</small></h1>
+</div>
+
+{% include "notes/search-results.html" %}
+
+{% endblock content %}
diff --git a/servo/templates/notes/templates.html b/servo/templates/notes/templates.html
new file mode 100755
index 0000000..e552791
--- /dev/null
+++ b/servo/templates/notes/templates.html
@@ -0,0 +1,10 @@
+<div class="btn-group pull-left">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-comment"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu template-select">
+ {% for t in templates %}
+ <li><a href="{{ t.get_absolute_url }}">{{ t.title }}</a></li>
+ {% endfor %}
+ </ul>
+</div>
diff --git a/servo/templates/notes/view_escalation.html b/servo/templates/notes/view_escalation.html
new file mode 100755
index 0000000..5609587
--- /dev/null
+++ b/servo/templates/notes/view_escalation.html
@@ -0,0 +1 @@
+{% extends "notes/view_note.html" %}
diff --git a/servo/templates/notes/view_note.html b/servo/templates/notes/view_note.html
new file mode 100755
index 0000000..05000f6
--- /dev/null
+++ b/servo/templates/notes/view_note.html
@@ -0,0 +1,38 @@
+{% extends "notes/list_notes.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block note_buttons %}
+ <div class="btn-group">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-flag"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'notes-toggle_flag' note.pk 'read' %}" class="nofollow">{{ note.get_read_title }}</a></li>
+ <li><a href="{% url 'notes-toggle_flag' note.pk 'flagged' %}" class="nofollow">{{ note.get_flagged_title }}</a></li>
+ </ul>
+ </div>
+{% endblock note_buttons %}
+
+{% block view_message %}
+ <div class="message-header">
+ <p>{% trans "From" %}: {{ note.sender }}</p>
+ {% if note.order.id %}
+ <p>{% trans "Service Order" %}: <a href="{% url 'orders-edit' note.order.id %}">{{ note.order.code }}</a></p>
+ {% endif %}
+ <p>{% trans "Created" %}: {{ note.created_at|relative_date }}</p>
+ <p>{% trans "Subject" %}: {{ note.subject }}</p>
+ </div>
+ <hr/>
+ {{ note.body|markdown }}
+ {% for a in note.attachments.all %}
+ <a class="label label-info window" href="{{ a.content.url }}"><i class="icon-download icon-white"></i> {{ a }}</a>
+ {% endfor %}
+ <div class="form-actions">
+ <div class="pull-right">
+ <a href="{% url 'servo.views.order.create' note_id=note.id %}" class="btn {% if note.order.id %} disabled {% endif %}">{% trans "Create Order" %}</a>
+ <a href="{% url 'notes-delete_note' note.id %}" class="btn btn-danger" data-modal="#modal">{% trans "Delete" %}</a>
+ <a href="{% url 'servo.views.note.edit' parent=note.id %}" class="btn btn-primary">{% trans "Reply" %}</a>
+ </div>
+ </div>
+{% endblock view_message %}
diff --git a/servo/templates/oauth/challenge.html b/servo/templates/oauth/challenge.html
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/servo/templates/oauth/challenge.html
diff --git a/servo/templates/orders/batch_process.html b/servo/templates/orders/batch_process.html
new file mode 100644
index 0000000..996eceb
--- /dev/null
+++ b/servo/templates/orders/batch_process.html
@@ -0,0 +1,14 @@
+{% extends "orders/index.html" %}
+{% load bootstrap3 %}
+{% load i18n %}
+
+{% block content %}
+ <h2>{% trans "Batch Processing" %}</h2>
+ <form action="" method="post">
+ {% csrf_token %}
+ {% bootstrap_form form %}
+ {% buttons %}
+ <button type="submit" class="btn btn-primary">{% trans "Submit" %}</button>
+ {% endbuttons %}
+ </form>
+{% endblock content %}
diff --git a/servo/templates/orders/checklists.html b/servo/templates/orders/checklists.html
new file mode 100755
index 0000000..b2f9e47
--- /dev/null
+++ b/servo/templates/orders/checklists.html
@@ -0,0 +1,10 @@
+{% load servo_tags %}
+{% for c in checklists %}
+ <h4>{{ c.title }} ({{ order.checklistitemvalue_set.all.count }}/{{ c.checklistitem_set.all.count }})</h4>
+ {% for i in c.checklistitem_set.all %}
+ <label class="checkbox" style="margin-left:8x">
+ <input type="checkbox" data-url="{% url 'orders-toggle_task' order.id i.id %}" class="toggle" {% if order|is_item_complete:i %}checked="checked"{% endif %}/> {{ i.title }} <i class="muted">{{ order|item_completed_by:i }}</i>
+ </label>
+ {% if forloop.last %}<hr/>{% endif %}
+ {% endfor %}
+{% endfor %}
diff --git a/servo/templates/orders/close.html b/servo/templates/orders/close.html
new file mode 100755
index 0000000..b80f862
--- /dev/null
+++ b/servo/templates/orders/close.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans 'Close order' %} {{ order.code }}?
+{% endblock header %}
+
+{% block body %}
+ <p>{% trans "This order will no longer be editable." %}</p>
+{% endblock body %}
+
+{% block footer %}
+<form action="{{ action }}" method="post" accept-charset="utf-8">
+ {% csrf_token %}
+ <button class="btn btn-primary" type="submit">{% trans "Close" %}</button>
+</form>
+{% endblock footer %}
diff --git a/servo/templates/orders/close_repair.html b/servo/templates/orders/close_repair.html
new file mode 100755
index 0000000..db50087
--- /dev/null
+++ b/servo/templates/orders/close_repair.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Complete the GSX repair?" %}
+{% endblock header %}
+
+{% block body %}
+ {% trans "The GSX repair will no longer be editable." %}
+{% endblock body %}
+
+{% block footer %}
+ <form method="post" action="close/">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger spin">{% trans "Complete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/orders/customer.html b/servo/templates/orders/customer.html
new file mode 100755
index 0000000..ccd9184
--- /dev/null
+++ b/servo/templates/orders/customer.html
@@ -0,0 +1,52 @@
+{% load i18n %}
+{% load mptt_tags %}
+{% load servo_tags %}
+{% recursetree nodes %}
+<address>
+ <strong><a href="{{ node.get_absolute_url }}"><i class="{{ node.get_icon }}"></i> {{ node.name }}</a></strong>
+ <div class="btn-group pull-right">
+ <a class="btn btn-small dropdown-toggle{% if order.is_closed %} disabled{% endif %}" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'orders-choose_customer' order.pk %}" data-modal="#modal">{% trans "Choose" %}</a></li>
+ {% if node.is_company %}
+ <li><a href="{% url 'customers-create_contact' parent_id=node.id %}">{% trans "Add contact" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Add contact" %}</a></li>
+ {% endif %}
+ <li><a href="{% url 'orders-create_with_customer' customer_id=node.id %}">{% trans "Create Order" %}</a></li>
+ <li class="divider"></li>
+ <li><a href="{% url 'customers-edit_customer' group=node.get_group pk=node.pk %}">{% trans "Edit" %}</a></li>
+ {% if node.is_leaf_node %}
+ <li><a href="{% url 'orders-remove_customer' pk=order.pk customer_id=node.pk %}" data-modal="#modal">{% trans "Remove" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#" data-modal="#modal">{% trans "Remove" %}</a></li>
+ {% endif %}
+ </ul>
+ </div>
+ <br/>
+ {% if node.email %}
+ <a href="{% url 'notes-create_with_to_and_order' recipient=node.email order_id=order.id %}">{{ node.email }}</a><br/>
+ {% endif %}
+ {% if node.phone %}
+ <a href="{% url 'notes-create_with_to_and_order' recipient=node.get_standard_phone order_id=order.id %}">{{ node.get_national_phone }}</a><br/>
+ {% endif %}
+ {% if node.street_address %}
+ {{ node.street_address }}<br/>
+ {{ node.zip_code }} {{ node.city }}
+ {% endif %}
+ {% with node.fullprops.items as props %}
+ {% if props %}
+ <br/>
+ {% for k, v in props %}
+ {{ k }}: {{ v }}<br/>
+ {% endfor %}
+ {% endif %}
+ {% endwith %}
+ {% if node.notes %}
+ <p><small class="muted">{{ node.notes|default:"" }}</small></p>
+ {% endif %}
+</address>
+{{ children }}
+{% endrecursetree %}
diff --git a/servo/templates/orders/delete_order.html b/servo/templates/orders/delete_order.html
new file mode 100755
index 0000000..ee44fc6
--- /dev/null
+++ b/servo/templates/orders/delete_order.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% blocktrans with id=order.code%}Really delete order {{ id }}? {% endblocktrans %}
+{% endblock header %}
+
+{% block body %}
+ <p>{% trans "This will also delete all the order's notes. This action cannot be undone." %}</p>
+{% endblock body %}
+
+{% block footer %}
+ <form action="{{ action }}" method="post" accept-charset="utf-8">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger pull-right">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/orders/devices.html b/servo/templates/orders/devices.html
new file mode 100755
index 0000000..271a4ec
--- /dev/null
+++ b/servo/templates/orders/devices.html
@@ -0,0 +1,139 @@
+{% load i18n %}
+{% load servo_tags %}
+
+{% for d in order.orderdevice_set.all %}
+{% with d.device as device %}
+<div class="row-fluid">
+ <div class="span3">
+ <img src="{{ device.get_photo }}" alt="{{ device.description }}" title="{{ device.description }}"/>
+ </div>
+ <div class="span9">
+ <h3>{{ device.description }}</h3>
+ {% if d.is_repeat_service %}
+ <span class="label label-important pull-right">{% trans "Repeat Service" %}</span>
+ {% endif %}
+ <dl class="dl-horizontal">
+ <dt>{% trans "Warranty Status" %}</dt>
+ <dd>{{ device.get_warranty_status_display }}</dd>
+ <dt>{% trans "Purchase Date" %}</dt>
+ <dd>{{ device.purchased_on|date:"SHORT_DATE_FORMAT"|default:"-" }}, {{ device.get_purchase_country|default:"-" }}</dd>
+ <dt>{% trans "Serial Number" %}</dt>
+ <dd>{{ device.sn|default:"-" }}</dd>
+ {% if device.configuration %}
+ <dt>{% trans "Configration" %}</dt>
+ <dd>{{ device.configuration }}</dd>
+ {% endif %}
+ {% if device.imei %}
+ <dt>{% trans "IMEI" %}</dt>
+ <dd>{{ device.imei }}</dd>
+ <dt>{% trans "Applied Activation Policy" %}</dt>
+ <dd>{{ device.applied_activation_policy }}</dd>
+ <dt>{% trans "Initial Activation Policy" %}</dt>
+ <dd>{{ device.initial_activation_policy }}</dd>
+ <dt>{% trans "Find My iPhone" %}</dt>
+ <dd>{{ device.get_fmip_status }}</dd>
+ <dt>{% trans "Unlocked" %}</dt>
+ <dd>{{ device.unlocked|yesno }}</dd>
+ {% endif %}
+ {% if device.username %}
+ <dt>{% trans "Username" %}</dt>
+ <dd>{{ device.username }}</dd>
+ {% endif %}
+ {% if device.password %}
+ <dt>{% trans "Password" %}</dt>
+ <dd>{{ device.password }}</dd>
+ {% endif %}
+ {% if device.get_coverage_details %}
+ <dt>{% trans "Details" %}</dt>
+ <dd>{{ device.get_coverage_details|join:"<br/>" }}</dd>
+ {% endif %}
+ {% if device.notes %}
+ <dt>{% trans "Notes" %}</dt>
+ <dd>{{ device.notes }}</dd>
+ {% endif %}
+ {% with device|device_accessories:order as accessories %}
+ {% if accessories.count %}
+ <dt>{% trans "Accessories" %}</dt>
+ <dd>{{ accessories|join:", " }}</dd>
+ {% endif %}
+ {% endwith %}
+ </dl>
+ {% if order.queue %}
+ <a href="{% url 'orders-list_parts' order.id device.id order.queue_id %}" class="btn btn-small"><i class="icon-wrench"></i> {% trans "Parts" %}</a>
+ {% else %}
+ <a class="btn btn-small disabled" title="{% trans "Assign order to a queue first" %}"><i class="icon-wrench"></i> {% trans "Parts" %}</a>
+ {% endif %}
+ {% if order.is_editable %}
+ <a href="{% url 'orders-accessories' order.id device.id %}" class="btn btn-small" data-modal="#modal"><i class="icon-hdd"></i> {% trans "Accessories" %}</a>
+ {% else %}
+ <a class="btn btn-small disabled" href="#"><i class="icon-hdd"></i> {% trans "Accessories" %}</a>
+ {% endif %}
+ <a href="{% url 'orders-history' order.pk device.pk %}" class="btn btn-small" data-modal="#modal"><i class="icon-time"></i> {% trans "History" %}</a>
+ <div class="btn-group">
+ <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% if order.can_create_carryin and device.can_create_carryin %}
+ <li><a href="{% url 'repairs-create_repair' order.id device.id 'CA' %}">{% trans "Create Carry-In Repair" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#" title="{% trans "Device has open GSX repairs" %}">{% trans "Create Carry-In Repair" %}</a></li>
+ {% endif %}
+ {% if order.can_create_carryin and device.can_create_carryin and device.has_onsite %}
+ <li><a href="{% url 'repairs-create_repair' order.id device.id 'ON' %}">{% trans "Create Onsite Repair" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Create Onsite Repair" %}</a></li>
+ {% endif %}
+ {% if order.can_create_carryin and device.can_create_carryin and 0 %}
+ <li><a href="{% url 'repairs-create_repair' order.id device.id 'RR' %}">{% trans "Create Whole-Unit Exchange" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Create Whole-Unit Exchange" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ <li><a href="{% url 'devices-update_gsx_details' device.pk %}" class="spin">{% trans "Update Warranty Status" %}</a></li>
+ <li class="divider"></li>
+ {% if device.is_ios %}
+ <li><a href="{% url 'devices-diagnostics' device.pk %}?a=init&amp;order={{ order.pk|safe }}" data-modal="#modal">{% trans "Initiate Diagnostics" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#" data-modal="#modal">{% trans "Fetch Diagnostics" %}</a></li>
+ {% endif %}
+ <li><a href="{% url 'devices-diagnostics' device.pk %}" data-modal="#modal">{% trans "Fetch Diagnostics" %}</a></li>
+ <li class="divider"></li>
+ <li><a href="{{ device.get_absolute_url }}">{% trans "Show Device" %}</a></li>
+ {% if device.sn == '' %}
+ <li class="disabled"><a href="#" target="_blank">{% trans "Show Barcode" %}</a></li>
+ {% else %}
+ <li><a href="{% url 'barcodes-view' device.sn %}?f=svg" target="_blank">{% trans "Show Barcode" %}</a></li>
+ {% endif %}
+ </ul>
+ </div>
+<div class="pull-right">
+ <div class="btn-group">
+ {% if d.should_report %}
+ <a href="{% url 'orders-report_device' order.pk d.pk %}" class="btn btn-success btn-small nofollow active" title="{% trans "Report" %}" data-toggle="button"><i class="icon-ok"></i></a>
+ {% else %}
+ <a href="{% url 'orders-report_device' order.pk d.pk %}" class="btn btn-success btn-small nofollow" title="{% trans "Report" %}" data-toggle="button"><i class="icon-ok icon-white"></i></a>
+ {% endif %}
+ </div>
+ <div class="btn-group">
+ {% if order.is_editable %}
+ <a href="{{ device.get_absolute_url }}edit/" class="btn btn-warning btn-small" title="{% trans "Edit" %}"><i class="icon-pencil icon-white"></i></a>
+ <a href="{% url 'orders-delete_device' order.id device.id %}" class="btn btn-small btn-danger" data-modal="#modal" title="{% trans "Remove" %}"><i class="icon-trash icon-white"></i></a>
+ {% endif %}
+ </div>
+</div>
+</div>
+</div>
+<hr/>
+{% endwith %}
+{% empty %}
+<div class="row-fluid">
+ <div class="span12">
+ <div class="empty well"><h3 class="muted">{% trans "Order doesn't contain any devices" %}</h3></div>
+ </div>
+</div>
+{% endfor %}
+<p class="clearfix">
+ <a href="{% url 'devices-choose' order.pk %}" class="btn pull-right {% if order.is_closed %}disabled{% endif %}" data-modal="#modal"><i class="icon-plus"></i> {% trans "Add Device" %}</a>
+</p>
+<hr/>
diff --git a/servo/templates/orders/dispatch.html b/servo/templates/orders/dispatch.html
new file mode 100755
index 0000000..f7ea0fb
--- /dev/null
+++ b/servo/templates/orders/dispatch.html
@@ -0,0 +1,115 @@
+{% extends "orders/edit.html" %}
+{% load staticfiles %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block content %}
+<div class="page-header">
+ {% with order.status_title as stat %}
+ <h3 style="margin-top:0px;line-height:30px" title="{{ title }}">{{ title|truncatechars:40 }}<br/>
+ <img src="{% static order.get_status_img %}" title="{{ stat }}" alt="{{ stat }}"/><small style="padding-left:5px">{{ order.get_title }} {% if order.user %}({{ order.user.get_full_name }}){% endif %}</small></h3>
+ {% endwith %}
+</div>
+<form method="post" action="" accept-charset="utf8">
+ {% csrf_token %}
+ {{ formset.management_form }}
+ <div class="row-fluid">
+ <div class="span3">
+ <div class="row-fluid">
+ <fieldset>
+ <legend>{% trans "Customer" %}</legend>
+ <div class="row-fluid">
+ {% include "form_field_snippet.html" with field=form.customer_name %}
+ </div>
+ <div class="row-fluid">
+ {% include "form_field_snippet.html" with field=form.customer_email %}
+ </div>
+ <div class="row-fluid">
+ {% include "form_field_snippet.html" with field=form.customer_phone %}
+ </div>
+ <div class="row-fluid">
+ {% include "form_field_snippet.html" with field=form.customer_address %}
+ </div>
+ <div class="row-fluid">
+ {% include "form_field_snippet.html" with field=form.reference %}
+ </div>
+ </fieldset>
+ </div>
+ <div class="row-fluid">
+ <fieldset>
+ <legend>{% trans "Payment" %}</legend>
+ {% for f in formset %}
+ <div class="row-fluid formrow">
+ <div class="span8">
+ {{ f.created_by }}
+ {{ f.method }}
+ </div>
+ <div class="span4">
+ {{ f.amount }}
+ </div>
+ </div>
+ {% endfor %}
+ <button class="btn clonerow" type="button" data-prefix="payment"><i class="icon-plus"></i></button>
+ </fieldset>
+ </div>
+ </div>
+ <div class="span9">
+ <fieldset>
+ <legend>{% trans "Products" %}</legend>
+ <table class="table">
+ <thead>
+ <tr>
+ <th style="width:20px"></th>
+ <th>{% trans "Product" %}</th>
+ <th style="width:50px">{% trans "Qty" %}</th>
+ <th style="width:100px">{% trans "Price" %}</th>
+ <th style="width:100px">{% trans "Price w/ tax" %}</th>
+ <th style="width:100px">{% trans "Total" %}</th>
+ </tr>
+ </thead>
+ <tbody>{% for p in products %}
+ <tr>
+ <td><input type="checkbox" name="items" value="{{ p.id|safe }}" checked="checked" class="toggle_row"/></td>
+ <td><strong>{{ p.product.code }}</strong><br/>{{ p.product.title }}</td>
+ <td class="amount">{{ p.amount }}</td>
+ <td class="net">{{ p.price_notax|currency }}</td>
+ <td class="tax">{{ p.price|currency }}</td>
+ <td class="gross">{{ p.total_gross|currency }}</td>
+ </tr>{% endfor %}
+ </tbody>
+ <tfoot>
+ <tr>
+ <td></td>
+ <td style="text-align:right">{% trans "Total" %}:</td>
+ <td>{{ totals.amount }}</td>
+ <td>{{ form.total_net }}</td>
+ <td>{{ form.total_tax }}</td>
+ <td>{{ form.total_gross }}</td>
+ </tr>
+ </tfoot>
+ </table>
+ </fieldset>
+ </div>
+ </div>
+ <div class="form-actions">
+ <div class="pull-right">
+ <a class="btn btn-default" href="{{ order.get_absolute_url }}">{% trans "Cancel" %}</a>
+ <button type="submit" class="btn btn-primary">{% trans "Dispatch" %}</button>
+ </div>
+ </div>
+</form>
+{% endblock content %}
+
+{% block crumbs %}
+ <li><a href="{{ order.get_queue_url }}">{{ order.get_queue_title }}</a> <span class="divider">/</span></li>
+ <li><a href="{% url 'orders-edit' order.id %}">{% trans "Order" %} {{ order.get_footer }}</a> <span class="divider">/</span></li>
+ <li class="active">{% trans "Dispatch" %}</li>
+{% endblock crumbs %}
+
+{% block media %}
+<script type="text/javascript">
+ $('.clonerow').click(function() {
+ cloneMore('.formrow:last', 'payment', true);
+ });
+</script>
+{% endblock media %}
diff --git a/servo/templates/orders/edit.html b/servo/templates/orders/edit.html
new file mode 100755
index 0000000..c340585
--- /dev/null
+++ b/servo/templates/orders/edit.html
@@ -0,0 +1,115 @@
+{% extends "default.html" %}
+{% load staticfiles %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+{% include "orders/toolbar.html" %}
+{% endblock toolbar %}
+
+{% block content %}
+ <div class="page-header">
+ <div class="row-fluid">
+ <div class="span6">
+ {% with order.status_title as stat %}
+ <h3 style="margin-top:0px;line-height:30px" title="{{ title }}">{{ title|truncatechars:40 }}<br/>
+ <img src="{% static order.get_status_img %}" title="{{ stat }}" alt="{{ stat }}"/><small style="padding-left:5px">{{ order.get_title }} {% if order.user %}({{ order.user.get_full_name }}){% endif %}</small></h3>
+ {% endwith %}
+ </div>
+ <div class="span6">
+ {% if locations.count > 1 %}
+ <div class="pull-right" style="padding:5px">
+ <div class="btn-group">
+ <a class="btn dropdown-toggle{% if order.is_closed %} disabled{% endif %}" data-toggle="dropdown" href="#" title="{% trans "Checkin Location" %}: {{ order.checkin_location.title }}">
+ <i class="halflings log_in"></i> {{ order.checkin_location.title|truncatechars:10 }} <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% for l in locations %}
+ <li{% ifequal l order.checkin_location %} class="active"{% endifequal %}><a href="{% url 'orders-update' order.pk 'checkin' l.pk %}">{{ l.title }}</a></li>
+ {% endfor %}
+ </ul>
+ </div>
+ <div class="btn-group">
+ <a class="btn dropdown-toggle{% if order.is_closed %} disabled{% endif %}" data-toggle="dropdown" href="#" title="{% trans "Current Location" %}: {{ order.location.title }}">
+ <i class="icon-map-marker"></i> {{ order.location.title|truncatechars:10 }} <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% for l in locations %}
+ <li{% ifequal l order.location %} class="active"{% endifequal %}><a href="{% url 'orders-update' order.pk 'location' l.pk %}">{{ l.title }}</a></li>
+ {% endfor %}
+ </ul>
+ </div>
+ <div class="btn-group">
+ <a class="btn dropdown-toggle{% if order.is_closed %} disabled{% endif %}" data-toggle="dropdown" href="#" title="{% trans "Checkout Location" %}: {{ order.checkout_location.title }}">
+ <i class="halflings log_out"></i> {{ order.checkout_location.title|truncatechars:10 }} <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu pull-right">
+ {% for l in locations %}
+ <li{% ifequal l order.checkout_location %} class="active"{% endifequal %}><a href="{% url 'orders-update' order.pk 'checkout' l.pk %}">{{ l.title }}</a></li>
+ {% endfor %}
+ </ul>
+ </div>
+ </div>
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ <ul class="nav nav-tabs">
+ {% block tabs %}
+ {% include "orders/tabs.html" with active='order' %}
+ {% endblock tabs %}
+ </ul>
+ <div class="row-fluid">
+ <div class="span3" id="order_meta">
+ {% block first_column %}
+ {% if order.customer %}
+ {% include "orders/customer.html" with nodes=customer %}
+ {% else %}
+ <div class="well text-center">
+ <a href="{% url 'orders-choose_customer' order.pk %}" class="btn" data-modal="#modal"><i class="icon-search"></i> {% trans "Select Customer" %}</a>
+ </div>
+ {% endif %}
+ <hr/>
+ {% include "orders/checklists.html" %}
+ {% include "orders/followers.html" %}
+ <hr/>
+ <form method="post" action="{% url 'orders-update' order.pk "place" 0 %}" style="margin-bottom:0px">
+ {% csrf_token %}
+ <label><i class="icon-map-marker"></i> {% trans "Place" %}</label>
+ <input type="text" name="place" class="input typeahead span12" placeholder="{% trans "Enter place" %}" data-provide="typeahead" data-source="{% url 'api-places' %}"/>
+ </form>
+ {% if order.place %}
+ <div class="clearfix">
+ <span class="label label-info">{{ order.place }}</span>
+ </div>
+ {% else %}
+ <p class="muted text-center">{% trans "No place" %}</p>
+ {% endif %}
+ <hr/>
+ <form method="post" action="{% url 'orders-update' order.pk "label" 0 %}" style="margin-bottom:0px">
+ {% csrf_token %}
+ <label><i class="icon-tag"></i> {% trans "Label" %}</label>
+ <input type="text" name="label" class="input typeahead span12" placeholder="{% trans "Enter label" %}" data-provide="typeahead" data-source="{% url 'api-tags' %}"/>
+ </form>
+ {% for t in order.tags.all %}
+ <span class="label label-{{ t.color }}"><div class="pull-left">{{ t.title }}</div><a class="close" href="{% url 'orders-toggle_tag' order.pk t.pk %}"><i class="icon-remove icon-white"></i></a></span>
+ {% empty %}
+ <p class="muted text-center">{% trans "No labels" %}</p>
+ {% endfor %}
+ {% endblock first_column %}
+ </div><!-- //# order sidebar -->
+
+ <div class="span9">
+ {% block second_column %}
+ {% include "orders/devices.html" %}
+ {% include "orders/notes.html" with notes=order.notes %}
+ {% include "orders/products.html" %}
+ {% endblock second_column %}
+ </div>
+ </div>
+ {% endblock content %}
+
+ {% block crumbs %}
+ <li><a href="{{ order.get_queue_url }}">{{ order.get_queue_title }}</a> <span class="divider">/</span></li>
+ {% block morecrumbs %}<li class="active">{% trans "Order" %} {{ order.get_footer }}</li>{% endblock morecrumbs %}
+ {% endblock crumbs %}
diff --git a/servo/templates/orders/edit_product.html b/servo/templates/orders/edit_product.html
new file mode 100755
index 0000000..0bcb710
--- /dev/null
+++ b/servo/templates/orders/edit_product.html
@@ -0,0 +1,33 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block body %}
+
+<form method="post" action="{{ request.path }}" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_field_snippet.html" with field=form.title %}
+ {% include "form_field_snippet.html" with field=form.amount %}
+ {% include "form_field_snippet.html" with field=form.price_category %}
+ {% include "form_field_snippet.html" with field=form.price %}
+ {% if product.is_serialized %}
+ {% include "form_field_snippet.html" with field=form.sn %}
+ {% include "form_field_snippet.html" with field=form.kbb_sn %}
+ {% include "form_field_snippet.html" with field=form.imei %}
+ {% endif %}
+ {% if product.component_code %}
+ {% include "form_field_snippet.html" with field=form.comptia_code %}
+ {% include "form_field_snippet.html" with field=form.comptia_modifier %}
+ {% endif %}
+ {% include "form_field_snippet.html" with field=form.should_report %}
+</form>
+
+<script type="text/javascript">
+ {% autoescape off %}
+ var prices = {{ prices }};
+ {% endautoescape %}
+ $('#id_price_category').change(function(){
+ $('#id_price').val(prices[$(this).val()]);
+ });
+</script>
+
+{% endblock body %}
diff --git a/servo/templates/orders/events.html b/servo/templates/orders/events.html
new file mode 100755
index 0000000..389e22a
--- /dev/null
+++ b/servo/templates/orders/events.html
@@ -0,0 +1,21 @@
+{% extends "orders/edit.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block tabs %}
+{% include "orders/tabs.html" with active='events' %}
+{% endblock tabs %}
+
+{% block second_column %}
+<table class="table">
+ <tbody>
+ {% for event in order.events.all %}
+ <tr>
+ <td><img src="{{ STATIC_URL }}images/{{ event.get_icon }}.png" alt="{{ event.description }}" class="icon"/></td>
+ <td style="width:55%">{{ event.description }}</td>
+ <td style="text-align:right">{{ event.triggered_by }}, {{ event.triggered_at|relative_date }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
+{% endblock second_column %}
diff --git a/servo/templates/orders/followers.html b/servo/templates/orders/followers.html
new file mode 100755
index 0000000..ce020bd
--- /dev/null
+++ b/servo/templates/orders/followers.html
@@ -0,0 +1,28 @@
+{% load i18n %}
+
+<form method="post" action="{% url 'orders-update' order.pk "user" 0 %}" style="margin-bottom:0px">
+ {% csrf_token %}
+ <label><i class="icon-user"></i> {% trans "Followers" %}</label>
+ <input type="text" name="user" class="input typeahead span12" placeholder="{% trans "Enter name" %}" data-provide="typeahead" data-source="{% url 'api-users' %}?is_active=1"/>
+</form>
+{% for i in followers %}
+<div class="clearfix">
+ {% with i.get_full_name|truncatechars:26 as fullname %}
+ {% if i == order.user %}
+ <span class="label label-info pull-left">{{ fullname }}</span>
+ {% else %}
+ <span class="label pull-left">{{ fullname }}</span>
+ {% endif %}
+ {% endwith %}
+ <div class="btn-group pull-right">
+ {% if i == order.user %}
+ <a href="#" class="btn btn-small btn-primary active disabled" title="{% trans "Make primary" %}"><i class="icon-user icon-white"></i></a>
+ {% else %}
+ <a href="{% url 'orders-update' order.pk 'user' i.pk %}" class="btn btn-small" title="{% trans "Make primary" %}"><i class="icon-user"></i></a>
+ {% endif %}
+ <a href="{% url 'orders-remove_user' order.pk i.pk %}" class="btn btn-small" title="{% trans "Remove" %}"><i class="icon-remove"></i></a>
+ </div>
+</div>
+{% empty %}
+<p class="muted text-center">{% trans "No followers" %}</p>
+{% endfor %}
diff --git a/servo/templates/orders/gsx_repair_form.html b/servo/templates/orders/gsx_repair_form.html
new file mode 100755
index 0000000..512ce5a
--- /dev/null
+++ b/servo/templates/orders/gsx_repair_form.html
@@ -0,0 +1,94 @@
+{% extends "default.html" %}
+{% load staticfiles %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block content %}
+<div class="page-header">
+{% with order.status_title as stat %}
+ <h3 style="margin-top:0px;line-height:30px" title="{{ title }}">{{ title|truncatechars:40 }}<br/>
+ <img src="{% static order.get_status_img %}" title="{{ stat }}" alt="{{ stat }}"/><small style="padding-left:5px">{{ order.get_title }} {% if order.user %}({{ order.user.get_full_name }}){% endif %}</small></h3>
+{% endwith %}
+</div>
+<ul class="nav nav-tabs">
+ {% block tabs %}
+ {% include "orders/tabs.html" %}
+ {% endblock tabs %}
+</ul>
+
+<div class="row-fluid">
+ <form method="post" accept-charset="utf-8" action="#" class="form-horizontal spin" enctype="multipart/form-data" id="repair_form">
+ <div class="span3">
+ {% csrf_token %}
+ {{ repair_form.device }}
+ <strong>{{ device.description }}</strong>
+ <p>
+ <small class="muted">{{ device.get_warranty_status_display }}</small><br/>
+ <small class="muted">{{ device.configuration }}</small><br/>
+ <small class="muted"><i class="icon-barcode"></i> {{ device.sn }}</small>
+ </p>
+ <hr/>
+ <strong>{% trans "Parts" %}</strong>
+ <div class="async" data-url="{% url 'repairs-check_parts' repair.pk %}"><p class="text-center muted">{% trans "Checking warranty" %}...</p></div>
+ <hr/>
+ <strong>{% trans "Total" %}:</strong>
+ <span class="pull-right"><strong>{{ order.gross_total|currency }}</strong></span>
+ </div>
+ <div class="span9">
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "Repair" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Details" %}</a></li>
+ {% if component_form %}
+ <li><a href="#tab4" data-toggle="tab">{% trans "Components" %}</a></li>
+ {% endif %}
+ <li><a href="#tab3" data-toggle="tab">{% trans "Customer" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ {% include "form_field_snippet.html" with field=repair_form.symptom %}
+ {% include "form_field_snippet.html" with field=repair_form.diagnosis %}
+ {% include "form_field_snippet.html" with field=repair_form.tech_id %}
+ </div>
+ <div class="tab-pane" id="tab2">
+ {% include "form_field_snippet.html" with field=repair_form.notes %}
+ {% include "form_field_snippet.html" with field=repair_form.unit_received_at %}
+ {% include "form_field_snippet.html" with field=repair_form.attachment %}
+ {% include "form_field_snippet.html" with field=repair_form.reference %}
+ {% include "form_field_snippet.html" with field=repair_form.consumer_law %}
+ {% include "form_field_snippet.html" with field=repair_form.request_review %}
+ {% if repair.can_mark_complete %}
+ {% include "form_field_snippet.html" with field=repair_form.replacement_sn %}
+ {% include "form_field_snippet.html" with field=repair_form.mark_complete %}
+ {% endif %}
+ </div>
+ <div class="tab-pane" id="tab3">
+ {% include "form_snippet.html" with form=customer_form %}
+ </div>
+ <div class="tab-pane" id="tab4">
+ {% include "form_snippet.html" with form=component_form %}
+ </div>
+ </div>
+ <div class="form-actions">
+ <label class="checkbox pull-left">
+ <input type="checkbox" name="confirm" id="id_confirm"> {% trans "Confirm" %}
+ </label>
+ <div class="pull-right">
+ {% if repair.pk %}
+ <a class="btn btn-danger" href="{% url 'repairs-delete_repair' repair.pk %}" data-modal="#modal">{% trans "Delete" %}</a>
+ {% endif %}
+ <button type="submit" class="btn" id="save-bulk-return" data-placeholder="{% trans "Submit" %}">{% trans "Save" %}</button>
+ </div>
+ </div>
+ </div>
+ </form>
+</div>
+{% endblock content %}
+
+{% block crumbs %}
+<li><a href="{{ order.get_queue_url }}">{{ order.get_queue_title }}</a> <span class="divider">/</span></li>
+<li class="active">{% trans "Order" %} {{ order.code }}</li>
+{% endblock crumbs %}
+
+{% block media %}
+{{ repair_form.media }}
+{% endblock media %}
diff --git a/servo/templates/orders/history.html b/servo/templates/orders/history.html
new file mode 100644
index 0000000..5a908b9
--- /dev/null
+++ b/servo/templates/orders/history.html
@@ -0,0 +1,9 @@
+{% extends "modal.html" %}
+{% load i18n %}
+{% block header %}
+ {% trans "Order History" %}
+{% endblock header %}
+
+{% block body %}
+ {% include "orders/list.html" %}
+{% endblock body %}
diff --git a/servo/templates/orders/index.html b/servo/templates/orders/index.html
new file mode 100755
index 0000000..21116d5
--- /dev/null
+++ b/servo/templates/orders/index.html
@@ -0,0 +1,55 @@
+{% extends "default.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+{% if perms.servo.add_order %}
+ <a href="{% url 'orders-create' %}" class="btn"><i class="icon-plus"></i> {% trans "Create Order" %}</a>
+ {% if request.session.order_queryset %}
+ <a href="{% url 'orders-download_results' %}" class="btn"><i class="icon-download"></i> {% trans "Download Results" %}</a>
+ {% endif %}
+{% else %}
+ <a href="#" class="btn disabled"><i class="icon-plus"></i> {% trans "Create Order" %}</a>
+{% endif %}
+{% endblock toolbar %}
+
+{% block content %}
+<div class="page-header clearfix">
+ <div class="pull-left">
+ <h2><i class="glyphicons-icon inbox_in"></i> {{ title }}<br/><small style="margin-left:60px">{{ subtitle }}</small></h2>
+ </div>
+ <form class="form-search pull-right">
+ <div class="input-append">
+ <input type="text" class="search-query filter" placeholder="{% trans "Filter results" %}"/>
+ <button type="button" class="btn" data-toggle="collapse" data-target="#collapsable"><i class="icon-search"></i></button>
+ </div>
+ </form>
+</div>
+
+<div id="collapsable" class="collapse out">
+ <div class="well clearfix">
+ <form action="" method="get" class="form-inline">
+ {% for field in form %}
+ <div class="control-group pull-left">
+ <label class="control-label">{{ field.label }}</label>
+ <div class="controls">{{ field }}</div>
+ </div>
+ {% endfor %}
+ <p class="clearfix"><hr/></p>
+ <div class="pull-right">
+ <a class="btn" href="{% url 'orders-index' %}?state=0"><i class="icon-refresh"></i> {% trans "Reset" %}</a>
+ <button class="btn btn-primary" type="submit"><i class="icon-search icon-white"></i> {% trans "Search" %}</button>
+ </div>
+ </form>
+ </div>
+</div>
+
+{% block second_column %}
+{% include "orders/list.html" %}
+{% endblock second_column %}
+
+{% endblock content %}
+
+{% block crumbs %}
+<li><a href="{% url 'orders-index' %}">{% trans "Orders" %}</a></li>
+{% endblock crumbs %}
diff --git a/servo/templates/orders/list.html b/servo/templates/orders/list.html
new file mode 100755
index 0000000..2e5347b
--- /dev/null
+++ b/servo/templates/orders/list.html
@@ -0,0 +1,43 @@
+{% load staticfiles %}
+{% load servo_tags %}
+{% load humanize %}
+{% load cache %}
+{% load i18n %}
+
+<table class="table table-hover sortable">
+ <thead>
+ <tr>
+ <th style="width:60px">{% trans "Order" %}</th>
+ <th>{% trans "Customer" %}</th>
+ <th>{% trans "Created" %}</th>
+ <th>{% trans "Assigned to" %}</th>
+ <th>{% trans "Status" %}</th>
+ <th data-defaultsort="disabled"></th>
+ </tr>
+ </thead>
+ <tbody class="searchable">
+ {% for order in orders %}
+ <tr>
+ <td><a href="{{ order.get_absolute_url }}">{{ order.code }}</a></td>
+ <td data-value="{{ order.customer_name }}">{% if order.customer_name %}<strong>{{ order.customer_name }}</strong>{% else %}<span class="muted">{% trans "No customer" %}</span>{% endif %}<br/>{% if order.description %}{{ order.description }}{% else %}<span class="muted">{% trans "No description" %}</span>{% endif %} {% cache 120 order_tags order.pk %} {% for t in order.tags.all %}<span class="label label-{{ t.color }}">{{ t.title }}</span>&nbsp;{% endfor %}{% endcache %}</td>
+ <td data-value="{{ order.created_at|date:"U" }}">{{ order.created_at|naturaltime }}<br/><small class="muted">{{ order.created_at|date:"SHORT_DATETIME_FORMAT" }}</small></td>
+ <td>
+ {% if order.user %}
+ {{ order.get_user_name }}<br/>
+ <small class="muted">{{ order.started_at|naturaltime|default:"" }}</small>
+ {% else %}
+ <span class="muted">{% trans "Nobody" %}</span>
+ {% endif %}
+ <td data-value="{{ order.status_name }}">{% if order.status_name %}{{ order.status_name }}{% else %}<span class="muted">{% trans "No status" %}</span>{% endif %}<br/><small class="muted">{{ order.status_started_at|naturaltime|default:"" }}</small></td>
+ <td><img src="{% static order.get_status_img %}" title="{{ order.status_name }}" alt="{{ order.status_name }}" class="status_color"/></td>
+ </tr>
+ {% empty %}
+ <tr>
+ <td colspan="6" class="empty muted">{% trans "No orders found" %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% if orders.paginator %}
+ {% include "pagination.html" with items=orders %}
+ {% endif %}
diff --git a/servo/templates/orders/list_products.html b/servo/templates/orders/list_products.html
new file mode 100755
index 0000000..051c9fe
--- /dev/null
+++ b/servo/templates/orders/list_products.html
@@ -0,0 +1,22 @@
+{% load i18n %}
+{% load servo_tags %}
+
+<div id="products">
+ <ul class="unstyled" data-url="{% url 'orders-list_products' order.pk %}">
+ {% for p in order.products %}
+ <li>
+ <small><strong>{{ p.code }}</strong></small><small class="pull-right">{{ p.price|currency }}</small>
+ <br/>
+ <small class="muted">{{ p.title }} - {{ p.get_price_category_display }}</small><br/>
+ {% if p.kbb_sn %}
+ <i class="icon-barcode"></i> <a href="#" class="sn" title="{% trans 'Click to select EEE code' %}">{{ p.kbb_sn }}</a>
+ {% endif %}
+ </li>
+ {% empty %}
+ <li class="muted text-center" style="padding:10px">{% trans "No products added" %}</li>
+ {% endfor %}
+ </ul>
+ <hr/>
+ <strong>{% trans "Total" %}:</strong>
+ <span class="pull-right"><strong>{{ order.gross_total|currency }}</strong></span>
+</div>
diff --git a/servo/templates/orders/notes.html b/servo/templates/orders/notes.html
new file mode 100755
index 0000000..06cc61d
--- /dev/null
+++ b/servo/templates/orders/notes.html
@@ -0,0 +1,84 @@
+{% load i18n %}
+{% load humanize %}
+{% load mptt_tags %}
+{% load servo_tags %}
+
+{% if not order.notes %}
+<div class="row-fluid">
+ <div class="span12 well empty"><h3 class="muted">{% trans "Order doesn't contain any notes." %}</h3></div>
+</div>
+{% endif %}
+
+<ul class="media-list" style="margin-bottom:0px">
+{% recursetree notes %}
+ {% if node.is_root_node %}<li {% else %}<div {% endif %}class="media">
+ <a class="pull-left" href="#">
+ {% with node.created_by as profile %}
+ <img src="{{ profile.get_avatar }}" alt="{{ profile }}" title="{{ profile }}" class="avatar"/>
+ {% endwith %}
+ </a>
+ <div class="btn-group pull-right">
+ <a href="{% url 'notes-reply' node.pk %}" class="btn btn-small" title="{% trans "Reply" %}"><i class="icon-share-alt"></i></a>
+ {% if perms.servo.change_note and order.is_editable %}
+ <a href="{{ node.get_edit_url }}" class="btn btn-small"><i class="icon-pencil"></i></a>
+ {% else %}
+ <a href="#" class="btn btn-small disabled"><i class="icon-pencil"></i></a>
+ {% endif %}
+ <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <li class="dropdown-submenu pull-left">
+ <a tabindex="-1" href="#"><i class="icon-tag"></i> {% trans "Tag" %}</a>
+ <ul class="dropdown-menu">
+ {% for t in note_tags %}
+ <li><a href="{% url 'notes-toggle_tag' node.pk t.pk %}">{{ t }}</a></li>
+ {% endfor %}
+ </ul>
+ </li>
+ <li class="dropdown-submenu pull-left">
+ <a tabindex="-1" href="#"><i class="icon-flag"></i> {% trans "Mark" %}</a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'notes-toggle_flag' node.pk 'reported' %}" class="nofollow">{{ node.get_reported_title }}</a></li>
+ <li><a href="{% url 'notes-toggle_flag' node.pk 'read' %}" class="nofollow">{{ node.get_read_title }}</a></li>
+ <li><a href="{% url 'notes-toggle_flag' node.pk 'flagged' %}" class="nofollow">{{ node.get_flagged_title }}</a></li>
+ </ul>
+ </li>
+ <li{% if not order.is_editable %} class="disabled"{% endif %}><a href="{% url 'notes-copy' node.pk %}"><i class="icon-plus"></i> {% trans "Copy" %}</a></li>
+ <li><a href="{% url 'notes-messages' node.pk %}" data-modal="#modal"><i class="icon-info-sign"></i> {% trans "Message Log" %}</a></li>
+ <li class="divider"></li>
+ <li{% if not order.is_editable %} class="disabled"{% endif %}><a href="{% url 'notes-delete_note' node.pk %}" data-modal="#modal"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ </ul>
+ </div>
+ <div class="media-body">
+ <h5 class="media-heading">{{ node.get_sender_name }} {{ node.created_at|relative_date }}
+ {% if node.escalation.is_submitted %}
+ <small class="muted"><i class="icon-globe"></i> {{ node.escalation.escalation_id }}</small>
+ {% endif %}
+ </h5>
+ {% if node.is_reported %}
+ {{ node.body|markdown }}
+ {% else %}
+ <em>{{ node.body|markdown }}</em>
+ {% endif %}
+ {% if node.message_set.all|length %}
+ <i class="icon-envelope" title="{% trans "Note has been sent" %}"></i>
+ {% endif %}
+ {% with node.attachments.all as attachments %}
+ {% for a in attachments %}
+ <a class="window" href="{{ a.content.url }}"><span class="label label-info"><i class="icon-file icon-white"></i> {{ a }}</span></a>
+ {% endfor %}
+ {% endwith %}
+ {% if not node.is_leaf_node %}
+ {{ children }}
+ {% endif %}
+ {% for t in node.labels.all %}
+ <span class="label label-{{ t.color }}">{{ t.title }}</span>
+ {% endfor %}
+ </div>
+ {% if node.is_root_node %}</li><hr/>{% else %}</div>{% endif %}
+{% endrecursetree %}
+</ul>
+<p class="clearfix">
+ <a href="{% url 'orders-add_note' order.pk %}" class="btn pull-right {% if order.is_closed %}disabled{% endif %}"><i class="icon-plus"></i> {% trans "Add Note" %}</a>
+</p>
diff --git a/servo/templates/orders/parts.html b/servo/templates/orders/parts.html
new file mode 100755
index 0000000..bf3cbf3
--- /dev/null
+++ b/servo/templates/orders/parts.html
@@ -0,0 +1,36 @@
+{% extends "orders/edit.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+{% endblock toolbar %}
+
+{% block first_column %}
+<address>
+ <strong>{{ device.description }}</strong><br/>
+ <small class="muted">{{ device.configuration }}</small><br/>
+ <span><a href="{% url 'devices-get_info' device.pk %}" data-modal="#modal">{{ device.get_warranty_status_display }}</a></span> <i class="icon-info-sign"></i><br/>
+ <i class="icon-barcode"></i> <a href="#" class="sn">{{ device.sn }}</a>
+ <hr/>
+ <strong>{% trans "Parts and Services" %}</strong>
+ {% include "orders/list_products.html" %}
+</address>
+<hr/>
+<input type="text" class="span12 search-query filter" placeholder="{% trans "Filter results" %}"/>
+<a class="btn btn-primary pull-right" style="margin:10px" href="{{ order.get_absolute_url }}">{% trans "Done" %}</a>
+{% endblock first_column %}
+
+{% block second_toolbar %}
+{% endblock second_toolbar %}
+
+{% block second_column %}
+
+<div class="async" data-url="{{ url }}"><h2 class="text-center muted">{% trans "Fetching parts..." %}</h2></div>
+
+{% endblock second_column %}
+
+{% block morecrumbs %}
+<li><a href="{{ order.get_absolute_url }}">{% trans "Order" %} {{ order.get_footer }}</a> <span class="divider">/</span></li>
+<li><a href="">{{ device.description }}</a> <span class="divider">/</span></li>
+<li class="active">{% trans "Service Parts" %}</li>
+{% endblock morecrumbs %} \ No newline at end of file
diff --git a/servo/templates/orders/print_confirmation.html b/servo/templates/orders/print_confirmation.html
new file mode 100755
index 0000000..0b0ca77
--- /dev/null
+++ b/servo/templates/orders/print_confirmation.html
@@ -0,0 +1,193 @@
+{% extends "default_print.html" %}
+{% load servo_tags %}
+{% load mptt_tags %}
+{% load static %}
+{% load i18n %}
+
+{% block content %}
+{% with order.location as location %}
+<div class="row">
+ <div class="span4">
+ {% if location.logo %}
+ <img src="{% get_media_prefix %}{{ conf.company_logo }}" alt="logo" title="logo" class="media-object pull-left span2" style="margin:10px"/>
+ {% endif %}
+ </div>
+ <div class="span4">
+ {{ location.title }}<br/>
+ {{ location.address }}<br/>
+ {{ location.zip_code }}, {{ location.city }}<br/>
+ {{ location.notes }}
+ </div>
+ <div class="span4">
+ {% block location_info %}
+ {% endblock location_info %}
+ {% trans "Email Address" %}: {{ location.email }}<br/>
+ {% trans "Phone" %}: {{ location.phone }}<br/><br/>
+ {% trans "Repair Number" %}: {{ order.code }}<br/>
+ <img src="{% url 'barcodes-view' order.code %}" alt="{{ order.code }}"/>
+ </div>
+</div>
+{% endwith %}
+<div class="row" style="margin-top:2em;margin-bottom:1em">
+ <div class="span6">
+ {% trans "Date" %}: {% now "SHORT_DATE_FORMAT" %}
+ </div>
+</div>
+<div class="row">
+ <div class="span12 text-center"><h3>{% block title %}{% trans "Work Confirmation" %} {{ order.code }}{% endblock title %}</h3></div>
+</div>
+<div class="row">
+ <div class="span12">
+ <table class="table">
+ <thead>
+ <tr>
+ <th>{% trans "Customer Information" %}</th>
+ <th>{% trans "Product Information" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ {% block customer_details %}
+ <strong>{{ order.customer.fullname }}</strong><br/>
+ {% trans "Daytime Phone" %}: {{ order.customer.phone|default:"-" }}<br/>
+ {% trans "Email Address" %}: {{ order.customer.email|default:"-" }}
+ {% if order.customer.street_address %}
+ <br/>
+ {% trans "Address" %}: {{ order.customer.street_address }}<br/>
+ {{ order.customer.zip_code }} {{ order.customer.city }}
+ {% endif %}
+ {% endblock customer_details %}
+ </td>
+ <td>
+ {% for device in order.get_devices %}
+ {% trans "Model" %}: {{ device.description }}<br/>
+ {% trans "Warranty Status" %}: {{ device.get_warranty_status_display }}<br/>
+ {% trans "Estimated Date of Purchase" %}: {{ device.purchased_on|default:"-" }}<br/>
+ {% if device.imei %}
+ {% trans "IMEI Number" %}: {{ device.imei }}<br/>
+ {% trans "Activation Policy" %}: {{ device.initial_activation_policy }}<br/>
+ {% endif %}
+ {% if device.sn %}
+ {% trans "Serial Number" %}: {{ device.sn }}<br/>
+ <img src="{% url 'barcodes-view' device.sn %}" alt=""/>
+ {% endif %}
+ {% endfor %}
+ </td>
+ </tr>
+ {% if order.has_accessories %}
+ <tr><td colspan="2"><strong>{% trans "Accessories" %}:</strong> {{ order.get_accessories|join:", " }}</td></tr>
+ {% endif %}
+ </tbody>
+ </table>
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ {% block work_description %}
+ {% if order.reported_notes.count > 0 %}
+ <h4>{% trans "Work Description" %}</h4>
+ {% for n in order.reported_notes %}
+ {{ n.body|markdown }}
+ {% endfor %}
+ {% endif %}
+ {% endblock work_description %}
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ {% block parts_and_services %}
+ {% if order.has_products %}
+ <h4>{% trans "Products and Services" %}</h4>
+ <table class="table">
+ <thead>
+ <tr>
+ <th colspan="2">{% trans "Product" %}</th>
+ <th>{% trans "Warranty" %}</th>
+ <th style="width:50px">{% trans "VAT %" %}</th>
+ <th style="width:40px">{% trans "Qty" %}</th>
+ <th style="width:60px">{% trans "0% VAT" %}</th>
+ <th style="width:60px">{% trans "Price" %}</th>
+ <th style="width:60px">{% trans "Total" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% block list_products %}
+ {% for i in order.products %}
+ <tr>
+ <td style="width:80px">{{ i.code }}</td>
+ <td>{{ i.title }}{% if i.sn %}<br/><span class="muted">{% trans "SN" %}: {{ i.sn }} {% if i.imei %}
+ {% trans "IMEI" %}: {{ i.imei }}{% endif %}{% endif %}</span></td>
+ <td>{{ i.product.get_warranty_display|default:"" }}</td>
+ <td>{{ i.product.pct_vat|floatformat:"0" }}%</td>
+ <td>{{ i.amount }}</td>
+ <td>{{ i.price_notax|currency }}</td>
+ <td>{{ i.price|currency }}</td>
+ <td>{{ i.total_gross|currency }}</td>
+ </tr>
+ {% endfor %}
+ {% endblock list_products %}
+ </tbody>
+ <tfoot>
+ <tr>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td style="text-align:right">{% trans "Total" %}:</td>
+ <td>{% block order_total %}{{ order.gross_total|currency }}{% endblock order_total %}</td>
+ </tr>
+ </tfoot>
+ </table>
+ {% endif %}
+ {% endblock parts_and_services %}
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ {% block customer_pickup %}
+ <h4>{% trans "Customer Pickup" %}</h4>
+ <table class="table">
+ <tbody>
+ <tr>
+ <td style="width:40%">&nbsp;</td>
+ <td style="width:40%">&nbsp;</td>
+ <td style="width:20%">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>{% trans "Customer Name" %}</td>
+ <td>{% trans "Signature" %}</td>
+ <td>{% trans "Date" %}</td>
+ </tr>
+ </tbody>
+ </table>
+ {% endblock customer_pickup %}
+ {% block received_by %}
+ <h5>{% trans "Received By" %}</h5>
+ <table class="table">
+ <tbody>
+ <tr>
+ <td style="width:40%">{{ order.created_by.get_full_name }}</td>
+ <td style="width:40%">&nbsp;</td>
+ <td style="width:20%">{{ order.created_at|date:"SHORT_DATE_FORMAT" }}</td>
+ </tr>
+ <tr>
+ <td>{% trans "Name" %}</td>
+ <td>{% trans "Signature" %}</td>
+ <td>{% trans "Date" %}</td>
+ </tr>
+ </tbody>
+ </table>
+ {% endblock received_by %}
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ <hr/>
+ {% block tos %}{{ conf.terms_of_service|markdown }}{% endblock tos %}
+ {% block footer %}{% endblock footer %}
+ </div>
+</div>
+{% endblock content %}
diff --git a/servo/templates/orders/print_dispatch.html b/servo/templates/orders/print_dispatch.html
new file mode 100755
index 0000000..003e03e
--- /dev/null
+++ b/servo/templates/orders/print_dispatch.html
@@ -0,0 +1,38 @@
+{% extends "orders/print_confirmation.html" %}
+{% load i18n %}
+
+{% block title %}
+ {% blocktrans with code=order.code%}Dispatch #{{ code }}{% endblocktrans %}
+{% endblock title %}
+
+{% block parts_and_services %}
+<h4>{% trans "Products and Services" %}</h4>
+<table class="table">
+ <thead>
+ <tr>
+ <th colspan="2">{% trans "Product" %}</th>
+ <th>{% trans "Warranty" %}</th>
+ <th style="width:50px">{% trans "VAT %" %}</th>
+ <th style="width:40px">{% trans "Qty" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% block list_products %}
+ {% for i in order.products %}
+ <tr>
+ <td style="width:75px">{{ i.product.code }}</td>
+ <td>{{ i.title }}{% if i.sn %}<br/><span class="muted">{% trans "SN" %}: {{ i.sn }}</span>{% endif %}</td>
+ <td>{{ i.product.warranty_period }} {% trans "mon." %}</td>
+ <td>{{ i.product.pct_vat|floatformat:"0" }}%</td>
+ <td>{{ i.amount }}</td>
+ </tr>
+ {% endfor %}
+ {% endblock list_products %}
+ </tbody>
+</table>
+{% endblock parts_and_services %}
+
+{% block received_by %}
+{% endblock received_by %}
+
+{% block tos %}{% endblock tos %}
diff --git a/servo/templates/orders/print_quote.html b/servo/templates/orders/print_quote.html
new file mode 100755
index 0000000..3c3a7d7
--- /dev/null
+++ b/servo/templates/orders/print_quote.html
@@ -0,0 +1,3 @@
+{% extends "orders/print_confirmation.html" %}
+
+{% block tos %}{% endblock tos %}
diff --git a/servo/templates/orders/print_receipt.html b/servo/templates/orders/print_receipt.html
new file mode 100755
index 0000000..c4de827
--- /dev/null
+++ b/servo/templates/orders/print_receipt.html
@@ -0,0 +1,46 @@
+{% extends "orders/print_confirmation.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block title %}
+ {% blocktrans with invoice.pk as number %}Receipt {{ number }}{% endblocktrans %}
+{% endblock title %}
+
+{% block customer_details %}
+ <strong>{{ invoice.customer_name }}</strong><br/>
+ {% trans "Daytime Phone" %}: {{ invoice.customer_phone|default:"-" }}<br/>
+ {% trans "Email Address" %}: {{ invoice.customer_email|default:"-" }}
+ {% if invoice.customer_address %}
+ <br/>
+ {% trans "Address" %}: {{ invoice.customer_address }}
+ {% endif %}
+{% endblock customer_details %}
+
+{% block list_products %}
+{% for i in invoice.invoiceitem_set.all %}
+ <tr>
+ <td style="width:80px">{{ i.code }}</td>
+ <td>{{ i.title }}{% if i.sn %}<br/><span class="muted">{% trans "SN" %}: {{ i.sn }} {% if i.imei %}{% trans "IMEI" %}: {{ i.imei }}{% endif %}{% endif %}</span></td>
+ <td>{{ i.product.get_warranty_display|default:"" }}</td>
+ <td>{{ i.product.pct_vat|floatformat:"0" }}%</td>
+ <td>{{ i.amount }}</td>
+ <td>{{ i.price_notax|currency }}</td>
+ <td>{{ i.price|currency }}</td>
+ <td>{{ i.total_gross|currency }}</td>
+ </tr>
+{% endfor %}
+{% endblock list_products %}
+
+{% block order_total %}
+ {{ invoice.total_gross|currency }}
+{% endblock order_total %}
+
+{% block customer_pickup %}
+<p class="text-right">
+ <strong>{% trans "Date of invoice" %}: {{ invoice.created_at|date:"SHORT_DATE_FORMAT" }}</strong><br/>
+ <strong>{% trans "Payment method" %}: {{ invoice.get_payment_methods|join:", " }}</strong><br/>
+ <strong>{% trans "Sales Person" %}: {{ invoice.created_by.get_full_name }}</strong><br/>
+</p>
+{% endblock customer_pickup %}
+
+{% block tos %}{% endblock tos %}
diff --git a/servo/templates/orders/products.html b/servo/templates/orders/products.html
new file mode 100755
index 0000000..4476ae8
--- /dev/null
+++ b/servo/templates/orders/products.html
@@ -0,0 +1,98 @@
+{% load i18n %}
+{% load servo_tags %}
+
+{% with order.serviceorderitem_set.all as products %}
+<table class="table" style="margin-bottom:0px">
+ {% if products.count %}
+ <thead>
+ <tr>
+ <th style="width:64px"></th>
+ <th>{% trans "Product" %}</th>
+ <th>{% trans "Amount" %}</th>
+ <th>{% trans "Price Category" %}</th>
+ <th>{% trans "Price" %}</th>
+ <th>{% trans "Total" %}</th>
+ <th></th>
+ </tr>
+ </thead>
+ {% endif %}
+ <tbody>
+ {% for item in products %}
+ {% with item.product as product %}
+ <tr>
+ <td><img src="{{ product.get_photo }}" alt="{{ product }}" class="img-icon"/></td>
+ <td>
+ <strong><a href="{% url 'products-get_info' item.code order.location.pk %}" data-modal="#modal">{{ product.code }}</a></strong><br/>
+ <div>{{ item.title }}</div>
+ {% if item.sn or item.kbb_sn %}
+ <p><small class="muted">{% trans "Serial Number" %}: {{ item.sn }}{% if item.kbb_sn %}, KBB: {{ item.kbb_sn }}{% endif %}</small></p>
+ {% endif %}
+ {% if product.is_apple_part %}
+ {% for repair in order.get_repairs %}
+ <div class="btn-group">
+ <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-wrench"></i> {{ repair.confirmation }} <span class="caret"></span>
+ </a>
+ {% if item in repair.get_products %}
+ {% with item.get_part as part %}
+ {% include "repairs/part_menu.html" %}
+ {% endwith %}
+ {% else %}
+ <ul class="dropdown-menu">
+ {% if repair.is_open %}
+ <li><a href="{% url 'repairs-add_part' repair.pk item.pk %}" data-modal="#modal" class="spin">{% trans "Add to Repair" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Add to Repair" %}</a></li>
+ {% endif %}
+ </ul>
+ {% endif %}
+ </div>
+ {% endfor %}
+ {% endif %}
+ </td>
+ <td>{{ item.amount }}</td>
+ <td>{{ item.get_price_category_display }}</td>
+ <td><a href="#" class="tt" title="{{ item.price_notax|currency }}">{{ item.price|currency }}</a></td>
+ <td><a href="#" class="tt" title="{{ item.total_net|currency }}">{{ item.total_gross|currency }}</a></td>
+ <td style="width:125px">
+ {% if order.is_editable %}
+ <div class="btn-group">
+ {% if item.should_report %}
+ <a href="{% url 'orders-report_product' pk=order.id item_id=item.id %}" title="Toggle report flag" class="btn btn-small btn-success nofollow active" data-toggle="button"><i class="icon-ok"></i></a>
+ {% else %}
+ <a href="{% url 'orders-report_product' pk=order.id item_id=item.id %}" title="Toggle report flag" class="btn btn-small btn-success nofollow" data-toggle="button"><i class="icon-ok icon-white"></i></a>
+ {% endif %}
+ </div>
+ <div class="btn-group">
+ <a href="{% url 'orders-edit_product' pk=order.id item_id=item.id %}" class="btn btn-small" title="{% trans "Edit" %}" data-modal="#modal"><i class="icon-pencil"></i></a>
+ <a class="btn btn-small dropdown-toggle {% if not order.is_editable %}disabled{% endif %}" data-toggle="dropdown" href="#"><i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu pull-right">
+ {% if item.can_create_device %}
+ <li><a href="{% url 'orders-create_device' order.pk item.pk %}">{% trans "Create Device" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Create Device" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ <li><a href="{% url 'orders-remove_product' pk=order.id item_id=item.id %}" data-modal="#modal" title="{% trans "Delete" %}"><i class="icon-trash"></i> {% trans "Remove" %}</a></li>
+ </ul>
+ </div>
+ {% endif %}
+ </td>
+ </tr>
+ {% endwith %}
+ {% empty %}
+ <div class="row-fluid">
+ <div class="span12 well empty"><h3 class="muted">{% trans "Order doesn't contain any products." %}</h3></div>
+ </div>
+ {% endfor %}
+ </tbody>
+</table>
+<a href="{% url 'products-choose' order_id=order.pk %}" data-modal="#modal" class="btn {% if not order.is_editable %}disabled{% endif %} pull-right"><i class="icon-plus"></i> {% trans "Add Product" %}</a>
+{% endwith %}
+<p class="clearfix">
+ <hr/>
+ {% if order.serviceorderitem_set.count %}
+ <h3 class="pull-right">{% trans "Order Total" %}: <a href="#" class="tt" title="{{ order.net_total|currency }}">{{ order.gross_total|currency }}</a></h3>
+ {% endif %}
+</p>
diff --git a/servo/templates/orders/remove_customer.html b/servo/templates/orders/remove_customer.html
new file mode 100755
index 0000000..53572e2
--- /dev/null
+++ b/servo/templates/orders/remove_customer.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Remove this customer from the order?" %}
+{% endblock header %}
+
+{% block body %}
+ {% trans "This will not delete the customer from the database." %}
+{% endblock body %}
+
+{% block footer %}
+ <form method="post" action="{{ action }}">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Remove" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/orders/remove_device.html b/servo/templates/orders/remove_device.html
new file mode 100755
index 0000000..dcfd376
--- /dev/null
+++ b/servo/templates/orders/remove_device.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% blocktrans with dev=device.description %}Remove {{ dev }}?{% endblocktrans %}
+{% endblock header %}
+
+{% block body %}
+ <p>{% trans "This will not delete the device from the database." %}</p>
+{% endblock body %}
+
+{% block footer %}
+ <form action="{{ action }}" method="post" accept-charset="utf-8">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger pull-right">{% trans "Remove" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/orders/remove_product.html b/servo/templates/orders/remove_product.html
new file mode 100755
index 0000000..e6d2966
--- /dev/null
+++ b/servo/templates/orders/remove_product.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Really remove product from order?" %}
+{% endblock header %}
+
+{% block body %}
+ {% trans "Product will not be deleted from the warehouse." %}
+{% endblock body %}
+
+{% block footer %}
+<form action="{% url 'servo.views.order.remove_product' order.id item.id %}" method="post">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+</form>
+{% endblock footer %}
diff --git a/servo/templates/orders/repair.html b/servo/templates/orders/repair.html
new file mode 100755
index 0000000..b3798db
--- /dev/null
+++ b/servo/templates/orders/repair.html
@@ -0,0 +1,63 @@
+{% extends "orders/edit.html" %}
+{% load i18n %}
+
+{% block toolbar %}
+{% if repair.is_open %}
+<a href="{% url 'repairs-complete_repair' order.pk repair.pk %}" class="btn" data-modal="#modal"><i class="icon-ok"></i> {% trans "Complete Repair" %}</a>
+{% else %}
+<a href="#" class="btn disabled" data-modal="#modal"><i class="icon-ok"></i> {% trans "Complete Repair" %}</a>
+{% endif %}
+<a class="btn" href="{% url 'repairs-copy_repair' repair.pk %}"><i class="icon-plus-sign"></i> {% trans "Copy" %}</a>
+{% endblock toolbar %}
+
+{% block second_column %}
+<h3>{{ status }}</h3>
+<dl class="dl-horizontal">
+ <dt>{% trans "Symptom" %}</dt>
+ <dd>{{ repair.symptom }}</dd>
+ <dt>{% trans "Diagnosis" %}</dt>
+ <dd>{{ repair.diagnosis }}</dd>
+ <dt>{% trans "Request Review" %}</dt>
+ <dd>{{ repair.request_review|yesno }}</dd>
+{% if repair.attachment %}
+ <dt>{% trans "Attachment" %}</dt>
+ {% with repair.attachment as a %}
+ <dd><a class="label label-info window" href="{{ a.url }}"><i class="icon-download icon-white"></i> {{ a }}</a></dd>
+ {% endwith %}
+{% endif %}
+ <dt>{% trans "Confirmation" %}</dt>
+ <dd>{{ repair.confirmation }}</dd>
+ <dt>{% trans "Reference" %}</dt>
+ <dd>{{ repair.reference }}</dd>
+ <dt>{% trans "Notes" %}</dt>
+ <dd>{{ notes|default:"-"|linebreaks }}</dd>
+</dl>
+<table class="table">
+ <tbody>
+ {% for part in parts %}
+ <tr>
+ <td>
+ <a href="{% url 'products-view_product' pk=part.order_item.product_id %}"><strong>{{ part.part_number }}</strong></a>
+ <br/>
+ {{ part.part_title }}<br/>
+ <small>{{ part.get_symptom_code_display }} - {{ part.get_symptom_modifier_display }}</small>
+ </td>
+ <td><br/>{{ part.coverage_description|default:"-" }}</td>
+ {% if part.order_status_code == 'OSHP' %}
+ <td><br/><a href="{{ part.carrier_url }}" class="window">{{ part.order_status }}</a></td>
+ {% else %}
+ <td><br/>{{ part.order_status|default:"-" }}</td>
+ {% endif %}
+ <td style="vertical-align:middle">
+ <div class="btn-group pull-right">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ {% include "repairs/part_menu.html" %}
+ </div>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
+{% endblock second_column %}
diff --git a/servo/templates/orders/reserve_products.html b/servo/templates/orders/reserve_products.html
new file mode 100755
index 0000000..318a28d
--- /dev/null
+++ b/servo/templates/orders/reserve_products.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% blocktrans with id=order.code %}Reserve all products in order {{ id }}?{% endblocktrans %}
+{% endblock header %}
+
+{% block footer %}
+<form action="{{ action }}" method="post" accept-charset="utf-8">
+ {% csrf_token %}
+ <button class="btn btn-primary" type="submit">{% trans "Reserve" %}</button>
+</form>
+{% endblock footer %}
diff --git a/servo/templates/orders/search.html b/servo/templates/orders/search.html
new file mode 100755
index 0000000..2789b20
--- /dev/null
+++ b/servo/templates/orders/search.html
@@ -0,0 +1,7 @@
+{% load i18n %}
+
+{% if orders %}
+ {% include "orders/list.html" %}
+{% else %}
+ <h1 class="muted text-center">{% trans "No orders found" %}</h1>
+{% endif %}
diff --git a/servo/templates/orders/statuses.html b/servo/templates/orders/statuses.html
new file mode 100755
index 0000000..8f3eb4b
--- /dev/null
+++ b/servo/templates/orders/statuses.html
@@ -0,0 +1,7 @@
+{% load i18n %}
+<select name="status" id="select_status">
+ <option value="">{% trans "Choose" %}...</option>
+{% for status in statuses %}
+ <option value="{{ status.id }}">{{ status.title }}</option>
+{% endfor %}
+</select>
diff --git a/servo/templates/orders/tabs.html b/servo/templates/orders/tabs.html
new file mode 100755
index 0000000..134aa9f
--- /dev/null
+++ b/servo/templates/orders/tabs.html
@@ -0,0 +1,8 @@
+{% load i18n %}
+{% load humanize %}
+
+<li{% if not repair and active == 'order' %} class="active"{% endif %}><a href="{{ order.get_absolute_url }}">{% trans "Order" %}</a></li>
+{% for r in order.repair_set.all %}
+<li{% if r.pk == repair.pk %} class="active"{% endif %}><a href="{{ r.get_absolute_url }}">{{ r.get_number }}</a></li>
+{% endfor %}
+<li{% if active == 'events' %} class="active"{% endif %}><a href="{{ order.get_absolute_url }}events/">{% trans "Events" %}</a></li>
diff --git a/servo/templates/orders/toggle_flagged.html b/servo/templates/orders/toggle_flagged.html
new file mode 100755
index 0000000..f062776
--- /dev/null
+++ b/servo/templates/orders/toggle_flagged.html
@@ -0,0 +1 @@
+<i class="icon-flag"></i> {{ action }}
diff --git a/servo/templates/orders/toggle_follow.html b/servo/templates/orders/toggle_follow.html
new file mode 100755
index 0000000..2563974
--- /dev/null
+++ b/servo/templates/orders/toggle_follow.html
@@ -0,0 +1 @@
+<i class="icon-eye-{{ icon }}"></i> {{ action }}
diff --git a/servo/templates/orders/toolbar.html b/servo/templates/orders/toolbar.html
new file mode 100755
index 0000000..4bd9fef
--- /dev/null
+++ b/servo/templates/orders/toolbar.html
@@ -0,0 +1,116 @@
+{% load cache %}
+{% load i18n %}
+
+<div class="btn-group">
+{% if order.is_editable %}
+ <a class="btn" href="{% url 'orders-add_note' order.pk %}"><i class="icon-file"></i> {% trans "Add Note" %}</a>
+{% else %}
+ <a class="btn disabled" href="#"><i class="icon-file"></i> {% trans "Add Note" %}</a>
+{% endif %}
+ <a class="btn dropdown-toggle {% if not order.is_editable %}disabled{% endif %}" data-toggle="dropdown" href="#">
+ <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'devices-choose' order.pk %}" data-modal="#modal">{% trans "Add Device" %}...</a></li>
+ <li><a href="{% url 'products-choose' order_id=order.pk %}" data-modal="#modal">{% trans "Add Product" %}...</a></li>
+ <li><a href="{% url 'orders-choose_customer' order.pk %}" data-modal="#modal">{% trans "Choose Customer" %}...</a></li>
+ </ul>
+</div>
+<div class="btn-group">
+ <a href="{% url 'orders-print_order' order.pk 'confirmation' %}" class="btn window" title="{% trans 'Print' %}"><i class="icon-print"></i> {% trans "Print" %}</a>
+ <button class="btn dropdown-toggle" data-toggle="dropdown">
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'orders-print_order' order.pk 'quote' %}" class="window">{% trans "Cost Estimate" %}</a></li>
+ {% if order.invoice_set.count %}
+ <li><a href="{% url 'orders-print_order' order.pk 'receipt' %}" class="window">{% trans "Receipt" %}</a></li>
+ <li><a href="{% url 'orders-print_order' order.pk 'dispatch' %}" class="window">{% trans "Dispatch" context "noun" %}</a></li>
+ {% endif %}
+ </ul>
+</div>
+<div class="btn-group">
+ <a class="btn dropdown-toggle {% if not order.is_editable %}disabled{% endif %}" data-toggle="dropdown" href="#">
+ <i class="icon-inbox"></i> {{ order.get_queue }} <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% for i in queues %}
+ <li{% if i == order.queue %} class="active"{% endif %}><a href="{% url 'orders-update' order.pk 'queue' i.pk %}">{{ i }}</a></li>
+ {% endfor %}
+ <li class="divider"></li>
+ {% if order.queue %}
+ <li><a href="{% url 'orders-update' order.pk 'queue' 0 %}">{% trans "Remove Queue" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Remove Queue" %}</a></li>
+ {% endif %}
+ </ul>
+</div>
+<div class="btn-group">
+ <a class="btn dropdown-toggle {% if not order.queue or not order.is_editable or statuses|length < 1 %}disabled{% endif %}" data-toggle="dropdown" href="#">
+ <i class="icon-tasks"></i> {{ order.get_status|truncatechars:25 }} <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% for i in statuses %}
+ <li{% if i == order.status %} class="active"{% endif %}><a href="{% url 'orders-update' order.pk 'status' i.pk %}">{{ i }}</a></li>
+ {% endfor %}
+ <li class="divider"></li>
+ <li><a href="{% url 'orders-update' order.pk 'status' 0 %}">{% trans "Remove Status" %}</a></li>
+ </ul>
+</div>
+<div class="btn-group">
+{% if order.can_dispatch %}
+ <a class="btn" href="{% url 'orders-dispatch' order.pk %}">{% trans "Dispatch" %}</a>
+{% else %}
+ <a class="btn disabled" href="#">{% trans "Dispatch" %}</a>
+{% endif %}
+{% if perms.servo.change_order and order.can_close %}
+ <a class="btn" href="{% url 'orders-close' order.pk %}" data-modal="#modal"><i class="icon-lock"></i> {% trans "Close" %}</a>
+{% elif perms.servo.delete_order and order.is_closed %}
+ <a class="btn" href="{% url 'orders-reopen_order' order.pk %}"><i class="icon-lock"></i> {% trans "Reopen" %}</a>
+{% else %}
+ <a class="btn disabled" href="#"><i class="icon-lock"></i> {% trans "Close" %}</a>
+{% endif %}
+</div>
+<div class="btn-group">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% if request.user in order.followed_by.all %}
+ <li><a href="{% url 'orders-toggle_follow' order.pk %}">{% trans "Unfollow Order" %}</a></li>
+ {% else %}
+ <li><a href="{% url 'orders-toggle_follow' order.pk %}">{% trans "Follow Order" %}</a></li>
+ {% endif %}
+ {% if perms.servo.add_order and perms.servo.copy_order %}
+ <li><a href="{% url 'orders-copy_order' order.pk %}">{% trans "Copy Order" %}</a></li>
+ {% else %}
+ <li><a class="disabled" href="#">{% trans "Copy Order" %}</a></li>
+ {% endif %}
+ <li><a href="{% url 'barcodes-view' order.code %}?f=svg" target="_blank">{% trans "Show Barcode" %}</a></li>
+ <li class="divider"></li>
+ <li class="dropdown-submenu">
+ <a tabindex="-1" href="#">{% trans "Priority" %}</a>
+ <ul class="dropdown-menu">
+ {% for i in priorities %}
+ <li{% ifequal i.0 order.priority %} class="active"{% endifequal %}><a href="{% url 'orders-update' order.pk 'priority' i.0 %}">{{ i.1 }}</a></li>
+ {% endfor %}
+ </ul>
+ </li>
+ <li class="divider"></li>
+ {% if order.can_order_products %}
+ <li><a href="{% url 'orders-reserve_products' order.pk %}" data-modal="#modal">{% trans "Reserve Products" %}</a></li>
+ <li><a href="{% url 'purchases-create_po' order_id=order.pk %}">{% trans "Order Products" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Reserve Products" %}</a></li>
+ <li class="disabled"><a href="#">{% trans "Order Products" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ <li><a href="{% url 'repairs-import_repair' order.pk %}" data-modal="#modal">{% trans "Import GSX Repair" %}</a></li>
+ <li class="divider"></li>
+ {% if perms.servo.delete_order and order.is_editable %}
+ <li><a href="{% url 'orders-delete_order' order.pk %}" data-modal="#modal"><i class="icon-trash"> </i> {% trans "Delete Order" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#"><i class="icon-trash"></i> {% trans "Delete Order" %}</a></li>
+ {% endif %}
+ </ul>
+</div>
diff --git a/servo/templates/pagination.html b/servo/templates/pagination.html
new file mode 100755
index 0000000..5625b7c
--- /dev/null
+++ b/servo/templates/pagination.html
@@ -0,0 +1,18 @@
+{% load i18n %}
+{% load servo_tags %}
+
+<div class="pagination pagination-centered">
+ <ul>
+ {% if items.has_previous %}
+ <li><a href="?{% paginator_page request items.previous_page_number %}"><span>&laquo;</span></a></li>
+ {% else %}
+ <li class="disabled"><a href="#"><span>&laquo;</span></a></li>
+ {% endif %}
+ <li class="active"><a href="#"><span>{% trans "Page" %} {{ items.number }}/{{ items.paginator.num_pages }}</span></a></li>
+ {% if items.has_next %}
+ <li><a href="?{% paginator_page request items.next_page_number %}"><span>&raquo;</span></a></li>
+ {% else %}
+ <li class="disabled"><a href="#"><span>&raquo;</span></a></li>
+ {% endif %}
+ </ul>
+</div>
diff --git a/servo/templates/products/category_form.html b/servo/templates/products/category_form.html
new file mode 100755
index 0000000..72ec93a
--- /dev/null
+++ b/servo/templates/products/category_form.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Edit Product Group" %}
+{% endblock header %}
+
+{% block body %}
+ <form action="{{ request.path }}" method="post" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ </form>
+{% endblock body %}
diff --git a/servo/templates/products/choose-list.html b/servo/templates/products/choose-list.html
new file mode 100755
index 0000000..3188808
--- /dev/null
+++ b/servo/templates/products/choose-list.html
@@ -0,0 +1,9 @@
+{% load i18n %}
+{% load servo_tags %}
+<ul class="nav nav-pills nav-stacked">
+{% for i in products %}
+ <li><a href="{% url target_url order i.pk %}"><strong>{{ i.code}}</strong><br/>{{ i.title }}<span class="pull-right">{{ i.price_sales_stock|currency }}</span></a></li>
+{% empty %}
+ <li style="text-align:center">{% trans "No products found" %}</li>
+{% endfor %}
+</ul>
diff --git a/servo/templates/products/choose.html b/servo/templates/products/choose.html
new file mode 100755
index 0000000..a34834b
--- /dev/null
+++ b/servo/templates/products/choose.html
@@ -0,0 +1,25 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Search for a product" %}
+{% endblock header %}
+
+{% block body %}
+ <form method="post" action="{{ action }}" accept-charset="utf-8" data-target="#search-results" id="search-form">
+ {% csrf_token %}
+ <input type="text" style="width:500px" class="search-query" name="q" autocomplete="off" placeholder="{% trans "Code, title or category" %}"/>
+ </form>
+ <div id="search-results"></div>
+{% endblock body %}
+
+{% block footer %}
+ <button class="btn" data-dismiss="modal" aria-hidden="true">{% trans "Close" %}</button>
+ <a class="btn btn-primary submit-search" href="#">{% trans "Search" %}</a>
+ <script type="text/javascript">
+ $('.submit-search').click(function(e){
+ $('#search-form').submit();
+ e.preventDefault();
+ });
+ </script>
+{% endblock footer %} \ No newline at end of file
diff --git a/servo/templates/products/delete_category.html b/servo/templates/products/delete_category.html
new file mode 100755
index 0000000..e9aed7b
--- /dev/null
+++ b/servo/templates/products/delete_category.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Delete product category?" %}
+{% endblock header %}
+
+{% block body %}
+ {% trans "This action will not delete the products in this category." %}
+{% endblock body %}
+
+{% block footer %}
+ <form method="post" action="{{ action }}">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/products/form.html b/servo/templates/products/form.html
new file mode 100755
index 0000000..0429e6a
--- /dev/null
+++ b/servo/templates/products/form.html
@@ -0,0 +1,90 @@
+{% extends "products/view.html" %}
+{% load i18n %}
+
+{% block third_column %}
+<div class="span6">
+ <form method="post" action="" class="form-horizontal" enctype="multipart/form-data">
+ {% csrf_token %}
+ {{ formset.management_form }}
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "General" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Exchange Price" %}</a></li>
+ <li><a href="#tab3" data-toggle="tab">{% trans "Stock Price" %}</a></li>
+ <li><a href="#tab4" data-toggle="tab">{% trans "Stock" %}</a></li>
+ <li><a href="#tab5" data-toggle="tab">{% trans "Details" %}</a></li>
+ <li><a href="#tab6" data-toggle="tab">{% trans "GSX" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ {% include "form_field_snippet.html" with field=form.code %}
+ {% include "form_field_snippet.html" with field=form.title %}
+ {% include "form_field_snippet.html" with field=form.description %}
+ {% include "form_field_snippet.html" with field=form.is_service %}
+ </div>
+ <div class="tab-pane calculate" id="tab2">
+ {% include "form_field_snippet.html" with field=form.price_purchase_exchange %}
+ {% include "form_field_snippet.html" with field=form.pct_margin_exchange %}
+ {% include "form_field_snippet.html" with field=form.price_notax_exchange %}
+ {% include "form_field_snippet.html" with field=form.price_sales_exchange %}
+ </div>
+ <div class="tab-pane calculate" id="tab3">
+ {% include "form_field_snippet.html" with field=form.price_purchase_stock %}
+ {% include "form_field_snippet.html" with field=form.pct_margin_stock %}
+ {% include "form_field_snippet.html" with field=form.price_notax_stock %}
+ {% include "form_field_snippet.html" with field=form.price_sales_stock %}
+ </div>
+ <div class="tab-pane" id="tab4">
+ {% for f in formset %}
+ <div class="table">
+ {% include "form_snippet.html" with form=f %}
+ </div>
+ {% endfor %}
+ <a class="btn" id="add_more"><i class="icon-plus"></i> {% trans "Add" %}</a>
+ </div>
+ <div class="tab-pane" id="tab5">
+ {% include "form_field_snippet.html" with field=form.pct_vat %}
+ {% include "form_field_snippet.html" with field=form.shipping %}
+ {% include "form_field_snippet.html" with field=form.warranty_period %}
+ {% include "form_field_snippet.html" with field=form.brand %}
+ {% include "form_field_snippet.html" with field=form.categories %}
+ <div class="control-group">
+ <label class="control-label">{% trans "Tags" %}</label>
+ <div class="controls">
+ <input type="text" name="tag" class="input typeahead" placeholder="{% trans "Enter tag" %}" data-provide="typeahead" data-source="{% url 'products-tags' %}" autocomplete="off"/>
+ <div style="margin-top:10px">
+ {% for t in product.tags.all %}
+ <span class="label"><div class="pull-left">{{ t.tag }}</div><a class="close" href="{% url 'tags-clear' t.pk %}"><i class="icon-remove icon-white"></i></a></span>
+ {% endfor %}
+ </div>
+ </div>
+ </div>
+ {% include "form_field_snippet.html" with field=form.photo %}
+ {% include "form_field_snippet.html" with field=form.fixed_price %}
+ {% include "form_field_snippet.html" with field=form.is_serialized %}
+ </div>
+ <div class="tab-pane" id="tab6">
+ {% include "form_field_snippet.html" with field=form.part_type %}
+ {% include "form_field_snippet.html" with field=form.labour_tier %}
+ {% include "form_field_snippet.html" with field=form.component_code %}
+ {% include "form_field_snippet.html" with field=form.eee_code %}
+ </div>
+ </div>
+ <div class="form-actions">
+ {% if product.pk %}
+ <a class="btn" href="{% url 'products-view_product' product.pk %}">{% trans "Cancel" %}</a>
+ {% else %}
+ <a class="btn" href="{% url 'products-list_products' %}">{% trans "Cancel" %}</a>
+ {% endif %}
+ <button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
+ </div>
+ </form>
+</div>
+{% endblock third_column %}
+
+{% block media %}
+<script type="text/javascript">
+ $('#add_more').click(function() {
+ cloneMore('div.table:last', 'inventory_set');
+ });
+</script>
+{% endblock media %}
diff --git a/servo/templates/products/get_info.html b/servo/templates/products/get_info.html
new file mode 100755
index 0000000..be024e2
--- /dev/null
+++ b/servo/templates/products/get_info.html
@@ -0,0 +1,59 @@
+{% extends "modal.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block header %}
+{% trans "Product Info" %}
+{% endblock header %}
+
+{% block body %}
+<div class="media">
+ <a class="pull-left" href="#">
+ <img class="media-object" src="{{ product.get_photo }}" data-src="{{ product.get_photo }}" width="64px"/>
+ </a>
+ <div class="media-body">
+ <h4 class="media-heading">{{ product.code }}</h4>
+ <p>{{ product.title }}</p>
+ <p>{{ product.description|default:"" }}</p>
+ </div>
+</div>
+<dl class="dl-horizontal">
+ <dt>{% trans "Stock Price" %}</dt>
+ <dd>{{ product.price_sales_stock|currency }}</dd>
+ <dt>{% trans "Exchange Price" %}</dt>
+ <dd>{{ product.price_sales_exchange|currency }}</dd>
+ {% if product.component_code %}
+ <dt>{% trans "Component Group" %}</dt>
+ <dd>{{ product.get_component_code_display }} ({{ product.get_part_type_display }})</dd>
+ {% endif %}
+</dl>
+<dl class="dl-horizontal">
+ <dt>{% trans "EEE Code" %}</dt>
+ <dd>{{ product.eee_code|default:"-"|addspace }}</dd>
+</dl>
+{% for i in inventory %}
+{% ifchanged i.location.id %}
+<hr/>
+<h4>{{ i.location.title }}</h4>
+{% endifchanged %}
+<dl class="dl-horizontal">
+ <dt>{% trans "Stocked" %}</dt>
+ <dd>{{ i.amount_stocked }}</dd>
+ <dt>{% trans "Ordered" %}</dt>
+ <dd>{{ i.amount_ordered|default:"-" }}</dd>
+ <dt>{% trans "Reserved" %}</dt>
+ <dd>{{ i.amount_reserved|default:"-" }}</dd>
+</dl>
+{% empty %}
+ <hr/>
+ <div class="muted text-center">{% trans "Product not in inventory" %}</div>
+{% endfor %}
+{% endblock body %}
+
+{% block footer %}
+{% if product.pk %}
+ <a class="btn btn-default" href="{{ product.get_absolute_url }}">{% trans "View" %}</a>
+ <a class="btn btn-default" href="{% url 'products-edit_product' pk=product.pk group='all' %}">{% trans "Edit" %}</a>
+{% endif %}
+ <button type="submit" class="btn btn-primary" data-dismiss="modal">{% trans "Done" %}</button>
+{% endblock footer %} \ No newline at end of file
diff --git a/servo/templates/products/index.html b/servo/templates/products/index.html
new file mode 100755
index 0000000..fefcecd
--- /dev/null
+++ b/servo/templates/products/index.html
@@ -0,0 +1,104 @@
+{% extends "default.html" %}
+{% load i18n %}
+{% load mptt_tags %}
+{% load servo_tags %}
+
+{% block toolbar %}
+<div class="btn-group">
+ {% if perms.servo.add_product %}
+ <a class="btn" href="{% url 'products-create' group=group.slug %}"><i class="icon-plus"></i> {% trans "New Product" %}</a>
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'products-create_category' %}" data-modal="#modal">{% trans "New Category" %}</a></li>
+ <li class="divider"></li>
+ {% if product.id and perms.servo.add_purchaseorder %}
+ <li><a href="{% url 'orders-create_with_product' product_id=product.id %}">{% trans "New Sales Order" %}</a></li>
+ <li><a href="{% url 'purchases-create_po' product_id=product.id %}">{% trans "New Purchase Order" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="">{% trans "New Sales Order" %}</a></li>
+ <li class="disabled"><a href="">{% trans "New Purchase Order" %}</a></li>
+ {% endif %}
+ </ul>
+ {% endif %}
+</div>
+<div class="btn-group">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% if group.pk and perms.servo.add_product %}
+ <li><a href="{% url 'products-edit_category' group.slug %}" data-modal="#modal">{% trans "Edit Category" %}</a></li>
+ <li><a href="{% url 'products-delete_category' group.slug %}" data-modal="#modal">{% trans "Delete Category" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Edit Category" %}</a></li>
+ <li class="disabled"><a href="#">{% trans "Delete Category" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ <li><a href="{% url 'products-download' %}">{% trans "Download Products" %}</a></li>
+ <li><a href="{% url 'products-upload_products' %}" data-modal="#modal">{% trans "Upload Products" %}</a></li>
+ <li><a href="{% url 'products-upload_gsx_parts' %}" data-modal="#modal">{% trans "Upload Parts Database" %}</a></li>
+ </ul>
+</div>
+{% endblock toolbar %}
+
+{% block content %}
+<div class="row-fluid row-header">
+ <div class="span12">
+ <form class="form-search pull-right">
+ <div class="input-append">
+ <input type="text" class="search-query filter" placeholder="{% trans "Filter results" %}"/>
+ <button type="button" class="btn" data-toggle="collapse" data-target="#collapsable"><i class="icon-search"></i></button>
+ </div>
+ </form>
+ </div>
+</div>
+{% include "products/tabs.html" %}
+<div class="row-fluid">
+ {% block second_column %}
+ <div class="span3">
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Categories" %}</li>
+ <li class="{% active request 'all' %}"><a href="{% url 'products-list_products' %}">{% trans "All" %}</a></li>
+ {% recursetree categories %}
+ <li class="{% active request 'products' node.slug %}">
+ <a href="{% url 'products-list_products' group=node.slug %}">{{ node.title }}</a>
+ {% if not node.is_leaf_node %}
+ <ul class="nav nav-list">{{ children }}</ul>
+ {% endif %}
+ </li>
+ {% endrecursetree %}
+ </ul>
+ </div>
+ <div class="span9">
+ <div id="collapsable" class="collapse out">
+ <form method="post" action="" class="form-inline">
+ {% csrf_token %}
+ {% for field in form %}
+ <div class="control-group pull-left">
+ <label class="control-label">{{ field.label|default:"&nbsp;" }}</label>
+ <div class="controls">{{ field }}</div>
+ </div>
+ {% endfor %}
+ <p class="clearfix"><hr/></p>
+ <div class="pull-right">
+ <button type="submit" class="btn btn-primary"><i class="icon-search icon-white"></i> {% trans "Search" %}</button>
+ </div>
+ </form>
+ </div>
+ {% include "products/list.html" %}
+ {% include "pagination.html" with items=products %}
+ </div>
+ {% endblock second_column %}
+
+ {% block third_column %}
+
+ {% endblock third_column %}
+</div>
+{% endblock content %}
+
+{% block crumbs %}
+<li><a href="{% url 'products-list_products' %}">{% trans "Products" %}</a></li>
+{% block breadcrumb %}
+<li class="active"><span class="divider">/</span>{{ group_name }}</li>
+{% endblock breadcrumb %}
+{% endblock crumbs %}
diff --git a/servo/templates/products/index_outgoing.html b/servo/templates/products/index_outgoing.html
new file mode 100755
index 0000000..5b1d007
--- /dev/null
+++ b/servo/templates/products/index_outgoing.html
@@ -0,0 +1,56 @@
+{% extends "products/index.html" %}
+{% load i18n %}
+
+{% block toolbar %}
+
+{% endblock toolbar %}
+
+{% block first_column %}
+<ul class="nav nav-list">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "Outgoing" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Shipped" %}</a></li>
+</ul>
+{% endblock first_column %}
+
+{% block second_column %}
+<div class="span9">
+ <form method="post" action="">
+ {% csrf_token %}
+ <table class="table table-hover">
+ <thead>
+ <tr>
+ <th><input type="checkbox" class="toggle_column"/></th>
+ <th>{% trans "Code" %}</th>
+ <th>{% trans "Title" %}</th>
+ <th>{% trans "Order" %}</th>
+ <th>{% trans "Return Order" %}</th>
+ <th>{% trans "Register For Return" %}</th>
+ <th>{% trans "Serial Number" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for p in parts %}
+ <tr>
+ <td><input type="checkbox" name="items" value="{{ p.returnOrderNumber }}"/></td>
+ <td>{{ p.partNumber }}</td>
+ <td>{{ p.partDescription|truncatechars:42 }}</td>
+ <td>{{ p.purchaseOrderNumber }}</td>
+ <td><a href="{% url 'products-return_label' p.partNumber p.returnOrderNumber %}" class="window">{{ p.returnOrderNumber }}</a></td>
+ <td>{{ p.registeredForReturn }}</td>
+ <td>{{ p.kbbSerialNumber }}</td>
+ </tr>
+ {% empty %}
+ <tr>
+ <td colspan="7" class="muted empty">{% trans "No parts pending return" %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ <button type="submit" class="btn btn-primary pull-right" disabled="disabled">{% trans "Submit" %}</button>
+ </form>
+</div>
+{% endblock second_column %}
+
+{% block breadcrumb %}
+ <li><a href="{% url 'products-outgoing' %}">{% trans "Outgoing" %}</a></li>
+{% endblock breadcrumb %}
diff --git a/servo/templates/products/list.html b/servo/templates/products/list.html
new file mode 100755
index 0000000..bac34ec
--- /dev/null
+++ b/servo/templates/products/list.html
@@ -0,0 +1,27 @@
+{% load i18n %}
+{% load servo_tags %}
+<table class="table table-hover sortable">
+ <thead>
+ <tr>
+ <th style="width:80px" data-defaultsort="disabled"></th>
+ <th>{% trans "Product" %}</th>
+ <th>{% trans "Stock Price" %}</th>
+ <th>{% trans "Exchange Price" %}</th>
+ <th style="width:80px">{% trans "In Stock" %}</th>
+ <th data-defaultsort="disabled"></th>
+ </tr>
+ </thead>
+ <tbody class="searchable">
+ {% include "products/list_rows.html" %}
+ </tbody>
+ <tfoot>
+ <tr>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td><strong>{{ total_sales_value|currency }}</strong><br/><strong>{{ total_purchase_value|currency }}</strong></td>
+ <td></td>
+ <td></td>
+ </tr>
+ </tfoot>
+</table>
diff --git a/servo/templates/products/list_rows.html b/servo/templates/products/list_rows.html
new file mode 100755
index 0000000..a753687
--- /dev/null
+++ b/servo/templates/products/list_rows.html
@@ -0,0 +1,55 @@
+{% load i18n %}
+{% load servo_tags %}
+{% for p in products %}
+{% with p.get_pk as product_id %}
+<tr>
+ <td><img src="{{ p.get_photo }}" alt="{{ product }}" class="img-icon"/></td>
+ <td data-value="{{ p.code }}">
+ <a href="{% url 'products-view_product' pk=p.pk group=group.slug %}"><strong>{{ p.code }}</strong></a><br/>
+ {{ p.title }}<br/><small class="muted">{{ p.eee_code|default:""|addspace }}</small>
+ </td>
+ <td data-value="{{ p.price_sales_stock|safe }}">{{ p.price_sales_stock|currency }}</td>
+ <td data-value="{{ p.price_sales_exchange|safe }}">{{ p.price_sales_exchange|currency }}</td>
+ {% if p.is_service %}
+ <td>&infin;</td>
+ {% else %}
+ <td>{{ p|amount_in_location:request.user }}</td>
+ {% endif %}
+ <td>
+ <div class="btn-group pull-right">
+ {% if perms.servo.change_product %}
+ <a class="btn" href="{% url 'products-edit_product' pk=product_id group=group.slug %}"><i class="icon-pencil"></i></a>
+ {% else %}
+ <a class="btn disabled" href="#"><i class="icon-pencil"></i></a>
+ {% endif %}
+ <button class="btn dropdown-toggle" data-toggle="dropdown">
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu">
+ {% with request.session.current_order_id as co %}
+ {% if co %}
+ <li><a href="{% url 'orders-add_product' co product_id %}">{% trans "Use in Service Order" %} #{{ request.session.current_order_code }}</a></li>
+ <li class="divider"></li>
+ {% endif %}
+ {% endwith %}
+ <li><a href="{% url 'orders-create_with_product' product_id %}">{% trans "Create Sales Order" %}</a></li>
+ <li><a href="{% url 'purchases-create_po' product_id=product_id %}">{% trans "Create Purchase Order" %}</a></li>
+ {% with request.session.current_po as po %}
+ {% if po %}
+ <li><a href="{% url 'purchases-add_to_po' pk=po.id product_id=product_id %}">{% trans "Use in Purchase Order" %}</a></li>
+ {% endif %}
+ {% endwith %}
+ <li class="divider"></li>
+ {% if perms.servo.delete_product %}
+ <li><a href="{% url 'products-delete_product' pk=product_id group=group.slug %}" data-modal="#modal"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% endif %}
+ </ul>
+ </div>
+ </td>
+</tr>
+{% endwith %}
+{% empty %}
+<tr><td colspan="6" class="muted empty">{% trans "No products found" %}</td></tr>
+{% endfor %}
diff --git a/servo/templates/products/receive_item.html b/servo/templates/products/receive_item.html
new file mode 100755
index 0000000..275fbd2
--- /dev/null
+++ b/servo/templates/products/receive_item.html
@@ -0,0 +1,51 @@
+{% extends "modal.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block header %}
+ {{ item.code }}
+{% endblock header %}
+
+{% block body %}
+ <form method="post" action="{{ url }}" class="form-horizontal">
+ {% csrf_token %}
+ <h4>{{ item.title }}</h4>
+ <dl class="dl-horizontal">
+ {% with item.purchase_order as po %}
+ <dt>{% trans "Ordered" %}</dt>
+ <dd>{{ po.created_at|date:"SHORT_DATE_FORMAT" }}, {{ po.created_by }}</dd>
+ <dt>{% trans "Service Order" %}</dt>
+ {% if po.sales_order %}
+ <dd><a href="{% url 'orders-edit' po.sales_order.pk %}">{{ po.sales_order.code }}</a></dd>
+ {% else %}
+ <dd>{% trans "Stocking Order" %} {{ po.reference }}</dd>
+ {% endif %}
+ <dt>{% trans "Reference" %}</dt>
+ <dd>{{ po.reference|default:"-" }}</dd>
+ {% if item.received_at %}
+ <dt>{% trans "Received" %}</dt>
+ <dd>{{ item.received_at|date:"SHORT_DATE_FORMAT" }}, {{ item.received_by }}</dd>
+ {% endif %}
+ {% if item.reference %}
+ <dt>{% trans "Reference" %}</dt>
+ <dd>{{ item.reference }}</dd>
+ {% endif %}
+ <dt>{% trans "Confirmation" %}</dt>
+ <dd>{{ po.confirmation|default:"-" }}</dd>
+ {% endwith %}
+ <dt>{% trans "Purchase Price" %}</dt>
+ <dd>{{ form.instance.price|currency|default:"-" }}</dd>
+ </dl>
+ {% include "form_field_snippet.html" with field=form.amount %}
+ {% if item.product.is_serialized %}
+ {% include "form_field_snippet.html" with field=form.sn %}
+ {% endif %}
+ </form>
+{% endblock body %}
+
+{% block footer %}
+ <button class="btn" data-dismiss="modal">{% trans "Cancel" %}</button>
+{% if not item.received_at %}
+ <button type="submit" class="btn btn-primary">{% trans "Receive" %}</button>
+{% endif %}
+{% endblock footer %}
diff --git a/servo/templates/products/remove.html b/servo/templates/products/remove.html
new file mode 100755
index 0000000..e951656
--- /dev/null
+++ b/servo/templates/products/remove.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% blocktrans with code=product.code %}Really delete product "{{ code }}"?{% endblocktrans %}
+{% endblock header %}
+
+{% block footer %}
+ <form action="{{ action }}" method="post">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</buttom>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/products/search.html b/servo/templates/products/search.html
new file mode 100755
index 0000000..1e6485b
--- /dev/null
+++ b/servo/templates/products/search.html
@@ -0,0 +1,20 @@
+{% extends "two_column_layout.html" %}
+{% load i18n %}
+
+{% block first_column %}
+ <input type="text" class="input-large search-query filter" placeholder="{% trans "Filter results" %}"/>
+{% endblock first_column %}
+
+{% block second_column %}
+ {% if products %}
+ {% include "products/list.html" %}
+ {% include "pagination.html" with items=products %}
+ {% else %}
+ <h1 class="muted text-center">{% trans "No products found" %}</h1>
+ {% endif %}
+{% endblock second_column %}
+
+{% block crumbs %}
+ <li><a href="{% url 'products-list_products' %}">{% trans "Products" %}</a> <span class="divider">/</span></li>
+ <li class="active">{{ title }}</li>
+{% endblock crumbs %}
diff --git a/servo/templates/products/tabs.html b/servo/templates/products/tabs.html
new file mode 100755
index 0000000..9bd871d
--- /dev/null
+++ b/servo/templates/products/tabs.html
@@ -0,0 +1,21 @@
+{% load i18n %}
+{% load servo_tags %}
+
+<div class="row-fluid">
+ <div class="span12">
+ <ul class="nav nav-tabs">
+ <li class="{% active request "products" %}">
+ <a href="{% url 'products-list_products' %}">{% trans "Products" %}</a>
+ </li>
+ <li class="{% active request "shipments" %}">
+ <a href="{% url 'shipments-list_incoming' %}">{% trans "Shipments" %}</a>
+ </li>
+ <li class="{% active request "purchases" %}">
+ <a href="{% url 'purchases-list_pos' %}">{% trans "Purchase Orders" %}</a>
+ </li>
+ <li class="{% active request "invoices" %}">
+ <a href="{% url 'invoices-index' %}">{% trans "Invoices" %}</a>
+ </li>
+ </ul>
+ </div>
+</div>
diff --git a/servo/templates/products/upload_gsx_parts.html b/servo/templates/products/upload_gsx_parts.html
new file mode 100755
index 0000000..1807343
--- /dev/null
+++ b/servo/templates/products/upload_gsx_parts.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Upload GSX Parts" %}
+{% endblock header %}
+
+{% block body %}
+ <form method="post" action="{{ action }}" enctype="multipart/form-data" class="form-horizontal" accept-charset="utf-8">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ </form>
+{% endblock body %}
diff --git a/servo/templates/products/upload_products.html b/servo/templates/products/upload_products.html
new file mode 100755
index 0000000..746842b
--- /dev/null
+++ b/servo/templates/products/upload_products.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {{ title }}
+{% endblock header %}
+
+{% block body %}
+<form method="post" action="{{ action }}" enctype="multipart/form-data" class="form-horizontal" accept-charset="utf-8">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+</form>
+{% endblock body %}
diff --git a/servo/templates/products/view.html b/servo/templates/products/view.html
new file mode 100755
index 0000000..7f5f355
--- /dev/null
+++ b/servo/templates/products/view.html
@@ -0,0 +1,205 @@
+{% extends "products/index.html" %}
+{% load servo_tags %}
+{% load mptt_tags %}
+{% load i18n %}
+
+{% block second_column %}
+{% block category_block %}
+<div class="span3">
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Categories" %}</li>
+ <li class="{% active request 'all' %}"><a href="{% url 'products-list_products' %}">{% trans "All" %}</a></li>
+ {% recursetree categories %}
+ <li class="{% active request 'products' node.slug '/' %}">
+ <a href="{% url 'products-list_products' group=node.slug %}">{{ node.title }}</a>
+ {% if not node.is_leaf_node %}
+ <ul class="nav nav-list">{{ children }}</ul>
+ {% endif %}
+ </li>
+ {% endrecursetree %}
+ </ul>
+</div>
+{% endblock category_block %}
+<div class="span3">
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Products" %}</li>
+ {% for i in products %}
+ <li class="{% active request group.slug i.pk %}">
+ <a href="{% url 'products-view_product' pk=i.pk group=group.slug %}">
+ <strong>{{ i.code }}</strong><span class="pull-right">{{ i.price_sales_stock|currency }}</span>
+ <br/>
+ <small>{{ i.title|truncatechars:30 }}</small>
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% include "pagination.html" with items=products %}
+</div>
+{% endblock second_column %}
+
+{% block third_column %}
+<div class="span6">
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "Product" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Sales" %}</a></li>
+ <li><a href="#tab3" data-toggle="tab">{% trans "Purchases" %}</a></li>
+ <li><a href="#tab4" data-toggle="tab">{% trans "Invoices" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ <div class="media">
+ <a class="pull-left" href="#">
+ <img class="media-object" src="{{ product.get_photo }}" data-src="{{ product.get_photo }}" width="64px"/>
+ </a>
+ <div class="media-body">
+ <h4 class="media-heading">{{ product.code }}</h4>
+ <p>{{ product.title }}</p>
+ <p>{{ product.description|default:"" }}</p>
+ </div>
+ </div>
+ <hr/>
+ <dl class="dl-horizontal">
+ <dt>{% trans "Stock Price" %}</dt>
+ <dd>{{ product.price_sales_stock|currency }}</dd>
+ <dt>{% trans "Exchange Price" %}</dt>
+ <dd>{{ product.price_sales_exchange|currency }}</dd>
+ {% if product.component_code %}
+ <dt>{% trans "Component Group" %}</dt>
+ <dd>{{ product.get_component_code_display }} ({{ product.get_part_type_display }})</dd>
+ {% endif %}
+ <dt>&nbsp;</dt>
+ <dd>
+ {% for t in product.tags.all %}
+ <span class="label">{{ t.tag }}</span>
+ {% endfor %}
+ </dd>
+ {% for i in inventory %}
+ {% ifchanged i.location.id %}
+ <hr/>
+ <h4>{{ i.location.title }}</h4>
+ {% endifchanged %}
+ <dl class="dl-horizontal">
+ <dt>{% trans "Stocked" %}</dt>
+ <dd>{{ i.amount_stocked }}</dd>
+ <dt>{% trans "Ordered" %}</dt>
+ <dd>{{ i.amount_ordered|default:"-" }}</dd>
+ <dt>{% trans "Reserved" %}</dt>
+ <dd>{{ i.amount_reserved|default:"-" }}</dd>
+ </dl>
+ {% endfor %}
+ <hr/>
+ {% with request.session.current_order_id as co %}
+ {% if co and product.pk %}
+ <a href="{% url 'orders-add_product' co product.pk %}" class="btn btn-primary"><i class="icon-share-alt icon-white"></i> {% trans "Use in" %} #{{ request.session.current_order_code }}</a>
+ {% endif %}
+ {% endwith %}
+ <a href="{% url 'orders-create_with_product' product.pk %}" class="btn">{% trans "Create Sales Order" %}</a>
+ <div class="btn-group">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% if perms.servo.change_product %}
+ {% if product.can_update_price %}
+ <li><a href="{% url 'products-update_price' product.pk %}">{% trans "Update Price" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Update Price" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ <li><a href="{% url 'products-delete_product' pk=product.pk group=group.slug %}" data-modal="#modal"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% else %}
+ <li><a href="#" class="disabled">{% trans "Update Price" %}</a></li>
+ <li class="divider"></li>
+ <li><a href="#" class="disabled"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% endif %}
+ </ul>
+ </div>
+ <div class="pull-right">
+ {% if perms.servo.change_product %}
+ <a href="{% url 'products-edit_product' pk=product.pk group=group.slug %}" class="btn">{% trans "Edit" %}</a>
+ {% else %}
+ <a href="#" class="btn disabled">{% trans "Edit" %}</a>
+ {% endif %}
+ </div>
+ </div>
+ <div class="tab-pane" id="tab2">
+ <table class="table">
+ <thead>
+ <tr>
+ <th>{% trans "Order" %}</th>
+ <th>{% trans "Customer" %}</th>
+ <th>{% trans "Price" %}</th>
+ <th>{% trans "Created" %}</th>
+ <th>{% trans "Dispatched" %}</th>
+ </tr>
+ </thead>
+ {% for i in product.serviceorderitem_set.all reversed %}
+ <tr>
+ {% with i.order as order %}
+ <td><a href="{{ order.get_absolute_url }}">{{ order.code }}</a></td>
+ <td>{{ order.customer_name|default:"-" }}</td>
+ <td>{{ i.price|currency }}</td>
+ <td>{{ i.created_at|date:"SHORT_DATE_FORMAT" }}</td>
+ <td>{{ i.dispatched_at|date:"SHORT_DATE_FORMAT" }}</td>
+ {% endwith %}
+ </tr>
+ {% empty %}
+ <tr><td colspan="5" class="empty muted">{% trans "No Sales Orders" %}</td></tr>
+ {% endfor %}
+ </table>
+ </div>
+ <div class="tab-pane" id="tab3">
+ <table class="table">
+ <thead>
+ <tr>
+ <th>{% trans "Order" %}</th>
+ <th>{% trans "Created" %}</th>
+ <th>{% trans "Price" %}</th>
+ <th>{% trans "Received" %}</th>
+ </tr>
+ </thead>
+ {% for i in product.purchaseorderitem_set.all reversed %}
+ <tr>
+ {% with i.purchase_order as order %}
+ <td><a href="{{ order.get_absolute_url }}">{{ order.pk }}</a></td>
+ <td>{{ i.created_at|date:"SHORT_DATE_FORMAT" }}</td>
+ <td>{{ i.price|currency }}</td>
+ <td>{{ i.received_at|date:"SHORT_DATE_FORMAT" }}</td>
+ {% endwith %}
+ </tr>
+ {% empty %}
+ <tr><td colspan="4" class="empty muted">{% trans "No Purchase Orders" %}</td></tr>
+ {% endfor %}
+ </table>
+ </div>
+ <div class="tab-pane" id="tab4">
+ <table class="table">
+ <thead>
+ <tr>
+ <th>{% trans "Invoice" %}</th>
+ <th>{% trans "Order" %}</th>
+ <th>{% trans "Created" %}</th>
+ <th>{% trans "Price" %}</th>
+ </tr>
+ </thead>
+ {% for i in product.invoiceitem_set.all reversed %}
+ <tr>
+ <td><a href="{{ i.invoice.get_absolute_url }}">{{ i.invoice.pk }}</a></td>
+ {% with i.invoice.order as order %}
+ <td><a href="{{ order.get_absolute_url }}">{{ order.code }}</a></td>
+ {% endwith %}
+ <td>{{ i.created_at|date:"SHORT_DATE_FORMAT" }}</td>
+ <td>{{ i.price|currency }}</td>
+ </tr>
+ {% empty %}
+ <tr><td colspan="4" class="empty muted">{% trans "No invoices" %}</td></tr>
+ {% endfor %}
+ </table>
+ </div>
+ </div>
+</div>
+{% endblock third_column %}
+
+{% block breadcrumb %}
+<li class="active"><span class="divider">/</span>{{ product.title }}</li>
+{% endblock breadcrumb %}
diff --git a/servo/templates/products/view_incoming.html b/servo/templates/products/view_incoming.html
new file mode 100755
index 0000000..8404ab3
--- /dev/null
+++ b/servo/templates/products/view_incoming.html
@@ -0,0 +1 @@
+{% extends "shipments/list_incoming.html" %}
diff --git a/servo/templates/purchases/edit_po.html b/servo/templates/purchases/edit_po.html
new file mode 100755
index 0000000..618f1a3
--- /dev/null
+++ b/servo/templates/purchases/edit_po.html
@@ -0,0 +1,92 @@
+{% extends "purchases/list_pos.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+ <a class="btn" href="{% url 'purchases-choose_for_po' order.pk %}" data-modal="#modal"><i class="icon-shopping-cart"></i> {% trans "Add Product" %}</a>
+{% endblock toolbar %}
+
+{% block filter_bar %}
+{% endblock filter_bar %}
+
+{% block detail_view %}
+ <form method="post" accept-charset="utf-8" action="">
+ <div class="span3">
+ {% include "form_field_snippet.html" with field=form.sales_order %}
+ {% include "form_field_snippet.html" with field=form.reference %}
+ {% include "form_field_snippet.html" with field=form.confirmation %}
+ </div>
+ <div class="span9">
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "Products" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Dispatch" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ {% csrf_token %}
+ {{ formset.management_form }}
+ <div class="tab-pane active" id="tab1">
+ <table class="table">
+ <thead>
+ <tr>
+ <th>{% trans "Code" %}</th>
+ <th>{% trans "Product" %}</th>
+ <th>{% trans "Reference" %}</th>
+ <th>{% trans "Amount" %}</th>
+ <th>{% trans "Purchase Price" %}</th>
+ {% if not order.submitted_at %}
+ <th>{% trans "Delete" %}</th>
+ {% else %}
+ <th></th>
+ {% endif %}
+ </tr>
+ </thead>
+ <tbody>
+ {% for form in formset %}
+ {{ form.id }}
+ {{ form.product }}
+ <tr>
+ <td>{{ form.code }}</td>
+ <td>{{ form.title }}</td>
+ <td>{{ form.reference }}</td>
+ <td>{{ form.amount }}</td>
+ <td>{{ form.price }}</td>
+ {% if not order.submitted_at %}
+ <td>{{ form.DELETE }}</td>
+ {% else %}
+ <td></td>
+ {% endif %}
+ </tr>
+ {% empty %}
+ <tr>
+ <td colspan="6" class="muted empty">{% trans "Order does not contain any products" %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ <tfoot>
+ <tr>
+ <td colspan="3" style="text-align:right">{% trans "Total" %}:</td>
+ <td>{{ order.amount }}</td>
+ <td>{{ order.sum|currency }}</td>
+ <td></td>
+ </tr>
+ </tfoot>
+ </table>
+ </div>
+ <div class="tab-pane" id="tab2">
+ {% include "form_field_snippet.html" with field=form.carrier %}
+ {% include "form_field_snippet.html" with field=form.supplier %}
+ {% include "form_field_snippet.html" with field=form.tracking_id %}
+ {% include "form_field_snippet.html" with field=form.days_delivered %}
+ </div>
+ </div>
+ {% if not order.submitted_at %}
+ <div class="form-actions">
+ <label class="checkbox pull-left">
+ <input type="checkbox" name="confirm" id="id_confirm"> {% trans "Confirm" %}
+ </label>
+ <div class="pull-right"><button type="submit" class="btn btn-primary" id="save-bulk-return" data-placeholder="{% trans "Submit" %}">{% trans "Save" %}</button></div>
+ </div>
+ {% endif %}
+ </div>
+ </form>
+{% endblock detail_view %}
diff --git a/servo/templates/purchases/list_pos.html b/servo/templates/purchases/list_pos.html
new file mode 100755
index 0000000..f580598
--- /dev/null
+++ b/servo/templates/purchases/list_pos.html
@@ -0,0 +1,132 @@
+{% extends "default.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+<div class="btn-group">
+ <a href="{% url 'purchases-create_po' %}" class="btn"><i class="icon-plus"></i> {% trans "New" %}</a>
+</div>
+{% endblock toolbar %}
+
+{% block content %}
+
+<div class="row-fluid row-header">
+ <div class="span12">
+ <form class="form-search pull-right">
+
+ </form>
+ </div>
+</div>
+
+{% include "products/tabs.html" %}
+
+{% block filter_bar %}
+<div class="row-fluid">
+ <div class="span12 well">
+ <form action="" method="post" class="form-inline">
+ {% csrf_token %}
+ {% for field in form %}
+ <div class="control-group pull-left">
+ <label class="control-label">{{ field.label }}</label>
+ <div class="controls">{{ field }}</div>
+ </div>
+ {% endfor %}
+ <div class="control-group">
+ <label class="control-label">&nbsp;</label>
+ <div class="controls">
+ <button class="btn btn-primary pull-right" type="submit"><i class="icon-search icon-white"></i> {% trans "Search" %}</button>
+ </div>
+ </div>
+ </form>
+ </div>
+</div>
+{% endblock filter_bar %}
+
+<div class="row-fluid">
+ <div class="span12">
+ {% block detail_view %}
+ <table class="table table-hover">
+ <thead>
+ <tr>
+ <th>#</th>
+ <th>{% trans "Created" %}</th>
+ <th>{% trans "Ordered" %}</th>
+ <th>{% trans "Reference" %}</th>
+ <th>{% trans "Confirmation" %}</th>
+ <th>{% trans "Received" %}</th>
+ <th>{% trans "Order" %}</th>
+ <th>{% trans "Products" %}</th>
+ <th>{% trans "Total" %}</th>
+ <th></th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for po in orders %}
+ <tr>
+ <td><a href="{{ po.get_absolute_url }}">{{ po.id|safe }}</a></td>
+ <td>{{ po.created_at|date:"SHORT_DATE_FORMAT" }}</td>
+ <td>{{ po.submitted_at|date:"SHORT_DATE_FORMAT" }}</td>
+ <td>{{ po.reference|default:"" }}</td>
+ <td>{{ po.confirmation|default:"" }}</td>
+ <td>{{ po.date_arrived }}</td>
+ {% if po.sales_order %}
+ <td><a href="{% url 'orders-edit' po.sales_order.pk %}">{{ po.sales_order.code }}</a></td>
+ {% else %}
+ <td></td>
+ {% endif %}
+ <td>{{ po.amount }}</td>
+ <td>{{ po.sum|currency }}</td>
+ <td>
+ <div class="btn-group pull-right">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% if po.can_create_gsx_stock %}
+ <li><a href="{% url 'purchases-submit_stock_order' po.id %}" data-modal="#modal">{% trans "Create GSX Stocking Order" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Create GSX Stocking Order" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ {% if perms.servo.change_purchaseorder and po.is_editable %}
+ <li><a href="{{ po.get_absolute_url }}">{% trans "Edit" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Edit" %}</a></li>
+ {% endif %}
+ {% if perms.servo.delete_purchaseorder and po.is_editable %}
+ <li><a href="{% url 'purchases-delete_po' po.id %}">{% trans "Delete" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Delete" %}</a></li>
+ {% endif %}
+ </ul>
+ </div>
+ </td>
+ </tr>
+ {% empty %}
+ <tr><td colspan="10" class="empty muted">{% trans "No Purchase Orders" %}</td></tr>
+ {% endfor %}
+ </tbody>
+ <tfoot>
+ <tr>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td><strong>{{ total.total__sum|currency|default:"" }}</strong></td>
+ <td></td>
+ </tr>
+ </tfoot>
+ </table>
+ {% include "pagination.html" with items=orders %}
+ {% endblock detail_view %}
+ </div>
+</div>
+{% endblock content %}
+
+{% block crumbs %}
+<li><a href="{% url 'purchases-list_pos' %}">{% trans "Purchase Orders" %}</a></li>
+{% endblock crumbs %}
diff --git a/servo/templates/purchases/order_stock.html b/servo/templates/purchases/order_stock.html
new file mode 100755
index 0000000..fe3f4a0
--- /dev/null
+++ b/servo/templates/purchases/order_stock.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Submit this stocking order?" %}
+{% endblock header %}
+
+{% block body %}
+ {% trans "Products will be ordered from GSX." %}
+{% endblock body %}
+
+{% block footer %}
+ <form action="{{ action }}" method="post">
+ {% csrf_token %}
+ <button class="btn btn-danger">{% trans "Submit" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/purchases/view_po.html b/servo/templates/purchases/view_po.html
new file mode 100755
index 0000000..c43a058
--- /dev/null
+++ b/servo/templates/purchases/view_po.html
@@ -0,0 +1,56 @@
+{% extends "purchases/edit_po.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+{% endblock toolbar %}
+
+{% block filter_bar %}
+{% endblock filter_bar %}
+
+{% block detail_view %}
+ <div class="row">
+ <div class="span4">
+ <dl class="dl-horizontal">
+ <dt>{% trans "Created By" %}</dt>
+ <dd>{{ po.created_by }}</dd>
+ <dt>{% trans "Created At" %}</dt>
+ <dd>{{ po.created_at|date:"SHORT_DATE_FORMAT" }}</dd>
+ <dt>{% trans "Sales Order" %}</dt>
+ <dd>{{ po.sales_order|default:"" }}</dd>
+ <dt>{% trans "Reference" %}</dt>
+ <dd>{{ po.reference }}</dd>
+ <dt>{% trans "Confirmation" %}</dt>
+ <dd>{{ po.confirmation }}</dd>
+ </dl>
+ </div>
+ <div class="span8">
+ <table class="table">
+ <thead>
+ <tr>
+ <th>{% trans "Product" %}</th>
+ <th>{% trans "Reference" %}</th>
+ <th>{% trans "Amount" %}</th>
+ <th>{% trans "Purchase Price" %}</th>
+ <th>{% trans "Received At" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for i in po.purchaseorderitem_set.all %}
+ <tr>
+ <td><strong>{{ i.code }}</strong><br/>{{ i.title }}</td>
+ <td>{{ i.reference }}</td>
+ <td>{{ i.amount }}</td>
+ <td>{{ i.price|currency }}</td>
+ <td>{{ i.received_at|date:"SHORT_DATE_FORMAT"|default:"-" }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ </div>
+ </div>
+{% endblock detail_view %}
+
+{% block crumbs %}
+ <li><a href="{% url 'purchases-list_pos' %}">{% trans "Purchase Orders" %}</a></li>
+{% endblock crumbs %}
diff --git a/servo/templates/repairs/add_part.html b/servo/templates/repairs/add_part.html
new file mode 100755
index 0000000..2236631
--- /dev/null
+++ b/servo/templates/repairs/add_part.html
@@ -0,0 +1,22 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% blocktrans with repair=repair.confirmation %}Add part to repair {{ repair }}?{% endblocktrans %}
+{% endblock header %}
+
+{% block body %}
+<form method="post" action="{{ action }}">
+ <div class="media">
+ <a class="pull-left" href="#">
+ <img class="media-object" src="{{ item.product.get_photo }}" style="width:120px"/>
+ </a>
+ <div class="media-body">
+ <h4 class="media-heading">{{ item.code }}</h4>
+ <p>{{ item.title }}</p>
+ <p>{{ item.get_comptia_code_display }}, {{ item.get_price_category_display }}</p>
+ </div>
+ </div>
+ {% csrf_token %}
+</form>
+{% endblock body %}
diff --git a/servo/templates/repairs/check_parts.html b/servo/templates/repairs/check_parts.html
new file mode 100755
index 0000000..519044e
--- /dev/null
+++ b/servo/templates/repairs/check_parts.html
@@ -0,0 +1,10 @@
+{% load servo_tags %}
+{% for p in parts %}
+ <label class="checkbox">
+ <input type="checkbox" {% if p.pk in checked_parts %}checked="checked"{% endif %} class="toggle_part" name="parts" value="{{ p.pk|safe }}"/><small><strong>{{ p.code }}</strong></small>
+ <small class="pull-right">{{ p.price|currency }}</small>
+ </label>
+ <small class="muted">{{ p.title }}</small><br/>
+ <small class="muted">{{ p.get_price_category_display }} - {{ p.warranty_status }}</small>
+ <hr class="dashed"/>
+{% endfor %}
diff --git a/servo/templates/repairs/delete_part.html b/servo/templates/repairs/delete_part.html
new file mode 100755
index 0000000..4a80824
--- /dev/null
+++ b/servo/templates/repairs/delete_part.html
@@ -0,0 +1,12 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+{% trans "Remove this part from the GSX repair?" %}
+{% endblock header %}
+
+{% block footer %}
+<form method="post" action="{{ action }}">{% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+</form>
+{% endblock footer %}
diff --git a/servo/templates/repairs/delete_repair.html b/servo/templates/repairs/delete_repair.html
new file mode 100755
index 0000000..3f68478
--- /dev/null
+++ b/servo/templates/repairs/delete_repair.html
@@ -0,0 +1,16 @@
+{% extends "snippets/modal.html" %}
+{% load i18n %}
+
+{% block header %}
+{% trans "Delete this GSX repair?" %}
+{% endblock header %}
+
+{% block body %}
+{% trans "Only repairs that have not been submitted can be deleted." %}
+{% endblock body %}
+
+{% block footer %}
+<form method="post" action="{{ action }}">{% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+</form>
+{% endblock footer %}
diff --git a/servo/templates/repairs/get_details.html b/servo/templates/repairs/get_details.html
new file mode 100755
index 0000000..a6fe914
--- /dev/null
+++ b/servo/templates/repairs/get_details.html
@@ -0,0 +1,27 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {{ repair.dispatch_id }}
+{% endblock header %}
+
+{% block body %}
+<dl class="dl-horizontal">
+ <dt>{% trans "Service Order" %}</dt>
+ <dd>{{ repair.po_number|safe }}</dd>
+ <dt>{% trans "Warranty Coverage" %}</dt>
+ <dd>{{ repair.status_description|default:"-" }}</dd>
+ <dt>{% trans "CS Code" %}</dt>
+ <dd>{{ repair.cs_code|default:"-" }}</dd>
+ <dt>{% trans "Notes" %}</dt>
+ <dd>{{ repair.notes|default:"-" }}</dd>
+ <dt>{% trans "Tracking Number" %}</dt>
+ <dd>{{ repair.tracking_number|default:"-" }}</dd>
+ <dt>{% trans "Parts" %}</dt>
+ <dd>
+ {% for p in repair.parts %}
+ <strong>{{ p.partNumber }}</strong> {{ p.partDescription }}<br/>
+ {% endfor %}
+ </dd>
+</dl>
+{% endblock body %}
diff --git a/servo/templates/repairs/part_menu.html b/servo/templates/repairs/part_menu.html
new file mode 100755
index 0000000..c314496
--- /dev/null
+++ b/servo/templates/repairs/part_menu.html
@@ -0,0 +1,33 @@
+{% load i18n %}
+<ul class="dropdown-menu">
+{% if part.can_return %}
+ <li><a href="{% url 'parts-return_label' repair.pk part.pk %}" class="window">{% trans "Print Return Label" %}</a></li>
+ <li><a href="{% url 'parts-register_return' part.pk %}">{{ part.get_return_title }}</a></li>
+{% else %}
+ <li class="disabled"><a href="#" title="{% trans 'Part has no return order number' %}">{% trans "Print Return Label" %}</a></li>
+ <li class="disabled"><a href="#">{% trans "Register for Return" %}</a></li>
+{% endif %}
+{% if part.can_update_sn %}
+ <li><a href="{% url 'repairs-update_sn' repair.pk part.pk %}">{% trans "Update Serial Numbers" %}</a></li>
+{% else %}
+ <li class="disabled"><a href="#">{% trans "Update Serial Numbers" %}</a></li>
+{% endif %}
+ <li class="divider"></li>
+{% if repair.is_open %}
+ <li><a href="{% url 'shipments-update_part' part=part.pk return_type=1 %}" data-modal="#modal" class="spin">{% trans "Return DOA" %}</a></li>
+ <li><a href="{% url 'shipments-update_part' part=part.pk return_type=2 %}" data-modal="#modal" class="spin">{% trans "Return Good Part" %}</a></li>
+ <li><a href="{% url 'shipments-update_part' part=part.pk return_type=3 %}" data-modal="#modal" class="spin">{% trans "Convert to Stock" %}</a></li>
+ <li class="divider"></li>
+{% if part.line_number %}
+ <li><a href="{% url 'repairs-remove_part' repair.pk part.pk %}" data-modal="#modal">{% trans "Remove from Repair" %}</a></li>
+{% else %}
+ <li class="disabled"><a href="#">{% trans "Remove from Repair" %}</a></li>
+{% endif %}
+{% else %}
+ <li class="disabled"><a href="#">{% trans "Return DOA" %}</a></li>
+ <li class="disabled"><a href="#">{% trans "Return Good Part" %}</a></li>
+ <li class="disabled"><a href="#">{% trans "Convert to Stock" %}</a></li>
+ <li class="divider"></li>
+ <li class="disabled"><a href="#">{% trans "Remove from Repair" %}</a></li>
+{% endif %}
+</ul>
diff --git a/servo/templates/rules/form.html b/servo/templates/rules/form.html
new file mode 100644
index 0000000..ac7a35c
--- /dev/null
+++ b/servo/templates/rules/form.html
@@ -0,0 +1,142 @@
+{% extends "rules/list_rules.html" %}
+{% load bootstrap3 %}
+{% load static %}
+{% load i18n %}
+
+{% block third_column %}
+<div style="margin-top:28px">
+ <form method="post" action="" accept-charset="utf-8" class="form-horizontal" data-bind="submit: validateAndSave">
+ {% csrf_token %}
+ <div class="form-group">
+ <input class="form-control" name="description" type="text" autocomplete="off" data-bind="value: rule.description"/>
+ </div>
+ <fieldset>
+ <legend>If <select name="match" data-bind="options: rule.matchChoices, optionsText: 'title', optionsValue: 'key', value: rule.match"></select> of the conditions are met:</legend>
+ <table>
+ <tbody data-bind="foreach: rule.conditions">
+ <tr>
+ <td>
+ <div class="form-group">
+ <select class="form-control" data-bind="options: keyChoices, optionsText: 'title', optionsValue: 'key', value: key" name="condition-key">
+ </select>
+ </div>
+ </td>
+ <td>
+ <div class="form-group">
+ <!-- ko if: canSelect() -->
+ <select class="form-control" name="condition-value" data-bind="options: valueChoices, optionsText: 'title', optionsValue: 'value'">
+ </select>
+ <!-- /ko -->
+ <!-- ko if: !canSelect() -->
+ <input class="form-control" type="text" name="condition-value" required="required" data-bind="value: value"/>
+ <!-- /ko -->
+ </div>
+ </td>
+ <td>
+ <a href="#" class="btn btn-default" data-bind="click: $parent.removeCondition, css: { disabled: $index() == 0 }"><i class="icon-minus"></i></a> <a href="#" class="btn btn-default" data-bind="click: $parent.addCondition"><i class="icon-plus"></i></a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </fieldset>
+ <fieldset>
+ <legend>{% trans "Peform the following actions" %}:</legend>
+ <table>
+ <tbody data-bind="foreach: rule.actions">
+ <tr>
+ <td>
+ <div class="form-group" id="key">
+ <select class="form-control" data-bind="options: keyChoices, optionsText: 'title', optionsValue: 'key', value: key" name="action-key"></select>
+ </div>
+ </td>
+ <td>
+ <!-- ko if: canSelect() -->
+ <select class="form-control" name="action-value" data-bind="options: valueChoices, optionsText: 'title', optionsValue: 'value'">
+ </select>
+ <!-- /ko -->
+ <!-- ko if: !canSelect() -->
+ <input type="text" name="action-value" data-bind="value: value"/>
+ <!-- /ko -->
+ </td>
+ <td>
+ <a class="btn btn-default" data-bind="click: $parent.removeAction, css: { disabled: $index() == 0 }" href="#"><i class="icon-minus"></i></a> <a class="btn btn-default" data-bind="click: $parent.addAction" href="#"><i class="icon-plus"></i></a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </fieldset>
+ <hr/>
+ {% buttons %}
+ <div class="form-controls pull-right">
+ {% if rule.pk %}
+ <a class="btn btn-danger" href="{% url 'rules-delete_rule' rule.pk %}" data-modal="#modal">{% trans "Delete" %}</a>
+ {% else %}
+ <a class="btn btn-danger disabled" href="#">{% trans "Delete" %}</a>
+ {% endif %}
+ <a class="btn btn-default" href="{% url 'rules-list_rules' %}">{% trans "Cancel" %}</a>
+ <button type="submit" class="btn btn-primary" data-bind="disable: rule.description().length < 3">{% trans "OK" %}</button>
+ </div>
+ </form>
+ </div>
+ {% endbuttons %}
+{% endblock third_column %}
+
+{% block media %}
+ <script type="text/javascript" src="{% static "js/knockout.js" %}"></script>
+ <script type="text/javascript" src="{% static "js/rules.js" %}"></script>
+ <script type="text/javascript">
+ // start data init
+ var cData = [];
+ cData['QUEUE'] = [];
+ cData['STATUS'] = [];
+
+ var aData = [];
+ aData['ADD_TAG'] = [];
+ aData['SET_USER'] = [];
+ aData['SET_QUEUE'] = [];
+ aData['SEND_EMAIL'] = [];
+
+ // get the possible choices
+ $.get('/api/statuses/', function(r){
+ r.forEach(function(e){
+ var choice = {title: e.fields.title, value: e.pk};
+ cData['STATUS'].push(choice);
+ });
+ });
+
+ $.get('/api/queues/', function(r){
+ r.forEach(function(e){
+ var choice = {title: e.fields.title, value: e.pk};
+ cData['QUEUE'].push(choice);
+ aData['SET_QUEUE'].push(choice);
+ });
+
+ var viewModel = new ViewModel(cData, aData);
+ ko.applyBindings(viewModel);
+
+ {% if rule.pk %}
+ var data = {{ rule.serialize|safe }};
+ viewModel.rule.description(data.description);
+ viewModel.rule.match(data.match);
+ var conditions = [];
+ data.conditions.forEach(function(e){
+ var c = new Condition(cData);
+ c.key(e.key);
+ c.value(e.value);
+ c.operator(e.operator);
+ conditions.push(c);
+ });
+ viewModel.rule.conditions(conditions);
+ var actions = [];
+ data.actions.forEach(function(e){
+ var c = new Action(aData);
+ c.key(e.key);
+ c.value(e.value);
+ actions.push(c);
+ });
+ viewModel.rule.actions(actions);
+ {% endif %}
+ });
+ // end data init
+ </script>
+{% endblock media %}
diff --git a/servo/templates/rules/list.html b/servo/templates/rules/list.html
new file mode 100644
index 0000000..3e9ea9e
--- /dev/null
+++ b/servo/templates/rules/list.html
@@ -0,0 +1,6 @@
+{% extends "admin/index.html" %}
+{% load i18n %}
+
+{% block toolbar %}
+ <a class="btn" href="{% url 'rules-create' %}"><i class="icon-plus"></i> {% trans "New Rule" %}</a>
+{% endblock toolbar %}
diff --git a/servo/templates/rules/list_rules.html b/servo/templates/rules/list_rules.html
new file mode 100644
index 0000000..9aef78e
--- /dev/null
+++ b/servo/templates/rules/list_rules.html
@@ -0,0 +1,22 @@
+{% extends "admin/index.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+ <a class="btn" href="{% url 'rules-create' %}"><i class="icon-plus"></i> {% trans "New Rule" %}</a>
+{% endblock toolbar %}
+
+{% block second_column %}
+ <div class="span3">
+ <ul class="nav nav-pills nav-stacked">
+ <li class="nav-header">{% trans "Rules" %}</li>
+ {% for o in object_list %}
+ <li class="{% active_url request o.get_admin_url %}"><a href="{{ o.get_admin_url }}">{{ o.get_name }}</a></li>
+ {% endfor %}
+ </ul>
+ </div>
+ <div class="span9">
+ {% block third_column %}
+ {% endblock third_column %}
+ </div>
+{% endblock second_column %}
diff --git a/servo/templates/search/results/articles.html b/servo/templates/search/results/articles.html
new file mode 100755
index 0000000..8ea7535
--- /dev/null
+++ b/servo/templates/search/results/articles.html
@@ -0,0 +1,10 @@
+{% extends "search/spotlight.html" %}
+{% load humanize %}
+{% load servo_tags %}
+
+{% block second_column %}
+{% for i in articles %}
+ <h2>{{ i.title }}</h2>
+ {{ i.content|markdown }}
+{% endfor %}
+{% endblock second_column %}
diff --git a/servo/templates/search/results/customers.html b/servo/templates/search/results/customers.html
new file mode 100755
index 0000000..6203598
--- /dev/null
+++ b/servo/templates/search/results/customers.html
@@ -0,0 +1,26 @@
+{% extends "search/spotlight.html" %}
+{% load i18n %}
+
+{% block second_column %}
+ {% if customers %}
+ {% for i in customers %}
+ <address>
+ <strong><a href="{% url 'customers-view_customer' i.pk %}">{{ i.name }}</a></strong><br>
+ {% if i.street_address %}
+ {{ i.street_address }}<br/>
+ {{ i.zip_code }}, {{ i.city }}<br/>
+ {% endif %}
+ {% if i.phone %}
+ <abbr title="{% trans "Phone" %}">P:</abbr> {{ i.phone }}
+ {% endif %}
+ {% if i.email %}
+ <br/>
+ <a href="{% url 'notes-create_to_customer' customer=i.pk %}"><i class="icon-envelope"></i> {{ i.email }}</a>
+ {% endif %}
+ </address>
+ <hr/>
+ {% endfor %}
+ {% else %}
+ <h1 class="muted text-center">{% trans "No customers found" %}</h1>
+ {% endif %}
+{% endblock second_column %}
diff --git a/servo/templates/search/results/devices.html b/servo/templates/search/results/devices.html
new file mode 100755
index 0000000..d133d55
--- /dev/null
+++ b/servo/templates/search/results/devices.html
@@ -0,0 +1,10 @@
+{% extends "search/spotlight.html" %}
+{% load i18n %}
+
+{% block second_column %}
+ {% if devices %}
+ {% include "devices/list.html" %}
+ {% else %}
+ <h1 class="muted text-center">{% trans "No devices found" %}</h1>
+ {% endif %}
+{% endblock second_column %}
diff --git a/servo/templates/search/results/gsx.html b/servo/templates/search/results/gsx.html
new file mode 100755
index 0000000..ac8471b
--- /dev/null
+++ b/servo/templates/search/results/gsx.html
@@ -0,0 +1,41 @@
+{% extends "search/spotlight.html" %}
+{% load i18n %}
+
+{% block second_column %}
+{% block tabs %}
+ <ul class="nav nav-tabs" id="gsx-tabs">
+ {% if gsx_type == 'serialNumber' or 'alternateDeviceId' %}
+ <li><a href="{% url 'search-gsx' what='warranty' %}?q={{ query }}">{% trans "Device" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Device" %}</a></li>
+ {% endif %}
+ {% if gsx_type == 'serialNumber' or gsx_type == 'partNumber' %}
+ <li><a href="{% url 'search-gsx' what='parts' %}?q={{ query }}">{% trans "Parts" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Parts" %}</a></li>
+ {% endif %}
+ {% if gsx_type == 'serialNumber' or gsx_type == 'dispatchId' %}
+ <li><a href="{% url 'search-gsx' what='repairs' %}?q={{ query }}">{% trans "Repairs" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Repairs" %}</a></li>
+ {% endif %}
+ <li class="pull-right"><a href="#" class="filter_table"><i class="icon-search"></i></a></li>
+ </ul>
+{% endblock tabs %}
+
+{% block results %}
+ <div id="gsx-container" data-source="{% url 'search-gsx_results' what=what %}?q={{ query }}">
+ <div class="progress active">
+ <div class="bar" style="width:1%;" data-progress="0"></div>
+ </div>
+ </div>
+{% endblock results %}
+
+{% endblock second_column %}
+
+{% block media %}
+<script type="text/javascript">
+ var loc = location.pathname + location.search;
+ $('#gsx-tabs>li>a[href="'+loc+'"]').parent().addClass('active');
+</script>
+{% endblock media %}
diff --git a/servo/templates/search/results/gsx_error.html b/servo/templates/search/results/gsx_error.html
new file mode 100755
index 0000000..0c72d03
--- /dev/null
+++ b/servo/templates/search/results/gsx_error.html
@@ -0,0 +1,4 @@
+{% load i18n %}
+<table class="table">
+ <tr><td class="muted empty">{{ message }}</td></tr>
+</table>
diff --git a/servo/templates/search/results/gsx_notfound.html b/servo/templates/search/results/gsx_notfound.html
new file mode 100755
index 0000000..87261bf
--- /dev/null
+++ b/servo/templates/search/results/gsx_notfound.html
@@ -0,0 +1,4 @@
+{% load i18n %}
+<table class="table">
+ <tr><td class="muted empty">{% trans "No search results" %}</td></tr>
+</table>
diff --git a/servo/templates/search/results/gsx_repair_details.html b/servo/templates/search/results/gsx_repair_details.html
new file mode 100755
index 0000000..81908b5
--- /dev/null
+++ b/servo/templates/search/results/gsx_repair_details.html
@@ -0,0 +1,19 @@
+{% load i18n %}
+
+{% for r in results %}
+<h3>{{ r.dispatchId }}</h3>
+<dl class="dl-horizontal">
+ <dt>{% trans "Service Order" %}</dt>
+ <dd>{{ r.purchaseOrderNumber }}</dd>
+ <dt>{% trans "CS Code" %}</dt>
+ <dd>{{ r.csCode|safe }}</dd>
+ <dt>{% trans "Tracking Number" %}</dt>
+ <dd>{{ r.deliveryTrackingNumber }}</dd>
+ <dt>{% trans "Notes" %}</dt>
+ <dd>{{ r.notes }}</dd>
+ <dt>{% trans "Warranty Coverage" %}</dt>
+ <dd>{{ r.coverageStatusDescription }}</dd>
+ <dt>{% trans "Status" %}</dt>
+ <dd>{{ r.orderStatus }}</dd>
+</dl>
+{% endfor %}
diff --git a/servo/templates/search/results/gsx_results.html b/servo/templates/search/results/gsx_results.html
new file mode 100755
index 0000000..dc7fff5
--- /dev/null
+++ b/servo/templates/search/results/gsx_results.html
@@ -0,0 +1,5 @@
+<div id="gsx-container" data-source="{% url 'search-search_gsx' what=what arg=arg value=value %}">
+ <div class="progress active">
+ <div class="bar" style="width:1%;" data-progress="0"></div>
+ </div>
+</div>
diff --git a/servo/templates/search/results/gsx_warranty.html b/servo/templates/search/results/gsx_warranty.html
new file mode 100755
index 0000000..4682885
--- /dev/null
+++ b/servo/templates/search/results/gsx_warranty.html
@@ -0,0 +1,49 @@
+{% load i18n %}
+
+{% for d in results %}
+<div class="row-fluid">
+ <div class="span3">
+ <img class="img-rounded" src="{{ d.image_url }}" alt="{{ d.description }}" title="{{ d.description }}"/>
+ </div>
+ <div class="span9" id="gsx-results">
+ <h3>{{ d.description }}</h3>
+ <dl class="dl-horizontal">
+ <dt>{% trans "Warranty Status" %}</dt>
+ <dd>{{ d.get_warranty_status_display }}</dd>
+ <dt>{% trans "Purchase Date" %}</dt>
+ <dd>{{ d.purchased_on|date:"SHORT_DATE_FORMAT"|default:"-" }}, {{ d.purchase_country|default:"-" }}</dd>
+ <dt>{% trans "Serial Number" %}</dt>
+ <dd>{{ d.sn }}</dd>
+ <dt>{% trans "Configration" %}</dt>
+ <dd>{{ d.configuration }}</dd>
+ {% if d.activation %}
+ <dt>IMEI</dt>
+ <dd>{{ d.activation.imeiNumber }}</dd>
+ <dt>{% trans "Activation Profile" %}</dt>
+ <dd>{{ d.activation.initialActivationPolicyDetails }}</dd>
+ <dt>{% trans "Unlocked" %}</dt>
+ <dd>{{ d.activation.unlocked }}</dd>
+ <dt>{% trans "Find My iPhone" %}</dt>
+ <dd>{{ d.fmip_is_active|yesno:"Active,Inactive" }}</dd>
+ {% endif %}
+ </dl>
+ <div class="btn-group pull-right">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'orders-create_with_sn' sn=query %}">{% trans "Create Service Order" %}</a></li>
+ {% if request.session.current_order_id %}
+ <li><a href="{% url 'orders-add_device' pk=request.session.current_order_id sn=query %}">{% trans "Use in order" %} #{{ request.session.current_order.code }}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ {% if d.manualURL %}
+ <li><a href="{{ d.manualURL }}">{% trans "Download Manual" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="">{% trans "Download Manual" %}</a></li>
+ {% endif %}
+ </ul>
+ </div>
+ </div>
+</div>
+{% endfor %}
diff --git a/servo/templates/search/results/notes.html b/servo/templates/search/results/notes.html
new file mode 100755
index 0000000..ec2547a
--- /dev/null
+++ b/servo/templates/search/results/notes.html
@@ -0,0 +1,20 @@
+{% extends "search/spotlight.html" %}
+{% load servo_tags %}
+{% load humanize %}
+
+{% block second_column %}
+<ul class="media-list">
+ {% for note in notes %}
+ <li class="media">
+ <a class="pull-left" href="#">
+ <img src="{{ note.created_by.get_avatar }}" alt="{{ note.created_by }}" title="{{ note.created_by }}" class="img-rounded avatar"/>
+ </a>
+ <div class="media-body">
+ <h5 class="media-heading">{{ note.get_sender_name }} {{ note.created_at|naturaltime }}{% if note.order %} <a href="{% url 'orders-edit' note.order.pk %}#note-{{ note.pk }}"><i class="icon-share-alt"></i></a>{% endif %}</h5>
+ {{ note.body|markdown }}
+ </div>
+ <hr/>
+ </li>
+ {% endfor %}
+</ul>
+{% endblock second_column %}
diff --git a/servo/templates/search/results/orders.html b/servo/templates/search/results/orders.html
new file mode 100755
index 0000000..1e1fc6f
--- /dev/null
+++ b/servo/templates/search/results/orders.html
@@ -0,0 +1,10 @@
+{% extends "search/spotlight.html" %}
+{% load i18n %}
+
+{% block second_column %}
+ {% if orders %}
+ {% include "orders/list.html" %}
+ {% else %}
+ <h1 class="muted text-center">{% trans "No orders found" %}</h1>
+ {% endif %}
+{% endblock second_column %}
diff --git a/servo/templates/search/results/products.html b/servo/templates/search/results/products.html
new file mode 100755
index 0000000..32afb5c
--- /dev/null
+++ b/servo/templates/search/results/products.html
@@ -0,0 +1,10 @@
+{% extends "search/spotlight.html" %}
+{% load i18n %}
+
+{% block second_column %}
+ {% if products %}
+ {% include "products/list.html" %}
+ {% else %}
+ <h1 class="muted text-center">{% trans "No products found" %}</h1>
+ {% endif %}
+{% endblock second_column %}
diff --git a/servo/templates/search/spotlight.html b/servo/templates/search/spotlight.html
new file mode 100755
index 0000000..e372b23
--- /dev/null
+++ b/servo/templates/search/spotlight.html
@@ -0,0 +1,37 @@
+{% extends "two_column_layout.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+ <a href="{% url 'customers-create_customer' group='all' %}?name={{ query }}" class="btn btn-inverse"><i class="icon-plus icon-white"></i> {% trans "New Customer" %}</a>
+{% endblock toolbar %}
+
+{% block first_column %}
+<ul class="nav nav-list">
+ <li class="nav-header">{% trans "Results" %}</li>
+ <li class="{% active request 'search/customers' %}">
+ <a href="/search/customers/?q={{ query }}">{% trans "Customers" %}</a>
+ </li>
+ <li class="{% active request 'search/devices' %}">
+ <a href="/search/devices/?q={{ query }}">{% trans "Devices" %}</a>
+ </li>
+ <li class="{% active request 'search/gsx' %}">
+ <a href="/search/gsx/{{ what }}?q={{ query }}">{% trans "GSX" %}</a>
+ </li>
+ <li class="{% active request 'search/orders' %}">
+ <a href="/search/orders/?q={{ query }}">{% trans "Orders" %}</a>
+ </li>
+ <li class="{% active request 'search/products' %}">
+ <a href="/search/products/?q={{ query }}">{% trans "Products and Parts" %}</a>
+ </li>
+ <li class="{% active request 'search/notes' %}"><a href="/search/notes/?q={{ query }}">{% trans "Notes" %}</a></li>
+ <li class="{% active request 'search/articles' %}"><a href="/search/articles/?q={{ query }}">{% trans "Articles" %}</a></li>
+</ul>
+{% endblock first_column %}
+
+{% block second_column %}
+{% endblock second_column %}
+
+{% block footer %}
+ <li><i class="icon-home"></i> <a href="{% url 'accounts-list_orders' request.user.username %}">{% trans "Home" %}</a> <span class="divider">/</span></li><li class="active">{{ title }}</li>
+{% endblock footer %}
diff --git a/servo/templates/shipments/add_to_return-results.html b/servo/templates/shipments/add_to_return-results.html
new file mode 100755
index 0000000..0f1d94e
--- /dev/null
+++ b/servo/templates/shipments/add_to_return-results.html
@@ -0,0 +1,8 @@
+{% load i18n %}
+<ul class="nav nav-pills nav-stacked">
+{% for i in results %}
+ <li><a href="{% url 'shipments-add_to_return' pk=shipment part=i.pk %}">{{ i.order_item.code }}</a></li>
+{% empty %}
+ <li class="text-center">{% trans "No parts found" %}</li>
+{% endfor %}
+</ul>
diff --git a/servo/templates/shipments/add_to_return.html b/servo/templates/shipments/add_to_return.html
new file mode 100755
index 0000000..c1ca9da
--- /dev/null
+++ b/servo/templates/shipments/add_to_return.html
@@ -0,0 +1,14 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+{% trans "Add part to return" %}
+{% endblock header %}
+
+{% block body %}
+<form method="post" action="{{ action }}" accept-charset="utf-8" data-target="#search-results" id="search-form">
+ {% csrf_token %}
+ <input type="text" class="search-query" name="q" autocomplete="off" placeholder="{% trans "Return order number" %}"/>
+</form>
+<div id="search-results"></div>
+{% endblock body %}
diff --git a/servo/templates/shipments/edit_bulk_return.html b/servo/templates/shipments/edit_bulk_return.html
new file mode 100755
index 0000000..588a998
--- /dev/null
+++ b/servo/templates/shipments/edit_bulk_return.html
@@ -0,0 +1,101 @@
+{% extends "shipments/list_returns.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block toolbar %}
+ <a href="{% url 'shipments-pick_for_return' shipment.pk %}" class="btn" data-modal="#modal"><i class="icon-plus"></i> {% trans "Add Part" %}</a>
+<!--
+ {% if formset|length %}
+ <a href="{% url 'shipments-verify' shipment.pk %}" class="btn"><i class="icon-ok"></i> {% trans "Verify" %}</a>
+ {% else %}
+ <a href="#" class="btn disabled"><i class="icon-ok"></i> {% trans "Verify" %}</a>
+ {% endif %}
+//-->
+{% endblock toolbar %}
+
+{% block second_column %}
+<ul class="nav nav-tabs">
+ {% for k, v in accounts %}
+ <li class="{% active request k %}"><a href="{% url 'shipments-edit_bulk_return' ship_to=k %}">{{ v }}</a></li>
+ {% endfor %}
+</ul>
+<form method="post" action="">
+ <div class="span3">
+ {% block return_info %}
+ {% csrf_token %}
+ {{ formset.management_form }}
+ <div class="control-group">
+ <label class="control-label">{% trans "Carrier" %}</label>
+ <div class="controls">
+ {{ form.carrier }}
+ </div>
+ </div>
+ <div class="control-group">
+ <label class="control-label">{% trans "Tracking" %}</label>
+ <div class="controls">
+ {{ form.tracking_id }}
+ </div>
+ </div>
+ <div class="control-group">
+ <label class="control-label">{% trans "Dimensions" %}</label>
+ <div class="controls">
+ {{ form.length }} {{ form.width }} {{ form.height }}
+ </div>
+ </div>
+ <div class="control-group">
+ <label class="control-label">{% trans "Weight" %}</label>
+ <div class="controls">
+ {{ form.weight }}
+ </div>
+ </div>
+ {% endblock return_info %}
+ </div>
+ <div class="span9">
+ <table class="table">
+ <thead>
+ <th>{% trans "Part" %}</th>
+ <th>{% trans "Reference" %}</th>
+ <th style="width:100px">{% trans "Return Order" %}</th>
+ <th>{% trans "Overpack" %}</th>
+ <th></th>
+ </thead>
+ <tbody>
+ {% block return_parts %}
+ {% for f in formset %}
+ <tr>
+ {{ f.id }}
+ {{ f.part_number }}
+ {{ f.part_title }}
+ {{ f.service_order }}
+ {{ f.return_order }}
+ {% with f.instance as p %}
+ <td><strong>{{ p.part_number }}</strong><br/>{{ p.part_title }}</td>
+ {% if p.order_item %}
+ <td><a href="{{ p.order_item.order.get_absolute_url }}">{{ p.reference }}</a></td>
+ {% else %}
+ <td>{{ p.reference }}</td>
+ {% endif %}
+ <td>{{ f.return_order.value }}</td>
+ <td>{% include "snippets/control_group.html" with field=f.box_number %}</td>
+ <td><a href="{% url 'shipments-remove_from_return' shipment.pk p.pk %}" class="btn"><i class="icon-trash"></i></td>
+ {% endwith %}
+ </tr>
+ {% empty %}
+ <tr>
+ <td colspan="5" class="empty muted">{% trans "No parts registered for this shipment" %}</td>
+ </tr>
+ {% endfor %}
+ {% endblock return_parts %}
+ </tbody>
+ </table>
+ {% block form_controls %}
+ <div class="form-actions">
+ <label class="checkbox pull-left">
+ <input type="checkbox" name="confirm" id="id_confirm"> {% trans "Confirm" %}
+ </label>
+ <button type="submit" class="btn pull-right spin" id="save-bulk-return" data-placeholder="{% trans "Submit" %}">{% trans "Save" %}</button>
+ </div>
+ {% endblock form_controls %}
+ </div>
+</form>
+{% endblock second_column %}
diff --git a/servo/templates/shipments/index.html b/servo/templates/shipments/index.html
new file mode 100755
index 0000000..1584f65
--- /dev/null
+++ b/servo/templates/shipments/index.html
@@ -0,0 +1,46 @@
+{% extends "products/index.html" %}
+{% load i18n %}
+{% load servo_tags %}
+
+{% block toolbar %}{% endblock toolbar %}
+
+{% block content %}
+<div class="row-fluid row-header">
+ <div class="span12">
+ <form class="form-search pull-right">
+ <div class="input-append">
+ <input type="text" class="search-query filter" placeholder="{% trans "Filter results" %}"/>
+ <button type="button" class="btn" data-toggle="collapse" data-target="#collapsable"><i class="icon-search"></i></button>
+ </div>
+ </form>
+ </div>
+</div>
+{% include "products/tabs.html" %}
+
+<div class="row-fluid">
+ {% block second_row %}
+ <div class="span3">
+ {% block first_column %}
+ <ul class="nav nav-list">
+ <li class="{% active request "incoming" %}">
+ <a href="{% url 'shipments-list_incoming' %}">{% trans "Incoming" %} <span class="badge pull-right">{{ counts.incoming }}</span></a>
+ </li>
+ <li class="{% active request "returns/pending" %}">
+ <a href="{% url 'shipments-edit_bulk_return' %}">{% trans "Parts Pending Return" %} <span class="badge pull-right">{{ counts.pending_return }}</span></a>
+ </li>
+ <li class="{% active request 'returns/list' %}"><a href="{% url 'shipments-list_bulk_returns' %}">{% trans "Browse Returns" %} <span class="badge pull-right">{{ counts.returns }}</span></a></li>
+ {% endblock first_column %}
+ </ul>
+ </div>
+ <div class="span9">
+ {% block second_column %}
+ {% endblock second_column %}
+ </div>
+ {% endblock second_row %}
+</div>
+
+{% endblock content %}
+
+{% block breadcrumb %}
+
+{% endblock breadcrumb %}
diff --git a/servo/templates/shipments/list_bulk_returns.html b/servo/templates/shipments/list_bulk_returns.html
new file mode 100755
index 0000000..f2c4843
--- /dev/null
+++ b/servo/templates/shipments/list_bulk_returns.html
@@ -0,0 +1,37 @@
+{% extends "shipments/list_returns.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block second_column %}
+<table class="table table-striped sortable">
+ <thead>
+ <tr>
+ <th>{% trans "ID" %}</th>
+ <th>{% trans "Tracking ID" %}</th>
+ <th>{% trans "Tracking URL" %}</th>
+ <th>{% trans "Parts" %}</th>
+ <th>{% trans "Returned" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for i in returns %}
+ <tr>
+ {% if i.return_id %}
+ <td><a href="{% url 'shipments-view_packing_list' pk=i.pk %}" class="window">{{ i.return_id }}</a></td>
+ {% else %}
+ <td></td>
+ {% endif %}
+ <td>{{ i.tracking_id }}</td>
+ <td><a href="{{ i.tracking_url }}">{{ i.get_carrier_display }}</a></td>
+ <td>{{ i.num_parts }}</td>
+ <td>{{ i.dispatched_by }}<br/><small class="muted">{{ i.dispatched_at|date:"SHORT_DATETIME_FORMAT" }}</small></td>
+ </tr>
+ {% endfor %}
+ </tbody>
+</table>
+{% include "pagination.html" with items=returns %}
+{% endblock second_column %}
+
+{% block breadcrumb %}
+<li class="active"><span class="divider">/</span> {% trans "Browse Returns" %}</li>
+{% endblock breadcrumb %}
diff --git a/servo/templates/shipments/list_incoming.html b/servo/templates/shipments/list_incoming.html
new file mode 100755
index 0000000..5d2d784
--- /dev/null
+++ b/servo/templates/shipments/list_incoming.html
@@ -0,0 +1,61 @@
+{% extends "shipments/index.html" %}
+{% load i18n %}
+
+{% block toolbar %}
+{% endblock toolbar %}
+
+{% block second_column %}
+{% include "snippets/filtering_form.html" %}
+<form method="post" action="">
+ {% csrf_token %}
+ <table class="table table-hover sortable">
+ <thead>
+ <tr>
+ {% if can_receive %}
+ <th data-defaultsort="disabled"></th>
+ {% endif %}
+ <th>{% trans "Part" %}</th>
+ <th>{% trans "Service Order" %}</th>
+ <th>{% trans "Confirmation" %}</th>
+ <th>{% trans "Ordered" %}</th>
+ </tr>
+ </thead>
+ <tbody class="searchable">
+ {% for i in inventory %}
+ <tr>
+ {% if can_receive %}
+ <td><input type="checkbox" name="id" value="{{ i.pk|safe }}" class="toggle-submit"/></td>
+ {% endif %}
+ {% with i.product as p %}
+ <td data-value="{{ p.code }}">
+ <strong><a href="{% url 'shipments-view_incoming' i.pk %}" data-modal="#modal">{{ p.code }}</a></strong><br/>{{ p.title }}
+ </td>
+ {% endwith %}
+ {% with i.purchase_order as po %}
+ <td data-value="{{ po.sales_order.code }}">
+ {% if po.sales_order %}
+ <a href="{% url 'orders-edit' po.sales_order.pk %}">{{ po.sales_order.code }}</a>
+ {% endif %}
+ <br/><small class="muted">{{ po.reference }}</small>
+ </td>
+ <td>{{ po.confirmation }}</td>
+ <td>{{ po.created_by }}<br/><small class="muted">{{ po.submitted_at|date:"SHORT_DATE_FORMAT" }}</small></td>
+ {% endwith %}
+ </tr>
+ {% empty %}
+ <tr><td colspan="7" class="muted empty">{% trans "No incoming products" %}</td></tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% if can_receive %}
+ <div class="form-actions">
+ <button type="submit" class="btn btn-primary pull-right" disabled="disabled">{% trans "Receive" %}</button>
+ </div>
+ {% endif %}
+</form>
+{% include "pagination.html" with items=inventory %}
+{% endblock second_column %}
+
+{% block breadcrumb %}
+<li class="active"><span class="divider">/</span><a href="{% url 'shipments-list_incoming' %}">{% trans "Incoming" %}</a></li>
+{% endblock breadcrumb %}
diff --git a/servo/templates/shipments/list_returns.html b/servo/templates/shipments/list_returns.html
new file mode 100755
index 0000000..7d57286
--- /dev/null
+++ b/servo/templates/shipments/list_returns.html
@@ -0,0 +1,44 @@
+{% extends "shipments/index.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block second_column %}
+<form method="post" action="">
+ {% csrf_token %}
+ <table class="table table-hover">
+ <thead>
+ <tr>
+ <th><input type="checkbox" class="toggle_column"/></th>
+ <th>{% trans "Code" %}</th>
+ <th>{% trans "Title" %}</th>
+ <th>{% trans "Order" %}</th>
+ <th>{% trans "Return Order" %}</th>
+ <th>{% trans "Register For Return" %}</th>
+ <th>{% trans "Serial Number" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for p in parts %}
+ <tr>
+ <td><input type="checkbox" name="items" value="{{ p.returnOrderNumber }}"/></td>
+ <td>{{ p.partNumber }}</td>
+ <td>{{ p.partDescription|truncatechars:42 }}</td>
+ <td>{{ p.purchaseOrderNumber }}</td>
+ <td><a href="{% url 'shipments-return_label' p.partNumber p.returnOrderNumber %}" class="window">{{ p.returnOrderNumber }}</a></td>
+ <td>{{ p.registeredForReturn }}</td>
+ <td>{{ p.kbbSerialNumber }}</td>
+ </tr>
+ {% empty %}
+ <tr>
+ <td colspan="7" class="muted empty">{% trans "No parts pending return" %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ <button type="submit" class="btn btn-primary pull-right" disabled="disabled">{% trans "Submit" %}</button>
+</form>
+{% endblock second_column %}
+
+{% block breadcrumb %}
+<li class="active"><span class="divider">/</span> <a href="{% url 'shipments-returns' %}">{% trans "Parts Pending Return" %}</a></li>
+{% endblock breadcrumb %}
diff --git a/servo/templates/shipments/submit_bulk_return.html b/servo/templates/shipments/submit_bulk_return.html
new file mode 100755
index 0000000..ee897c4
--- /dev/null
+++ b/servo/templates/shipments/submit_bulk_return.html
@@ -0,0 +1,15 @@
+{% extends "modal.html" %}
+{% load i18n %}
+{% block header %}
+ {% trans "Submit the bulk return?" %}
+{% endblock header %}
+
+{% block body %}
+
+{% endblock body %}
+
+{% block footer %}
+ <form method="post" action="{{ action }}">
+ <button type="submit" class="btn btn-primary">{% trans "Submit" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/shipments/update_part.html b/servo/templates/shipments/update_part.html
new file mode 100755
index 0000000..8c0d266
--- /dev/null
+++ b/servo/templates/shipments/update_part.html
@@ -0,0 +1,14 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {{ title }}
+{% endblock header %}
+
+{% block body %}
+{{ msg }}
+<form action="{{ action }}" method="post" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+</form>
+{% endblock body %}
diff --git a/servo/templates/shipments/view_bulk_return.html b/servo/templates/shipments/view_bulk_return.html
new file mode 100755
index 0000000..e5b935c
--- /dev/null
+++ b/servo/templates/shipments/view_bulk_return.html
@@ -0,0 +1,35 @@
+{% extends "shipments/edit_bulk_return.html" %}
+{% load i18n %}
+
+{% block return_info %}
+<dl>
+ <dt>{% trans "Carrier" %}</dt>
+ <dd>{{ shipment.get_carrier_display }}</dd>
+ <dt>{% trans "Tracking" %}</dt>
+ <dd>{{ shipment.tracking_id }}</dd>
+ <dt>{% trans "Dimensions" %}</dt>
+ <dd>{{ shipment.length }} x {{ shipment.width }} x {{ shipment.height }}</dd>
+ <dt>{% trans "Weight" %}</dt>
+ <dd>{{ shipment.weight }} kg</dd>
+</dl>
+<a class="btn window" href="{{ shipment.packing_list.url }}"><i class="icon-file"></i> {% trans "Open Packing List" %}</a>
+{% endblock return_info %}
+
+{% block return_parts %}
+{% for p in shipment.servicepart_set.all %}
+<tr>
+ <td><strong>{{ p.part_number }}</strong><br/>{{ p.part_title }}</td>
+ <td><a href="{% url 'orders-edit' p.order_item.order.pk %}">{{ p.service_order }}</a></td>
+ <td><a href="{% url 'parts-return_label' p.repair_id p.pk %}">{{ p.return_order }}</a></td>
+ <td>{{ p.box_number|default:"Individual" }}</td>
+</tr>
+{% empty %}
+<tr>
+ <td colspan="6" class="empty muted">{% trans "No parts registered for this shipment" %}</td>
+</tr>
+{% endfor %}
+{% endblock return_parts %}
+
+{% block form_controls %}
+
+{% endblock form_controls %}
diff --git a/servo/templates/snippets/alert.html b/servo/templates/snippets/alert.html
new file mode 100644
index 0000000..9cc4f50
--- /dev/null
+++ b/servo/templates/snippets/alert.html
@@ -0,0 +1 @@
+<div class="alert alert-{{ kind }}" role="alert">{{ message }}</div>
diff --git a/servo/templates/snippets/control_group.html b/servo/templates/snippets/control_group.html
new file mode 100755
index 0000000..7e61d6a
--- /dev/null
+++ b/servo/templates/snippets/control_group.html
@@ -0,0 +1,3 @@
+<div class="control-group{% for e in field.errors %} error{% endfor %}">
+ {{ field }}
+</div>
diff --git a/servo/templates/snippets/dropdown.html b/servo/templates/snippets/dropdown.html
new file mode 100755
index 0000000..70ee226
--- /dev/null
+++ b/servo/templates/snippets/dropdown.html
@@ -0,0 +1,11 @@
+<div class="btn-group">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <span class="caret"></span>
+ {{ menu.title }}
+ </a>
+ <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
+ {% for i in menu.items %}
+ <li><a tabindex="-1" href="{{ i.href }}">{{ i.title }}</a></li>
+ {% endfor %}
+ </ul>
+</div>
diff --git a/servo/templates/snippets/dropdown_menu.html b/servo/templates/snippets/dropdown_menu.html
new file mode 100755
index 0000000..c57b563
--- /dev/null
+++ b/servo/templates/snippets/dropdown_menu.html
@@ -0,0 +1,5 @@
+<ul class="dropdown-menu">
+{% for i in items %}
+ <li><a href="{{ i.url }}">{{ i.title }}</a></li>
+{% endfor %}
+</ul>
diff --git a/servo/templates/snippets/error_modal.html b/servo/templates/snippets/error_modal.html
new file mode 100755
index 0000000..c63010a
--- /dev/null
+++ b/servo/templates/snippets/error_modal.html
@@ -0,0 +1,10 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "An error occured..." %}
+{% endblock header %}
+
+{% block body %}
+ {{ error }}
+{% endblock body %}
diff --git a/servo/templates/snippets/filtering_form.html b/servo/templates/snippets/filtering_form.html
new file mode 100755
index 0000000..b2ce391
--- /dev/null
+++ b/servo/templates/snippets/filtering_form.html
@@ -0,0 +1,15 @@
+{% load i18n %}
+<div id="collapsable" class="collapse out">
+ <form method="post" action="" class="form-inline">{% csrf_token %}
+ {% for field in form %}
+ <div class="control-group pull-left">
+ <label class="control-label">{{ field.label|default:"&nbsp;" }}</label>
+ <div class="controls">{{ field }}</div>
+ </div>
+ {% endfor %}
+ <p class="clearfix"><hr/></p>
+ <div class="pull-right">
+ <button type="submit" class="btn btn-primary"><i class="icon-search icon-white"></i> {% trans "Search" %}</button>
+ </div>
+ </form>
+</div>
diff --git a/servo/templates/snippets/form_field.html b/servo/templates/snippets/form_field.html
new file mode 100755
index 0000000..59578f4
--- /dev/null
+++ b/servo/templates/snippets/form_field.html
@@ -0,0 +1,12 @@
+<div class="control-group{% for e in field.errors %} error{% endfor %}">
+ <label class="control-label">{{ field.label }}</label>
+ <div class="controls">
+ {{ field }}
+ {% if field.help_text %}
+ <span class="help-block">{{ field.help_text }}</span>
+ {% endif %}
+ {% for e in field.errors %}
+ <span class="help-inline">{{ e }}</span>
+ {% endfor %}
+ </div>
+</div>
diff --git a/servo/templates/snippets/form_field_label.html b/servo/templates/snippets/form_field_label.html
new file mode 100755
index 0000000..0a8d4b1
--- /dev/null
+++ b/servo/templates/snippets/form_field_label.html
@@ -0,0 +1 @@
+<label class="control-label {{ field.css_classes }}">{% trans field.label %}</label>
diff --git a/servo/templates/snippets/form_input.html b/servo/templates/snippets/form_input.html
new file mode 100755
index 0000000..1d686d0
--- /dev/null
+++ b/servo/templates/snippets/form_input.html
@@ -0,0 +1,22 @@
+{% load i18n %}
+{% load servo_tags %}
+
+<div class="control-group{% for e in field.errors %} error{% endfor %}">
+ {% if field|widget_is:"CheckboxInput" %}
+ <div class="controls">
+ <label class="checkbox">
+ {{ field }} {% trans field.label %}
+ </label>
+ </div>
+ {% else %}
+ <div class="controls">
+ {{ field }}
+ {% if field.help_text %}
+ <span class="help-block">{% trans field.help_text %}</span>
+ {% endif %}
+ {% for e in field.errors %}
+ <span class="help-inline">{{ e }}</span>
+ {% endfor %}
+ </div>
+ {% endif %}
+</div>
diff --git a/servo/templates/snippets/modal.html b/servo/templates/snippets/modal.html
new file mode 100755
index 0000000..dfa552a
--- /dev/null
+++ b/servo/templates/snippets/modal.html
@@ -0,0 +1,14 @@
+{% load i18n %}
+<div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal">×</button>
+ <h3>{% block header %}{% endblock header %}</h3>
+</div>
+<div class="modal-body">
+ {% block body %}{% endblock body %}
+</div>
+<div class="modal-footer">
+{% block footer %}
+ <button class="btn" data-dismiss="modal">{% trans "Close" %}</button>
+ <button type="submit" class="btn btn-primary submit">{% trans "Done" %}</button>
+{% endblock footer %}
+</div>
diff --git a/servo/templates/stats/index.html b/servo/templates/stats/index.html
new file mode 100755
index 0000000..2edc57d
--- /dev/null
+++ b/servo/templates/stats/index.html
@@ -0,0 +1,68 @@
+{% extends "default.html" %}
+{% load i18n %}
+
+{% block content %}
+
+<ul class="nav nav-tabs" style="margin-top:30px">
+{% block tabs %}
+ <li class="active"><a href="{% url 'stats-index' %}">{% trans "Technicians" %}</a></li>
+ <li><a href="{% url 'stats-locations' %}">{% trans "Locations" %}</a></li>
+ <li><a href="{% url 'stats-queues' %}">{% trans "Queues" %}</a></li>
+ <li><a href="{% url 'stats-repairs' %}">{% trans "Repairs" %}</a></li>
+ <li><a href="{% url 'stats-statuses' %}">{% trans "Statuses" %}</a></li>
+ <li><a href="{% url 'stats-sales' %}">{% trans "Sales" %}</a></li>
+{% endblock tabs %}
+</ul>
+
+<div class="row-fluid">
+ <div class="span12 well">
+ {% block filter_block %}
+ <form action="#" method="post" class="form-inline" id="stats-form">
+ {% csrf_token %}
+ {% for field in form %}
+ <div class="control-group pull-left">
+ <label class="control-label">{{ field.label }}</label>
+ <div class="controls">{{ field }}</div>
+ </div>
+ {% endfor %}
+ <div class="control-group">
+ <label class="control-label">&nbsp;</label>
+ <div class="controls">
+ <button class="btn btn-primary pull-right" type="submit"><i class="icon-search icon-white"></i> {% trans "Search" %}</button>
+ </div>
+ </div>
+ </form>
+ {% endblock filter_block %}
+ </div>
+</div>
+<div class="row-fluid">
+ <div class="span12">
+ {% block stats %}
+ <h2>{% trans "Orders Assigned" %}</h2>
+ <p>{% trans "Shows how many new orders have been assigned to each technician over the given time period." %}</p>
+ {% include "stats/plot_snippet.html" with url="/stats/data/orders/runrate/" %}
+ <hr/>
+ <h2>{% trans "Orders Created" %}</h2>
+ <p>{% trans "This graph shows how many orders are checked in by each user." %}</p>
+ {% include "stats/plot_snippet.html" with url="/stats/data/created/user/" %}
+ <hr/>
+ <h2>{% trans "Work Distribution" %}</h2>
+ <p>{% trans "Shows you how the total number of service orders is distributed across the technicians at this location." %}</p>
+ <div class="plot plot-pie pull-left" data-source="/stats/data/orders/techs/"></div>
+ {% endblock stats %}
+ </div>
+</div>
+
+{% endblock content %}
+
+{% block crumbs %}
+<li class="active">{% trans "Statistics" %}</li>
+{% endblock crumbs %}
+
+{% block media %}
+<script src="{{ STATIC_URL }}js/flot/jquery.flot.min.js"></script>
+<script src="{{ STATIC_URL }}js/flot/jquery.flot.time.min.js"></script>
+<script src="{{ STATIC_URL }}js/flot/jquery.flot.pie.min.js"></script>
+<script src="{{ STATIC_URL }}js/flot/jquery.flot.resize.min.js"></script>
+<script src="{{ STATIC_URL }}js/stats.js" type="text/javascript"></script>
+{% endblock media %}
diff --git a/servo/templates/stats/locations.html b/servo/templates/stats/locations.html
new file mode 100755
index 0000000..576da8b
--- /dev/null
+++ b/servo/templates/stats/locations.html
@@ -0,0 +1,33 @@
+{% extends "stats/index.html" %}
+{% load i18n %}
+
+{% block tabs %}
+ <li><a href="{% url 'stats-index' %}">{% trans "Technicians" %}</a></li>
+ <li class="active"><a href="{% url 'stats-index' %}">{% trans "Locations" %}</a></li>
+ <li><a href="{% url 'stats-queues' %}">{% trans "Queues" %}</a></li>
+ <li><a href="{% url 'stats-repairs' %}">{% trans "Repairs" %}</a></li>
+ <li><a href="{% url 'stats-statuses' %}">{% trans "Statuses" %}</a></li>
+ <li><a href="{% url 'stats-sales' %}">{% trans "Sales" %}</a></li>
+{% endblock tabs %}
+
+{% block stats %}
+ <h2>{% trans "Orders Created" %}</h2>
+ <p>{% trans "Shows you how many orders are created at each location." %}</p>
+ {% include "stats/plot_snippet.html" with url="/stats/data/created/location/" %}
+ <hr/>
+ <h2>{% trans "Orders Closed" %}</h2>
+ <p>{% trans "Shows you how many orders have been closed at each location." %}</p>
+ {% include "stats/plot_snippet.html" with url="/stats/data/closed/location/" %}
+ <hr/>
+ <h2>{% trans "Average Turnaround" %}</h2>
+ <p>{% trans "Shows how many hours it takes to complete an order at each location." %}</p>
+ {% include "stats/plot_snippet.html" with url="/stats/data/turnaround/location/" %}
+ <hr/>
+ <h2>{% trans "Average Runrate" %}</h2>
+ <p>{% trans "Shows you how many orders people are working on at each location." %}</p>
+ {% include "stats/plot_snippet.html" with url="/stats/data/runrate/location/" %}
+ <hr/>
+ <h2>{% trans "Work Distribution" %}</h2>
+ <p>{% trans "This shows you how your overall work load is distributed across your service locations." %}</p>
+ <div class="plot plot-pie pull-left" data-source="/stats/data/distribution/location/"></div>
+{% endblock stats %}
diff --git a/servo/templates/stats/newstats.html b/servo/templates/stats/newstats.html
new file mode 100644
index 0000000..1900efc
--- /dev/null
+++ b/servo/templates/stats/newstats.html
@@ -0,0 +1,87 @@
+{% extends "default.html" %}
+{% load i18n %}
+
+{% block content %}
+
+<ul class="nav nav-tabs" style="margin-top:30px">
+{% block tabs %}
+ <li><a href="{% url 'stats-index' %}">{% trans "Technicians" %}</a></li>
+ <li><a href="{% url 'stats-locations' %}">{% trans "Locations" %}</a></li>
+ <li><a href="{% url 'stats-queues' %}">{% trans "Queues" %}</a></li>
+ <li class="active"><a href="{% url 'stats-repairs' %}">{% trans "Repairs" %}</a></li>
+ <li><a href="{% url 'stats-statuses' %}">{% trans "Statuses" %}</a></li>
+ <li><a href="{% url 'stats-sales' %}">{% trans "Sales" %}</a></li>
+{% endblock tabs %}
+</ul>
+
+<div class="row-fluid">
+ <div class="span12 well">
+ {% block filter_block %}
+ <form action="#" method="get" class="form-inline" id="stats-form">
+ {% for field in form %}
+ <div class="control-group pull-left">
+ <label class="control-label">{{ field.label }}</label>
+ <div class="controls">{{ field }}</div>
+ </div>
+ {% endfor %}
+ <div class="control-group">
+ <label class="control-label">&nbsp;</label>
+ <div class="controls">
+ <button class="btn btn-primary pull-right" type="submit"><i class="icon-search icon-white"></i> {% trans "Search" %}</button>
+ </div>
+ </div>
+ </form>
+ {% endblock filter_block %}
+ </div>
+</div>
+<div class="row-fluid">
+ <div class="span12">
+ {% block stats %}
+ <table class="table table-hover sortable">
+ <thead>
+ <tr>
+ <th>{% trans "Technician" %}</th>
+ <th>{% trans "Cases Created" %}</th>
+ <th>{% trans "Cases Assigned" %}</th>
+ <th>{% trans "Repairs Created" %}</th>
+ <th>{% trans "Cases Dispatched" %}</th>
+ <td></td>
+ </tr>
+ </thead>
+ <tbody>
+ {% for r in results %}
+ <tr>
+ <td>{{ r.name }}</td>
+ <td>{{ r.created }}</td>
+ <td>{{ r.assigned }}</td>
+ <td>{{ r.repairs }}</td>
+ <td>{{ r.dispatched }}</td>
+ <td></td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ <tfoot style="font-weight:bold">
+ <tr>
+ <td>{% trans "Total" %}</td>
+ <td>{{ totals.created }}</td>
+ <td>{{ totals.assigned }}</td>
+ <td>{{ totals.repairs }}</td>
+ <td>{{ totals.dispatched }}</td>
+ <td>{{ totals.diff }}</td>
+ </tr>
+ {% if totals.turnaround.nonzero %}
+ <tr>
+ <td>{% trans "Average turnaround time" %}</td>
+ <td colspan="5">{{ totals.turnaround.days }} {% trans "days" %}, {{ totals.turnaround.hours }} {% trans "hours" %}</td>
+ </tr>
+ {% endif %}
+ </tfoot>
+ </table>
+ {% endblock stats %}
+ </div>
+</div>
+{% endblock content %}
+
+{% block crumbs %}
+ <li class="active">{% trans "Statistics" %}</li>
+{% endblock crumbs %}
diff --git a/servo/templates/stats/plot_snippet.html b/servo/templates/stats/plot_snippet.html
new file mode 100755
index 0000000..c93a41e
--- /dev/null
+++ b/servo/templates/stats/plot_snippet.html
@@ -0,0 +1,9 @@
+<div class="row-fluid">
+ <div class="span12">
+ <div class="span10">
+ <div class="plot" data-source="{{ url }}"></div>
+ <div class="legend-container"></div>
+ </div>
+ <div class="span2"></div>
+ </div>
+</div>
diff --git a/servo/templates/stats/queues.html b/servo/templates/stats/queues.html
new file mode 100755
index 0000000..eefec46
--- /dev/null
+++ b/servo/templates/stats/queues.html
@@ -0,0 +1,29 @@
+{% extends "stats/index.html" %}
+{% load i18n %}
+
+{% block tabs %}
+ <li><a href="{% url 'stats-index' %}">{% trans "Technicians" %}</a></li>
+ <li><a href="{% url 'stats-locations' %}">{% trans "Locations" %}</a></li>
+ <li class="active"><a href="{% url 'stats-queues' %}">{% trans "Queues" %}</a></li>
+ <li><a href="{% url 'stats-repairs' %}">{% trans "Repairs" %}</a></li>
+ <li><a href="{% url 'stats-statuses' %}">{% trans "Statuses" %}</a></li>
+ <li><a href="{% url 'stats-sales' %}">{% trans "Sales" %}</a></li>
+{% endblock tabs %}
+
+{% block stats %}
+ <h2>{% trans "Orders Created" %}</h2>
+ <p>{% trans "This is your total number of orders per queue in the specified time period" %}</p>
+ {% include "stats/plot_snippet.html" with url="/stats/data/orders/count/" %}
+ <hr/>
+ <h2>{% trans "Orders Closed" %}</h2>
+ <p>{% trans "Shows you how many orders have been closed in each queue." %}</p>
+ {% include "stats/plot_snippet.html" with url="/stats/data/closed/queue/" %}
+ <hr/>
+ <h2>{% trans "Average Turnaround" %}</h2>
+ <p>{% trans "Shows how many hours it takes to complete an order in each queue." %}</p>
+ {% include "stats/plot_snippet.html" with url="/stats/data/orders/turnaround/" %}
+ <hr/>
+ <h2>{% trans "Work Distribution" %}</h2>
+ <p>{% trans "This shows your total ratio of orders over the time period distributed over each queue." %}</p>
+ <div class="plot plot-pie pull-left" data-source="/stats/data/orders/queues/"></div>
+{% endblock stats %}
diff --git a/servo/templates/stats/sales.html b/servo/templates/stats/sales.html
new file mode 100755
index 0000000..186e897
--- /dev/null
+++ b/servo/templates/stats/sales.html
@@ -0,0 +1,33 @@
+{% extends "stats/index.html" %}
+{% load i18n %}
+
+{% block tabs %}
+<li><a href="{% url 'stats-index' %}">{% trans "Technicians" %}</a></li>
+<li><a href="{% url 'stats-locations' %}">{% trans "Locations" %}</a></li>
+<li><a href="{% url 'stats-queues' %}">{% trans "Queues" %}</a></li>
+<li><a href="{% url 'stats-repairs' %}">{% trans "Repairs" %}</a></li>
+<li><a href="{% url 'stats-statuses' %}">{% trans "Statuses" %}</a></li>
+<li class="active"><a href="{% url 'stats-sales' %}">{% trans "Sales" %}</a></li>
+{% endblock tabs %}
+
+{% block stats %}
+<h2>{% trans "Sales" %}</h2>
+<p>{% trans "Shows you invoice totals per queue within the selected time period." %}</p>
+{% include "stats/plot_snippet.html" with url="/stats/data/sales/invoices/" %}
+<hr/>
+<h2>{% trans "Purchases" %}</h2>
+<p>{% trans "Shows you Purchase Order totals per queue within the selected time period." %}</p>
+{% include "stats/plot_snippet.html" with url="/stats/data/sales/purchases/" %}
+<hr/>
+<h2>{% trans "Service Parts" %}</h2>
+<p>{% trans "Shows you how many parts have been ordered for each labour tier." %}</p>
+<div class="row-fluid">
+ <div class="span12">
+ <div class="span10">
+ <div class="plot plot-bar" data-source="/stats/data/sales/parts/"></div>
+ <div class="legend-container"></div>
+ </div>
+ <div class="span2"></div>
+ </div>
+</div>
+{% endblock stats %}
diff --git a/servo/templates/stats/statuses.html b/servo/templates/stats/statuses.html
new file mode 100755
index 0000000..f4fb427
--- /dev/null
+++ b/servo/templates/stats/statuses.html
@@ -0,0 +1,21 @@
+{% extends "stats/index.html" %}
+{% load i18n %}
+
+{% block tabs %}
+ <li><a href="{% url 'stats-index' %}">{% trans "Technicians" %}</a></li>
+ <li><a href="{% url 'stats-locations' %}">{% trans "Locations" %}</a></li>
+ <li><a href="{% url 'stats-queues' %}">{% trans "Queues" %}</a></li>
+ <li><a href="{% url 'stats-repairs' %}">{% trans "Repairs" %}</a></li>
+ <li class="active"><a href="{% url 'stats-statuses' %}">{% trans "Statuses" %}</a></li>
+ <li><a href="{% url 'stats-sales' %}">{% trans "Sales" %}</a></li>
+{% endblock tabs %}
+
+{% block stats %}
+ <h2>{% trans "Orders per location" %}</h2>
+ <p>{% trans "Shows the number of orders with a particular status at the selected location that have been assigned to a technician over the specified time period." %}</p>
+ {% include "stats/plot_snippet.html" with url="/stats/data/status/location/" %}
+ <hr/>
+ <h2>{% trans "Orders per user" %}</h2>
+ <p>{% trans "Shows the number of orders with a particular status per each user at the given location that have been assigned to a technician over the specified time period." %}</p>
+ {% include "stats/plot_snippet.html" with url="/stats/data/status/tech/" %}
+{% endblock stats %}
diff --git a/servo/templates/tabbed_form.html b/servo/templates/tabbed_form.html
new file mode 100755
index 0000000..03dae90
--- /dev/null
+++ b/servo/templates/tabbed_form.html
@@ -0,0 +1,14 @@
+<ul class="nav nav-tabs">
+{% for k, v in form.tabs %}
+ <li><a href="#tab{{ forloop.counter }}" data-toggle="tab">{{ k }}</a></li>
+{% endfor %}
+</ul>
+<div class="tab-content">
+{% for k, v in form.tabs %}
+ <div class="tab-pane" id="tab{{ forloop.counter }}">
+ <fieldset>
+ {% include "form_snippet.html" with form=v %}
+ </fieldset>
+ </div>
+{% endfor %}
+</div>
diff --git a/servo/templates/three_column_layout.html b/servo/templates/three_column_layout.html
new file mode 100755
index 0000000..e529e54
--- /dev/null
+++ b/servo/templates/three_column_layout.html
@@ -0,0 +1,27 @@
+{% extends "default.html" %}
+{% block content %}
+<div class="row-fluid">
+ <div class="span12">
+ <ul class="breadcrumb">
+ {% block breadcrumb %}{% endblock breadcrumb %}
+ </ul>
+ </div>
+</div>
+<div class="row-fluid">
+ <div class="span3">
+ {% block left_column %}
+
+ {% endblock left_column %}
+ </div>
+ <div class="span7">
+ {% block middle_column %}
+
+ {% endblock middle_column %}
+ </div>
+ <div class="span2">
+ {% block right_column %}
+
+ {% endblock right_column %}
+ </div>
+</div>
+{% endblock content %}
diff --git a/servo/templates/two_column_layout.html b/servo/templates/two_column_layout.html
new file mode 100755
index 0000000..6747eda
--- /dev/null
+++ b/servo/templates/two_column_layout.html
@@ -0,0 +1,18 @@
+{% extends "default.html" %}
+{% load i18n %}
+
+{% block content %}
+<div class="row-fluid">
+ <div class="span12">{% block header_row %}{% endblock header_row %}</div>
+</div>
+<div class="row-fluid">
+ <div class="span3">
+ {% block first_column %}
+ {% endblock first_column %}
+ </div>
+ <div class="span9">
+ {% block second_column %}
+ {% endblock second_column %}
+ </div>
+</div>
+{% endblock content %}