aboutsummaryrefslogtreecommitdiffstats
path: root/servo/templates/devices
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/devices
downloadServo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.tar.gz
Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.tar.bz2
Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.zip
Initial commit
First public commit
Diffstat (limited to 'servo/templates/devices')
-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
27 files changed, 879 insertions, 0 deletions
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 %}