mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 03:56:43 +00:00
Pass dates in templates through the new template tag
This commit is contained in:
parent
08946a411a
commit
b00ae67d68
@ -151,7 +151,7 @@ src="{% static 'img/blank_image.png' %}"
|
|||||||
{% trans "Target Date" %}
|
{% trans "Target Date" %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ build.target_date }}
|
{% render_date build.target_date %}
|
||||||
{% if build.is_overdue %}
|
{% if build.is_overdue %}
|
||||||
<span title='{% blocktrans with target=build.target_date %}This build was due on {{target}}{% endblocktrans %}' class='badge badge-right rounded-pill bg-danger'>{% trans "Overdue" %}</span>
|
<span title='{% blocktrans with target=build.target_date %}This build was due on {{target}}{% endblocktrans %}' class='badge badge-right rounded-pill bg-danger'>{% trans "Overdue" %}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<div class='panel-content'>
|
<div class='panel-content'>
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
<div class='col-sm-6'>
|
<div class='col-sm-6'>
|
||||||
<table class='table table-striped'>
|
<table class='table table-striped table-condensed'>
|
||||||
<col width='25'>
|
<col width='25'>
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-info'></span></td>
|
<td><span class='fas fa-info'></span></td>
|
||||||
@ -120,19 +120,19 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class='col-sm-6'>
|
<div class='col-sm-6'>
|
||||||
<table class='table table-striped'>
|
<table class='table table-striped table-condensed'>
|
||||||
<col width='25'>
|
<col width='25'>
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Created" %}</td>
|
<td>{% trans "Created" %}</td>
|
||||||
<td>{{ build.creation_date }}</td>
|
<td>{% render_date build.creation_date %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Target Date" %}</td>
|
<td>{% trans "Target Date" %}</td>
|
||||||
{% if build.target_date %}
|
{% if build.target_date %}
|
||||||
<td>
|
<td>
|
||||||
{{ build.target_date }}{% if build.is_overdue %} <span class='fas fa-calendar-times icon-red'></span>{% endif %}
|
{% render_date build.target_date %}{% if build.is_overdue %} <span class='fas fa-calendar-times icon-red'></span>{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td><em>{% trans "No target date set" %}</em></td>
|
<td><em>{% trans "No target date set" %}</em></td>
|
||||||
@ -142,7 +142,7 @@
|
|||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Completed" %}</td>
|
<td>{% trans "Completed" %}</td>
|
||||||
{% if build.completion_date %}
|
{% if build.completion_date %}
|
||||||
<td>{{ build.completion_date }}{% if build.completed_by %}<span class='badge badge-right rounded-pill bg-dark'>{{ build.completed_by }}</span>{% endif %}</td>
|
<td>{% render_date build.completion_date %}{% if build.completed_by %}<span class='badge badge-right rounded-pill bg-dark'>{{ build.completed_by }}</span>{% endif %}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td><em>{% trans "Build not complete" %}</em></td>
|
<td><em>{% trans "Build not complete" %}</em></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -141,27 +141,27 @@ src="{% static 'img/blank_image.png' %}"
|
|||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Created" %}</td>
|
<td>{% trans "Created" %}</td>
|
||||||
<td>{{ order.creation_date }}<span class='badge badge-right rounded-pill bg-dark'>{{ order.created_by }}</span></td>
|
<td>{% render_date order.creation_date %}<span class='badge badge-right rounded-pill bg-dark'>{{ order.created_by }}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if order.issue_date %}
|
{% if order.issue_date %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Issued" %}</td>
|
<td>{% trans "Issued" %}</td>
|
||||||
<td>{{ order.issue_date }}</td>
|
<td>{% render_date order.issue_date %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if order.target_date %}
|
{% if order.target_date %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Target Date" %}</td>
|
<td>{% trans "Target Date" %}</td>
|
||||||
<td>{{ order.target_date }}</td>
|
<td>{% render_date order.target_date %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if order.status == PurchaseOrderStatus.COMPLETE %}
|
{% if order.status == PurchaseOrderStatus.COMPLETE %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Received" %}</td>
|
<td>{% trans "Received" %}</td>
|
||||||
<td>{{ order.complete_date }}<span class='badge badge-right rounded-pill bg-dark'>{{ order.received_by }}</span></td>
|
<td>{% render_date order.complete_date %}<span class='badge badge-right rounded-pill bg-dark'>{{ order.received_by }}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if order.responsible %}
|
{% if order.responsible %}
|
||||||
|
@ -155,13 +155,13 @@ src="{% static 'img/blank_image.png' %}"
|
|||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Created" %}</td>
|
<td>{% trans "Created" %}</td>
|
||||||
<td>{{ order.creation_date }}<span class='badge badge-right rounded-pill bg-dark'>{{ order.created_by }}</span></td>
|
<td>{% render_date order.creation_date %}<span class='badge badge-right rounded-pill bg-dark'>{{ order.created_by }}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if order.target_date %}
|
{% if order.target_date %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Target Date" %}</td>
|
<td>{% trans "Target Date" %}</td>
|
||||||
<td>{{ order.target_date }}</td>
|
<td>{% render_date order.target_date %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if order.shipment_date %}
|
{% if order.shipment_date %}
|
||||||
@ -169,7 +169,7 @@ src="{% static 'img/blank_image.png' %}"
|
|||||||
<td><span class='fas fa-truck'></span></td>
|
<td><span class='fas fa-truck'></span></td>
|
||||||
<td>{% trans "Completed" %}</td>
|
<td>{% trans "Completed" %}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ order.shipment_date }}
|
{% render_date order.shipment_date %}
|
||||||
{% if order.shipped_by %}
|
{% if order.shipped_by %}
|
||||||
<span class='badge badge-right rounded-pill bg-dark'>{{ order.shipped_by }}</span>
|
<span class='badge badge-right rounded-pill bg-dark'>{{ order.shipped_by }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -952,7 +952,7 @@
|
|||||||
{% if price_history %}
|
{% if price_history %}
|
||||||
var purchasepricedata = {
|
var purchasepricedata = {
|
||||||
labels: [
|
labels: [
|
||||||
{% for line in price_history %}'{{ line.date }}',{% endfor %}
|
{% for line in price_history %}'{% render_date line.date %}',{% endfor %}
|
||||||
],
|
],
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: '{% blocktrans %}Purchase Unit Price - {{currency}}{% endblocktrans %}',
|
label: '{% blocktrans %}Purchase Unit Price - {{currency}}{% endblocktrans %}',
|
||||||
@ -1065,7 +1065,7 @@
|
|||||||
{% if sale_history %}
|
{% if sale_history %}
|
||||||
var salepricedata = {
|
var salepricedata = {
|
||||||
labels: [
|
labels: [
|
||||||
{% for line in sale_history %}'{{ line.date }}',{% endfor %}
|
{% for line in sale_history %}'{% render_date line.date %}',{% endfor %}
|
||||||
],
|
],
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: '{% blocktrans %}Unit Price - {{currency}}{% endblocktrans %}',
|
label: '{% blocktrans %}Unit Price - {{currency}}{% endblocktrans %}',
|
||||||
|
@ -312,7 +312,7 @@
|
|||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Creation Date" %}</td>
|
<td>{% trans "Creation Date" %}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ part.creation_date }}
|
{% render_date part.creation_date %}
|
||||||
{% if part.creation_user %}
|
{% if part.creation_user %}
|
||||||
<span class='badge badge-right rounded-pill bg-dark'>{{ part.creation_user }}</span>
|
<span class='badge badge-right rounded-pill bg-dark'>{{ part.creation_user }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -120,13 +120,13 @@ content: "v{{report_revision}} - {{ date.isoformat }}";
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Issued" %}</th>
|
<th>{% trans "Issued" %}</th>
|
||||||
<td>{{ build.creation_date }}</td>
|
<td>{% render_date build.creation_date %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Target Date" %}</th>
|
<th>{% trans "Target Date" %}</th>
|
||||||
<td>
|
<td>
|
||||||
{% if build.target_date %}
|
{% if build.target_date %}
|
||||||
{{ build.target_date }}
|
{% render_date build.target_date %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<em>Not specified</em>
|
<em>Not specified</em>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -187,7 +187,7 @@
|
|||||||
<td><span class='fas fa-calendar-alt{% if item.is_expired %} icon-red{% endif %}'></span></td>
|
<td><span class='fas fa-calendar-alt{% if item.is_expired %} icon-red{% endif %}'></span></td>
|
||||||
<td>{% trans "Expiry Date" %}</td>
|
<td>{% trans "Expiry Date" %}</td>
|
||||||
<td>
|
<td>
|
||||||
{{ item.expiry_date }}
|
{% render_date item.expiry_date %}
|
||||||
{% if item.is_expired %}
|
{% if item.is_expired %}
|
||||||
<span title='{% blocktrans %}This StockItem expired on {{ item.expiry_date }}{% endblocktrans %}' class='badge rounded-pill bg-danger badge-right'>{% trans "Expired" %}</span>
|
<span title='{% blocktrans %}This StockItem expired on {{ item.expiry_date }}{% endblocktrans %}' class='badge rounded-pill bg-danger badge-right'>{% trans "Expired" %}</span>
|
||||||
{% elif item.is_stale %}
|
{% elif item.is_stale %}
|
||||||
@ -205,7 +205,7 @@
|
|||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Last Stocktake" %}</td>
|
<td>{% trans "Last Stocktake" %}</td>
|
||||||
{% if item.stocktake_date %}
|
{% if item.stocktake_date %}
|
||||||
<td>{{ item.stocktake_date }} <span class='badge badge-right rounded-pill bg-dark'>{{ item.stocktake_user }}</span></td>
|
<td>{% render_date item.stocktake_date %} <span class='badge badge-right rounded-pill bg-dark'>{{ item.stocktake_user }}</span></td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td><em>{% trans "No stocktake performed" %}</em></td>
|
<td><em>{% trans "No stocktake performed" %}</em></td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ plugin.author }}</td>
|
<td>{{ plugin.author }}</td>
|
||||||
<td>{{ plugin.pub_date }}</td>
|
<td>{% render_date plugin.pub_date %}</td>
|
||||||
<td>{% if plugin.version %}{{ plugin.version }}{% endif %}</td>
|
<td>{% if plugin.version %}{{ plugin.version }}{% endif %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Date" %}</td>
|
<td>{% trans "Date" %}</td>
|
||||||
<td>{{ plugin.pub_date }}{% include "clip.html" %}</td>
|
<td>{% render_date plugin.pub_date %}{% include "clip.html" %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-hashtag'></span></td>
|
<td><span class='fas fa-hashtag'></span></td>
|
||||||
@ -101,7 +101,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Commit Date" %}</td><td>{{ plugin.package.date }}{% include "clip.html" %}</td>
|
<td>{% trans "Commit Date" %}</td><td>{% render_date plugin.package.date %}{% include "clip.html" %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-code-branch'></span></td>
|
<td><span class='fas fa-code-branch'></span></td>
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
{% if commit_date %}
|
{% if commit_date %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-calendar-alt'></span></td>
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Commit Date" %}</td><td>{{ commit_date }}{% include "clip.html" %}</td>
|
<td>{% trans "Commit Date" %}</td><td>{% render_date commit_date %}{% include "clip.html" %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
InvenTree-Version: {% inventree_version %}
|
InvenTree-Version: {% inventree_version %}
|
||||||
Django Version: {% django_version %}
|
Django Version: {% django_version %}
|
||||||
{% inventree_commit_hash as hash %}{% if hash %}Commit Hash: {{ hash }}{% endif %}
|
{% inventree_commit_hash as hash %}{% if hash %}Commit Hash: {{ hash }}{% endif %}
|
||||||
{% inventree_commit_date as commit_date %}{% if commit_date %}Commit Date: {{ commit_date }}{% endif %}
|
{% inventree_commit_date as commit_date %}{% if commit_date %}Commit Date: {% render_date commit_date %}{% endif %}
|
||||||
Database: {% inventree_db_engine %}
|
Database: {% inventree_db_engine %}
|
||||||
Debug-Mode: {% inventree_in_debug_mode %}
|
Debug-Mode: {% inventree_in_debug_mode %}
|
||||||
Deployed using Docker: {% inventree_docker_mode %}
|
Deployed using Docker: {% inventree_docker_mode %}
|
Loading…
x
Reference in New Issue
Block a user