Adds order log (no delete yet) and more.

This commit is contained in:
nikolark committed 2012-03-19 20:40:31 +01:00
1 parent 99a8a3aeb4
commit b9db82e31f
9 files changed
+357 -3

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
{% extends "base.html" %}
{% load gravatar %}
{% block header %}
{% include "nav.html" with active="log" %}
{% endblock %}
{% block content %}
<section id="log" class="row-fluid">
{% if messages %}
<section class="row-fluid">
<div class="span4">
{% for message in messages %}
<div {% if message.tags %}class="alert alert-{{ message.tags }}"{% endif %}>{{ message }}<a class="close" data-dismiss="alert">×</a></div>
{% endfor %}
</div>
</section>
{% endif %}
<section id="orders" class="row-fluid">
<div class="span12">
<h2>Siste ordre</h2>
<table class="table table-striped">
<thead>
<tr>
<th>Når</th>
<th>Hvem</th>
<th>Hva</th>
<th>Sum</th>
<th>Handling</th>
</tr>
</thead>
<tbody>
{% for order in orders %}
<tr>
<td>{{ order.created }}</td>
<td>{% if order.customer.get_profile.image %}<img src="{{ order.customer.get_profile.image }}" class="customer" title="{{ order.customer.first_name }} {{ order.customer.last_name|slice:":1"}}" />{% else %}{{ order.customer.first_name }} {{ order.customer.last_name|slice:":1"}}{% endif %}</td>
<td>{% for line in order.orderline_set.all %}
<span class="bold">{{ line.amount}}</span>
<a href="#" class="product" title="{{ line.unit_price}} per">{{ line.product }}</a>{% if not forloop.last %},{% endif %}
{% endfor %}</td>
<td>{{ order.order_sum }}</td>
<td>{% include "modal-confirm-delete.html" with order=order %}<a class="btn btn-danger" data-toggle="modal" href="#modal-{{order.id}}"><i class="icon-trash icon-white"></i> Slett</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</section>
</section>
{% endblock %}
{% block tailinc %}
<script src="{{ STATIC_URL }}js/bootstrap-tooltip.js"></script>
<script src="{{ STATIC_URL }}js/bootstrap-modal.js"></script>
<script src="{{ STATIC_URL }}js/bootstrap-transition.js"></script>
<script src="{{ STATIC_URL }}js/log.js"></script>
{% endblock %}
+29
View File
@@ -0,0 +1,29 @@
<div id="modal-{{order.id}}" class="modal" style="display: none;">
<div class="modal-header">
<a href="#" class="close" data-dismiss="modal">×</a>
<h3>Er du sikker?</h3>
</div>
<div class="modal-body">
<p>
Orderen til {% if order.customer.get_profile.image %}<img src="{{ order.customer.get_profile.image }}" class="customer" title="{{ order.customer.first_name }} {{ order.customer.last_name|slice:":1"}}" />{% else %}<strong>{{ order.customer.first_name }} {{ order.customer.last_name|slice:":1"}}</strong>{% endif %} fra {{ order.created }} vil bli <em>slettet</em>.</p>
<p>
Orderen inneholdt:
<ul>
{% for line in order.orderline_set.all %}
<li><span class="bold">{{ line.amount}}</span>
<a href="#" class="product" title="{{ line.unit_price}} per">{{ line.product }}</a>
{% if not forloop.last %},{% endif %}</li>
{% endfor %}
</ul>
Totalt: {{ order.order_sum }},-
</p>
<p>
<strong>{{ order.customer.first_name }} {{ order.customer.last_name|slice:":1"}}</strong> sin saldo vil bli kreditert {{ order.order_sum }} kr.
</p>
<p>Vil du fortsette?</p>
</div>
<div class="modal-footer">
<a href="#" class="btn">Nei</a>
<a href="#" class="btn btn-danger"><i class="icon-trash icon-white"></i> Ja</a>
</div>
</div>
+1 -1
View File
@@ -13,7 +13,7 @@
{% if active %}
<li class="{% if active = "register" %}active{% endif %}"><a href="/register"><i class="icon-home icon-white"></i> Kjøp drikke</a></li>
<li class="{% if active = "deposit" %}active{% endif %}"><a href="/deposit">Sett inn penger</a></li>
<li class="{% if active = "remove_purchase" %}active{% endif %}"><a href="#"> Fjern kjøp</a></li>
<li class="{% if active = "log" %}active{% endif %}"><a href="/log"> Logg</a></li>
{% if request.user.is_superuser %}
<li><a href="/admin">Administrasjon</a></li>
{% endif %}