introduce djhtml as jinja+scss formater

This commit is contained in:
thomas girod
2024-07-24 00:16:31 +02:00
committed by Bartuccio Antoine
parent 13d0d2a300
commit b25805e0a1
171 changed files with 7070 additions and 7018 deletions

View File

@ -1,51 +1,51 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}{{ shoppinglist }}'s items{% endtrans %}
{% trans %}{{ shoppinglist }}'s items{% endtrans %}
{% endblock %}
{% block content %}
{% if current_tab == "stocks" %}
<a href="{{ url('stock:shoppinglist_list', stock_id=shoppinglist.stock_owner.id)}}">{% trans %}Back{% endtrans %}</a>
{% endif %}
{% if current_tab == "stocks" %}
<a href="{{ url('stock:shoppinglist_list', stock_id=shoppinglist.stock_owner.id)}}">{% trans %}Back{% endtrans %}</a>
{% endif %}
<h3>{{ shoppinglist.name }}</h3>
{% for t in ProductType.objects.order_by('name').all() %}
{% if shoppinglist.shopping_items_to_buy.filter(type=t) %}
<h4>{{ t }}</h4>
<br>
<table>
<thead>
<tr>
<td>{% trans %}Name{% endtrans %}</td>
<td>{% trans %}Quantity asked{% endtrans %}</td>
<td>{% trans %}Quantity bought{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for i in shoppinglist.shopping_items_to_buy.filter(type=t).order_by('name').all() %}
<tr>
<td>{{ i.name }}</td>
<td>{{ i.tobuy_quantity }}</td>
<td>{{ i.bought_quantity }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endfor %}
<h4>{% trans %}Other{% endtrans %}</h4>
<br>
<table>
<thead>
<tr>
<td>{% trans %}Comments{% endtrans %}</td>
</tr>
</thead>
<tbody>
<tr>
<td>{{ shoppinglist.comment }}</td>
</tr>
</tbody>
</table>
<h3>{{ shoppinglist.name }}</h3>
{% for t in ProductType.objects.order_by('name').all() %}
{% if shoppinglist.shopping_items_to_buy.filter(type=t) %}
<h4>{{ t }}</h4>
<br>
<table>
<thead>
<tr>
<td>{% trans %}Name{% endtrans %}</td>
<td>{% trans %}Quantity asked{% endtrans %}</td>
<td>{% trans %}Quantity bought{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for i in shoppinglist.shopping_items_to_buy.filter(type=t).order_by('name').all() %}
<tr>
<td>{{ i.name }}</td>
<td>{{ i.tobuy_quantity }}</td>
<td>{{ i.bought_quantity }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endfor %}
<h4>{% trans %}Other{% endtrans %}</h4>
<br>
<table>
<thead>
<tr>
<td>{% trans %}Comments{% endtrans %}</td>
</tr>
</thead>
<tbody>
<tr>
<td>{{ shoppinglist.comment }}</td>
</tr>
</tbody>
</table>
{% endblock %}

View File

@ -1,16 +1,16 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans s = stock %}{{ s }}'s quantity to buy{% endtrans %}
{% 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>
<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 %}

View File

@ -2,31 +2,31 @@
{% from 'core/macros.jinja' import user_profile_link %}
{% block title %}
{{ stock }}
{{ stock }}
{% endblock %}
{% 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 lists{% endtrans %}</a></h5>
{% endif %}
{% if stock %}
<h3>{{ stock }}</h3>
{% for t in ProductType.objects.order_by('name') %}
<h4>{{ t }}</h4>
<ul>
{% for i in stock.items.filter(type=t).order_by('name') %}
<li><a href="{{ url('stock:edit_item', item_id=i.id)}}">{{ i }} ({{ i.effective_quantity }} {% trans %}left{% endtrans %})</a></li>
{% 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 lists{% endtrans %}</a></h5>
{% endif %}
{% if stock %}
<h3>{{ stock }}</h3>
{% for t in ProductType.objects.order_by('name') %}
<h4>{{ t }}</h4>
<ul>
{% for i in stock.items.filter(type=t).order_by('name') %}
<li><a href="{{ url('stock:edit_item', item_id=i.id)}}">{{ i }} ({{ i.effective_quantity }} {% trans %}left{% endtrans %})</a></li>
{% endfor %}
</ul>
{% endfor %}
</ul>
{% endfor %}
<h4>{% trans %}Others{% endtrans %}</h4>
<ul>
{% for i in stock.items.filter(type=None).order_by('name') %}
<li><a href="{{ url('stock:edit_item', item_id=i.id)}}">{{ i }} ({{ i.effective_quantity }} {% trans %}left{% endtrans %})</a></li>
{% endfor %}
</ul>
{% else %}
{% trans %}There is no items in this stock.{% endtrans %}
{% endif %}
<h4>{% trans %}Others{% endtrans %}</h4>
<ul>
{% for i in stock.items.filter(type=None).order_by('name') %}
<li><a href="{{ url('stock:edit_item', item_id=i.id)}}">{{ i }} ({{ i.effective_quantity }} {% trans %}left{% endtrans %})</a></li>
{% endfor %}
</ul>
{% else %}
{% trans %}There is no items in this stock.{% endtrans %}
{% endif %}
{% endblock %}

View File

@ -1,24 +1,24 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans %}Stock list{% endtrans %}
{% trans %}Stock list{% endtrans %}
{% endblock %}
{% block content %}
{% if stock_list %}
<h3>{% trans %}Stock list{% endtrans %}</h3>
<ul>
{% for s in stock_list.order_by('name') %}
<li>
{% if user.can_edit(s) %}
<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:shoppinglist_list', stock_id=s.id)}}">{% trans %}Shopping lists{% endtrans %}</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
{% trans %}There is no stocks in this website.{% endtrans %}
{% endif %}
{% if stock_list %}
<h3>{% trans %}Stock list{% endtrans %}</h3>
<ul>
{% for s in stock_list.order_by('name') %}
<li>
{% if user.can_edit(s) %}
<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:shoppinglist_list', stock_id=s.id)}}">{% trans %}Shopping lists{% endtrans %}</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
{% trans %}There is no stocks in this website.{% endtrans %}
{% endif %}
{% endblock %}

View File

@ -1,75 +1,75 @@
{% extends "core/base.jinja" %}
{% block title %}
Shopping list for {{ stock }}
Shopping list for {{ stock }}
{% endblock %}
{% block content %}
{% if current_tab == "stocks" %}
<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>
{% if current_tab == "stocks" %}
<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>
<p>
{% trans %}Information :{% endtrans %}
<br>
{% trans %}Use the "update stock" action when you get back from shopping to add the effective quantity bought for each shopping list item.{% endtrans %}
<br>
{% trans %}For example, 3 Cheeseburger (boxes) are aksing in the list, but there were only 2 so, 2 have to be added in the stock quantity.{% endtrans %}
</p>
<p>
{% trans %}Information :{% endtrans %}
<br>
{% trans %}Use the "update stock" action when you get back from shopping to add the effective quantity bought for each shopping list item.{% endtrans %}
<br>
{% trans %}For example, 3 Cheeseburger (boxes) are aksing in the list, but there were only 2 so, 2 have to be added in the stock quantity.{% endtrans %}
</p>
<h4>{% trans %}To do{% endtrans %}</h4>
<table>
<thead>
<tr>
<td>{% trans %}Date{% endtrans %}</td>
<td>{% trans %}Name{% endtrans %}</td>
<td>{% trans %}Number of items{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for s in stock.shopping_lists.filter(todo=True).filter(stock_owner=stock).order_by('-date').all() %}
<tr>
<td>{{ s.date|localtime|date("Y-m-d H:i") }}</td>
<td><a href="{{ url('stock:shoppinglist_items', stock_id=stock.id, shoppinglist_id=s.id)}}">{{ s.name }}</a></td>
<td>{{ s.shopping_items_to_buy.count() }}</td>
<td>
<a href="{{ url('stock:update_after_shopping', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Update stock{% endtrans %}</a>
</td>
<td>
<a href="{{ url('stock:shoppinglist_set_done', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Mark as done{% endtrans %}</a>
</td>
<td>
<a href="{{ url('stock:shoppinglist_delete', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Delete{% endtrans %}</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<h4>{% trans %}To do{% endtrans %}</h4>
<table>
<thead>
<tr>
<td>{% trans %}Date{% endtrans %}</td>
<td>{% trans %}Name{% endtrans %}</td>
<td>{% trans %}Number of items{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for s in stock.shopping_lists.filter(todo=True).filter(stock_owner=stock).order_by('-date').all() %}
<tr>
<td>{{ s.date|localtime|date("Y-m-d H:i") }}</td>
<td><a href="{{ url('stock:shoppinglist_items', stock_id=stock.id, shoppinglist_id=s.id)}}">{{ s.name }}</a></td>
<td>{{ s.shopping_items_to_buy.count() }}</td>
<td>
<a href="{{ url('stock:update_after_shopping', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Update stock{% endtrans %}</a>
</td>
<td>
<a href="{{ url('stock:shoppinglist_set_done', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Mark as done{% endtrans %}</a>
</td>
<td>
<a href="{{ url('stock:shoppinglist_delete', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Delete{% endtrans %}</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<h4>{% trans %}Done{% endtrans %}</h4>
<table>
<thead>
<tr>
<td>{% trans %}Date{% endtrans %}</td>
<td>{% trans %}Name{% endtrans %}</td>
<td>{% trans %}Number of items{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for s in stock.shopping_lists.filter(todo=False).filter(stock_owner=stock).order_by('-date').all() %}
<tr>
<td>{{ s.date|localtime|date("Y-m-d H:i") }}</td>
<td><a href="{{ url('stock:shoppinglist_items', stock_id=stock.id, shoppinglist_id=s.id)}}">{{ s.name }}</a></td>
<td>{{ s.shopping_items_to_buy.count() }}</td>
<td>
<a href="{{ url('stock:shoppinglist_set_todo', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Mark as to do{% endtrans %}</a>
</td>
<td>
<a href="{{ url('stock:shoppinglist_delete', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Delete{% endtrans %}</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<h4>{% trans %}Done{% endtrans %}</h4>
<table>
<thead>
<tr>
<td>{% trans %}Date{% endtrans %}</td>
<td>{% trans %}Name{% endtrans %}</td>
<td>{% trans %}Number of items{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for s in stock.shopping_lists.filter(todo=False).filter(stock_owner=stock).order_by('-date').all() %}
<tr>
<td>{{ s.date|localtime|date("Y-m-d H:i") }}</td>
<td><a href="{{ url('stock:shoppinglist_items', stock_id=stock.id, shoppinglist_id=s.id)}}">{{ s.name }}</a></td>
<td>{{ s.shopping_items_to_buy.count() }}</td>
<td>
<a href="{{ url('stock:shoppinglist_set_todo', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Mark as to do{% endtrans %}</a>
</td>
<td>
<a href="{{ url('stock:shoppinglist_delete', stock_id=stock.id, shoppinglist_id=s.id)}}">{% trans %}Delete{% endtrans %}</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@ -2,16 +2,16 @@
{% from 'core/macros.jinja' import user_profile_link %}
{% block title %}
{% trans s = stock %}Take items from {{ s }}{% endtrans %}
{% trans s = stock %}Take items from {{ s }}{% endtrans %}
{% endblock %}
{% block content %}
<h3>{% trans s = stock %}Take items from {{ s }}{% endtrans %}</h3>
<div>
<form method="post" action="" class="inline" style="display:inline">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="{% trans %}Take items{% endtrans %}" /></p>
</form>
</div>
<h3>{% trans s = stock %}Take items from {{ s }}{% endtrans %}</h3>
<div>
<form method="post" action="" class="inline" style="display:inline">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="{% trans %}Take items{% endtrans %}" /></p>
</form>
</div>
{% endblock %}

View File

@ -1,16 +1,16 @@
{% extends "core/base.jinja" %}
{% block title %}
{% trans s = shoppinglist %}Update {{ s }}'s quantity after shopping{% endtrans %}
{% trans s = shoppinglist %}Update {{ s }}'s quantity after shopping{% endtrans %}
{% endblock %}
{% block content %}
<h3>{% trans s = shoppinglist %}Update {{ s }}'s quantity after shopping{% endtrans %}</h3>
<div>
<form method="post" action="" class="inline" style="display:inline">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="{% trans %}Update stock quantities{% endtrans %}" /></p>
</form>
</div>
<h3>{% trans s = shoppinglist %}Update {{ s }}'s quantity after shopping{% endtrans %}</h3>
<div>
<form method="post" action="" class="inline" style="display:inline">
{% csrf_token %}
{{ form.as_p() }}
<p><input type="submit" value="{% trans %}Update stock quantities{% endtrans %}" /></p>
</form>
</div>
{% endblock %}