mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 06:03:20 +00:00
MAJ translations ; stock acces addition in user tool
This commit is contained in:
parent
21c05cc779
commit
0660ea5e64
@ -34,9 +34,18 @@
|
||||
{% endif %}
|
||||
{% for b in settings.SITH_COUNTER_BARS %}
|
||||
{% if user.is_in_group(b[1]+" admin") %}
|
||||
<li><a href="{{ url('counter:details', counter_id=b[0]) }}">{{ b[1] }}</a> -
|
||||
<li>
|
||||
<a href="{{ url('counter:details', counter_id=b[0]) }}">{{ b[1] }}</a> -
|
||||
<a href="{{ url('counter:admin', counter_id=b[0]) }}">{% trans %}Edit{% endtrans %}</a> -
|
||||
<a href="{{ url('counter:stats', counter_id=b[0]) }}">{% trans %}Stats{% endtrans %}</a></li>
|
||||
<a href="{{ url('counter:stats', counter_id=b[0]) }}">{% trans %}Stats{% endtrans %}</a> -
|
||||
{% set c = Counter.objects.filter(id=b[0]).first() %}
|
||||
{% if c.stock %}
|
||||
<a href="{{ url('stock:items_list', stock_id=c.stock.id)}}">Stock</a> -
|
||||
<a href="{{ url('stock:shoppinglist_list', stock_id=c.stock.id)}}">{% trans %}Shopping lists{% endtrans %}</a>
|
||||
{% else %}
|
||||
<a href="{{url('stock:new', counter_id=c.id)}}">{% trans %}Create new stock{% endtrans%}</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
File diff suppressed because it is too large
Load Diff
16
stock/templates/stock/shopping_list_quantity.jinja
Normal file
16
stock/templates/stock/shopping_list_quantity.jinja
Normal file
@ -0,0 +1,16 @@
|
||||
{% extends "core/base.jinja" %}
|
||||
|
||||
{% block title %}
|
||||
{% trans s = stock %}{{ s }}'s quantity to buy{% endtrans %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h3>{% trans s = stock %}{{ s }}'s quantity to buy{% endtrans %}</h3>
|
||||
<div>
|
||||
<form method="post" action="" class="inline" style="display:inline">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p() }}
|
||||
<p><input type="submit" value="{% trans %}Create shopping list{% endtrans %}" /></p>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
@ -1,4 +1,5 @@
|
||||
{% extends "core/base.jinja" %}
|
||||
{% from 'core/macros.jinja' import user_profile_link %}
|
||||
|
||||
{% block title %}
|
||||
{{ stock }}
|
||||
@ -7,7 +8,7 @@
|
||||
{% block content %}
|
||||
{% if current_tab == "stocks" %}
|
||||
<p><a href="{{ url('stock:new_item', stock_id=stock.id)}}">{% trans %}New item{% endtrans %}</a></p>
|
||||
<h5><a href="{{ url('stock:shoppinglist_list', stock_id=stock.id)}}">{% trans %}Shopping list{% endtrans %}</a></h5>
|
||||
<h5><a href="{{ url('stock:shoppinglist_list', stock_id=stock.id)}}">{% trans %}Shopping lists{% endtrans %}</a></h5>
|
||||
{% endif %}
|
||||
{% if stock %}
|
||||
<h3>{{ stock }}</h3>
|
||||
|
@ -6,11 +6,11 @@ Shopping list for {{ stock }}
|
||||
|
||||
{% block content %}
|
||||
{% if current_tab == "stocks" %}
|
||||
<a href="{{ url('stock:shoppinglist_create', stock_id=stock.id)}}">{% trans %}Do shopping{% endtrans %}</a>
|
||||
<a href="{{ url('stock:shoppinglist_create', stock_id=stock.id)}}">{% trans %}Create shopping list{% endtrans %}</a>
|
||||
{% endif %}
|
||||
<h3>{% trans s=stock %}Shopping lists history for {{ s }}{% endtrans %}</h3>
|
||||
|
||||
<h4>To do</h4>
|
||||
<h4>{% trans %}To do{% endtrans %}</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
@ -36,7 +36,7 @@ Shopping list for {{ stock }}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h4>Done</h4>
|
||||
<h4>{% trans %}Done{% endtrans %}</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -170,7 +170,7 @@ class StockItemQuantityForm(forms.BaseForm):
|
||||
shopping_list.stock_owner = self.stock
|
||||
shopping_list.save()
|
||||
for k,t in self.cleaned_data.items():
|
||||
if t is not None:
|
||||
if int(t) > 0 :
|
||||
item_id = int(k[5:])
|
||||
item = StockItem.objects.filter(id=item_id).first()
|
||||
item.tobuy_quantity = t
|
||||
|
Loading…
Reference in New Issue
Block a user