diff --git a/core/templates/core/user_account.jinja b/core/templates/core/user_account.jinja
index 3b459fc1..1ecaa8d9 100644
--- a/core/templates/core/user_account.jinja
+++ b/core/templates/core/user_account.jinja
@@ -1,29 +1,31 @@
{% extends "core/base.jinja" %}
{% macro monthly(obj) %}
-
-
-
- {% trans %}Year{% endtrans %} |
- {% trans %}Month{% endtrans %} |
- {% trans %}Total{% endtrans %} |
-
-
-
- {% for array in obj %}
- {% for tuple in array %}
- {% if tuple[0] != 0 %}
- {% set link=url('core:user_account_detail', user_id=profile.id, year=tuple[1].year, month=tuple[1].month) %}
+
+
+
{% endmacro %}
{% block title %}
@@ -34,30 +36,42 @@
{% if customer %}
{% trans %}User account{% endtrans %}
{% trans %}Amount: {% endtrans %}{{ customer.amount }} €
+
{% if customer.refillings.exists() %}
-
{% trans %}Refillings{% endtrans %}
- {{ monthly(refilling_month) }}
-{% endif %}
-{% if customer.buyings.exists() %}
-
{% trans %}Account buyings{% endtrans %}
- {{ monthly(buyings_month) }}
-{% endif %}
-{% if customer.user.invoices.exists() %}
-
{% trans %}Eboutic invoices{% endtrans %}
- {{ monthly(invoices_month) }}
-{% endif %}
-{% if etickets %}
-
{% trans %}Etickets{% endtrans %}
-
-{% endif %}
+ {% if customer.buyings.exists() %}
+
{% trans %}Account buyings{% endtrans %}
+ {{ monthly(buyings_month) }}
+ {% endif %}
+
{% trans %}Refillings{% endtrans %}
+ {{ monthly(refilling_month) }}
+ {% endif %}
+ {% if customer.user.invoices.exists() %}
+
{% trans %}Eboutic invoices{% endtrans %}
+ {{ monthly(invoices_month) }}
+ {% endif %}
+ {% if etickets %}
+
{% trans %}Etickets{% endtrans %}
+
+ {% endif %}
+
{% else %}
{% trans %}User has no account{% endtrans %}
{% endif %}
{% endblock %}
+{% block script %}
+{{ super() }}
+
+{% endblock %}
diff --git a/core/templates/core/user_account_detail.jinja b/core/templates/core/user_account_detail.jinja
index 5c74579d..e73c346f 100644
--- a/core/templates/core/user_account_detail.jinja
+++ b/core/templates/core/user_account_detail.jinja
@@ -9,35 +9,6 @@
{% trans %}User account{% endtrans %}
{% trans %}Amount: {% endtrans %}{{ customer.amount }} €
{% trans %}Back{% endtrans %}
-{% if customer.refillings.exists() %}
-{% trans %}Refillings{% endtrans %}
-
-
-
- {% trans %}Date{% endtrans %} |
- {% trans %}Counter{% endtrans %} |
- {% trans %}Barman{% endtrans %} |
- {% trans %}Amount{% endtrans %} |
- {% trans %}Payment method{% endtrans %} |
-
-
-
- {% for i in customer.refillings.order_by('-date').filter(
- date__year=year, date__month=month) %}
-
- {{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }} |
- {{ i.counter }} |
- {{ i.operator.get_display_name() }} |
- {{ i.amount }} € |
- {{ i.get_payment_method_display() }} |
- {% if i.is_owned_by(user) %}
- Delete |
- {% endif %}
-
-{% endfor %}
-
-
-{% endif %}
{% if customer.buyings.exists() %}
{% trans %}Account buyings{% endtrans %}
{% endif %}
+{% if customer.refillings.exists() %}
+{% trans %}Refillings{% endtrans %}
+
+
+
+ {% trans %}Date{% endtrans %} |
+ {% trans %}Counter{% endtrans %} |
+ {% trans %}Barman{% endtrans %} |
+ {% trans %}Amount{% endtrans %} |
+ {% trans %}Payment method{% endtrans %} |
+
+
+
+ {% for i in customer.refillings.order_by('-date').filter(
+ date__year=year, date__month=month) %}
+
+ {{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }} |
+ {{ i.counter }} |
+ {{ i.operator.get_display_name() }} |
+ {{ i.amount }} € |
+ {{ i.get_payment_method_display() }} |
+ {% if i.is_owned_by(user) %}
+ Delete |
+ {% endif %}
+
+{% endfor %}
+
+
+{% endif %}
{% if customer.user.invoices.exists() %}
{% trans %}Eboutic invoices{% endtrans %}
diff --git a/counter/templates/counter/counter_click.jinja b/counter/templates/counter/counter_click.jinja
index a086aa6a..0026bf1c 100644
--- a/counter/templates/counter/counter_click.jinja
+++ b/counter/templates/counter/counter_click.jinja
@@ -51,7 +51,7 @@
{% trans %}Basket: {% endtrans %}
@@ -174,6 +174,9 @@ $( function() {
$( function() {
$("#bar_ui").accordion({
heightStyle: "content",
+ activate: function(event, ui){
+ $(".focus").focus();
+ }
});
$("#products").tabs();
});
diff --git a/counter/views.py b/counter/views.py
index d2d8bbfe..303c47ff 100644
--- a/counter/views.py
+++ b/counter/views.py
@@ -63,6 +63,9 @@ class RefillForm(forms.ModelForm):
class Meta:
model = Refilling
fields = ['amount', 'payment_method', 'bank']
+ widgets = {
+ 'amount': forms.NumberInput(attrs={'class':'focus'},)
+ }
class CounterTabsMixin(TabedViewMixin):
def get_tabs_title(self):