Files
bbs/templates/register.html
T
2012-02-22 21:48:25 +01:00

87 lines
4.4 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block header %}
{% include "nav.html" with active="register" %}
{% endblock %}
{% block content %}
<section id="register" class="row-fluid">
<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>
<form id="order" method="post" autocomplete="off">
<fieldset>
{% csrf_token %}
<!-- Formset validation fields -->
<input type="hidden" name="form-TOTAL_FORMS" value="{{ products|length }}" id="id_form-TOTAL_FORMS" />
<input type="hidden" name="form-INITIAL_FORMS" value="{{ products|length }}" id="id_form-INITIAL_FORMS" />
<input type="hidden" name="form-MAX_NUM_FORMS" id="id_form-MAX_NUM_FORMS" />
<section id="customer" class="row-fluid">
<div class="span12">
<h2>Hvem kjøper?</h2>
<!-- Typeahead customer field -->
<input name="customer_name" id="id_customer_typeahead" value="" data-provide="typeahead" data-source="{{users_js}}" />
<!-- Actual customer select field (hidden) -->
<div style="display:none;">{{orderform.customer }}</div>
{% if users %}
<ul class="well">
{% for user in users %}
<li class="customer">
{% if user.get_profile.image %}
  <img class="profile" src="{{ user.get_profile.image.url }}" /><br />
{% else %}
  <img class="profile" src="{{ STATIC_URL }}gaute/img/unknown.png" /><br />
{% endif %}
<span class="name">{{ user }}</span> ({{ user.get_profile.balance }})
<span class="id" style="display:none;">{{ user.id }}</span>
</li>
</li>
{% endfor %}
</ul>
{%else%}
<div class="alert alert-error">Ingen har positiv saldo i BBS.</div>
{%endif%}
</div>
</section>
<section id="products" class="row-fluid">
<div class="span12">
<h2>Kjøper hva?</h2>
<ul class="well">
{% for product in products %}
<li id="form-{{forloop.counter0}}" class="product"><input type="hidden" name="form-{{ forloop.counter0 }}-product" value="{{product.id }}" />
<input type="text" id="form-{{ forloop.counter0 }}-amount" name="form-{{ forloop.counter0 }}-amount" value="0" class="span2" size="2" />
<input type="hidden" name="form-{{ forloop.counter0 }}-unit_price" value="{{product.sale_price_int }}" />
{% if product.image %}
<img class="product" src="{{ product.image.url }}" /><br />
{% else %}
<img class="product" src="{{ STATIC_URL }}gaute/img/product.png" /><br />
{% endif %}
<span class="name">{{ product.name }}</span> - <span class="sale_price_int">{{product.sale_price_int|floatformat:0}}</span>
</li>
{% endfor %}
</ul>
</div>
</section>
<section id="total" class="row-fluid">
<div class="span2">
<h2>Totalt: <span class="total_text"></span></h2>
</div>
</section>
</fieldset>
<div class="form-actions">
  <button type="submit" class="btn btn-large btn-primary" name="submit_order">Kjøp</button>
  <button type="reset" class="btn">Start på nytt</button>
</div>
</form>
</section>
{% endblock %}
{% block tailinc %}
<script src="{{ STATIC_URL }}js/bootstrap-typeahead.js"></script>
<script src="{{ STATIC_URL }}js/register.js"></script>
{% endblock %}