aboutsummaryrefslogtreecommitdiffstats
path: root/servo/templates/customers
diff options
context:
space:
mode:
Diffstat (limited to 'servo/templates/customers')
-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
16 files changed, 561 insertions, 0 deletions
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 %}