mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
MAJ translations ; stock acces addition in user tool
This commit is contained in:
parent
21c05cc779
commit
0660ea5e64
@ -34,9 +34,18 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% for b in settings.SITH_COUNTER_BARS %}
|
{% for b in settings.SITH_COUNTER_BARS %}
|
||||||
{% if user.is_in_group(b[1]+" admin") %}
|
{% 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: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 %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</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" %}
|
{% extends "core/base.jinja" %}
|
||||||
|
{% from 'core/macros.jinja' import user_profile_link %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}
|
||||||
{{ stock }}
|
{{ stock }}
|
||||||
@ -7,7 +8,7 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
{% if current_tab == "stocks" %}
|
{% if current_tab == "stocks" %}
|
||||||
<p><a href="{{ url('stock:new_item', stock_id=stock.id)}}">{% trans %}New item{% endtrans %}</a></p>
|
<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 %}
|
{% endif %}
|
||||||
{% if stock %}
|
{% if stock %}
|
||||||
<h3>{{ stock }}</h3>
|
<h3>{{ stock }}</h3>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
{% for s in stock_list.order_by('name') %}
|
{% for s in stock_list.order_by('name') %}
|
||||||
<li>
|
<li>
|
||||||
{% if user.can_edit(s) %}
|
{% if user.can_edit(s) %}
|
||||||
<a href="{{ url('stock:items_list', stock_id=s.id) }}">{{s}}</a>
|
<a href="{{ url('stock:items_list', stock_id=s.id) }}">{{ s }}</a>
|
||||||
- <a href="{{ url('stock:edit', stock_id=s.id) }}">Edit</a>
|
- <a href="{{ url('stock:edit', stock_id=s.id) }}">Edit</a>
|
||||||
- <a href="{{ url('stock:shoppinglist_list', stock_id=s.id)}}">{% trans %}Shopping lists{% endtrans %}</a>
|
- <a href="{{ url('stock:shoppinglist_list', stock_id=s.id)}}">{% trans %}Shopping lists{% endtrans %}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -6,11 +6,11 @@ Shopping list for {{ stock }}
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if current_tab == "stocks" %}
|
{% 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 %}
|
{% endif %}
|
||||||
<h3>{% trans s=stock %}Shopping lists history for {{ s }}{% endtrans %}</h3>
|
<h3>{% trans s=stock %}Shopping lists history for {{ s }}{% endtrans %}</h3>
|
||||||
|
|
||||||
<h4>To do</h4>
|
<h4>{% trans %}To do{% endtrans %}</h4>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -36,7 +36,7 @@ Shopping list for {{ stock }}
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h4>Done</h4>
|
<h4>{% trans %}Done{% endtrans %}</h4>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -52,7 +52,7 @@ Shopping list for {{ stock }}
|
|||||||
<td><a href="{{ url('stock:shoppinglist_items', stock_id=stock.id, shoppinglist_id=s.id)}}">{{ s.name }}</a></td>
|
<td><a href="{{ url('stock:shoppinglist_items', stock_id=stock.id, shoppinglist_id=s.id)}}">{{ s.name }}</a></td>
|
||||||
<td>{{ s.items_to_buy.count() }}</td>
|
<td>{{ s.items_to_buy.count() }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ url('stock:shoppinglist_set_todo', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Mark as todo{% endtrans %}</a>
|
<a href="{{ url('stock:shoppinglist_set_todo', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Mark as to do{% endtrans %}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ url('stock:shoppinglist_delete', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Delete{% endtrans %}</a>
|
<a href="{{ url('stock:shoppinglist_delete', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Delete{% endtrans %}</a>
|
||||||
|
@ -170,7 +170,7 @@ class StockItemQuantityForm(forms.BaseForm):
|
|||||||
shopping_list.stock_owner = self.stock
|
shopping_list.stock_owner = self.stock
|
||||||
shopping_list.save()
|
shopping_list.save()
|
||||||
for k,t in self.cleaned_data.items():
|
for k,t in self.cleaned_data.items():
|
||||||
if t is not None:
|
if int(t) > 0 :
|
||||||
item_id = int(k[5:])
|
item_id = int(k[5:])
|
||||||
item = StockItem.objects.filter(id=item_id).first()
|
item = StockItem.objects.filter(id=item_id).first()
|
||||||
item.tobuy_quantity = t
|
item.tobuy_quantity = t
|
||||||
|
Loading…
Reference in New Issue
Block a user