diff options
author | Filipp Lepalaan <filipp@mac.com> | 2015-08-04 10:11:24 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2015-08-04 10:11:24 +0300 |
commit | 63b0fc6269b38edf7234b9f151b80d81f614c0a3 (patch) | |
tree | 555de3068f33f8dddb4619349bbea7d9b7c822fd /servo/templates/checkin | |
download | Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.tar.gz Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.tar.bz2 Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.zip |
Initial commit
First public commit
Diffstat (limited to 'servo/templates/checkin')
-rw-r--r-- | servo/templates/checkin/confirmation.html | 13 | ||||
-rw-r--r-- | servo/templates/checkin/customer_form.html | 87 | ||||
-rw-r--r-- | servo/templates/checkin/device_form.html | 62 | ||||
-rw-r--r-- | servo/templates/checkin/error.html | 15 | ||||
-rw-r--r-- | servo/templates/checkin/index.html | 95 | ||||
-rw-r--r-- | servo/templates/checkin/newindex.html | 146 | ||||
-rw-r--r-- | servo/templates/checkin/status-show.html | 35 | ||||
-rw-r--r-- | servo/templates/checkin/status.html | 21 | ||||
-rw-r--r-- | servo/templates/checkin/terms.html | 9 | ||||
-rw-r--r-- | servo/templates/checkin/thanks.html | 26 |
10 files changed, 509 insertions, 0 deletions
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">×</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">×</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">×</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 %} |