mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-24 09:38:35 +02:00
refactor: remove custom_date filter
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
{% extends 'extends/offcanvas.html' %}
|
{% extends 'extends/offcanvas.html' %}
|
||||||
{% load date %}
|
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load crispy_forms_tags %}
|
{% load crispy_forms_tags %}
|
||||||
|
|
||||||
{% block title %}{% translate 'Transactions on' %} {{ date|custom_date:request.user }}{% endblock %}
|
{% block title %}{% translate 'Transactions on' %} {{ date|date:"SHORT_DATE_FORMAT" }}{% endblock %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div hx-get="{% url 'calendar_transactions_list' day=date.day month=date.month year=date.year %}" hx-trigger="updated from:window" hx-vals='{"disable_selection": true}' hx-target="closest .offcanvas" class="show-loading">
|
<div hx-get="{% url 'calendar_transactions_list' day=date.day month=date.month year=date.year %}" hx-trigger="updated from:window" hx-vals='{"disable_selection": true}' hx-target="closest .offcanvas" class="show-loading">
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
{% load date %}
|
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
<div class="transaction d-flex my-1 {% if transaction.type == "EX" %}expense{% else %}income{% endif %}">
|
<div class="transaction d-flex my-1 {% if transaction.type == "EX" %}expense{% else %}income{% endif %}">
|
||||||
{% if not disable_selection %}
|
{% if not disable_selection %}
|
||||||
@@ -27,7 +26,7 @@
|
|||||||
{# Date#}
|
{# Date#}
|
||||||
<div class="row mb-2 mb-lg-1 tw-text-gray-400">
|
<div class="row mb-2 mb-lg-1 tw-text-gray-400">
|
||||||
<div class="col-auto pe-1"><i class="fa-solid fa-calendar fa-fw me-1 fa-xs"></i></div>
|
<div class="col-auto pe-1"><i class="fa-solid fa-calendar fa-fw me-1 fa-xs"></i></div>
|
||||||
<div class="col ps-0">{{ transaction.date|custom_date:request.user }} • {{ transaction.reference_date|date:"b/Y" }}</div>
|
<div class="col ps-0">{{ transaction.date|date:"SHORT_DATE_FORMAT" }} • {{ transaction.reference_date|date:"b/Y" }}</div>
|
||||||
</div>
|
</div>
|
||||||
{# Description#}
|
{# Description#}
|
||||||
<div class="mb-2 mb-lg-1 text-white tw-text-base">
|
<div class="mb-2 mb-lg-1 text-white tw-text-base">
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
{% load date %}
|
|
||||||
{% load currency_display %}
|
{% load currency_display %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
<div class="container-fluid px-md-3 py-3 column-gap-5">
|
<div class="container-fluid px-md-3 py-3 column-gap-5">
|
||||||
@@ -17,7 +16,7 @@
|
|||||||
:prefix="strategy.payment_currency.prefix"
|
:prefix="strategy.payment_currency.prefix"
|
||||||
:suffix="strategy.payment_currency.suffix"
|
:suffix="strategy.payment_currency.suffix"
|
||||||
:decimal_places="strategy.payment_currency.decimal_places">
|
:decimal_places="strategy.payment_currency.decimal_places">
|
||||||
• {{ strategy.current_price.1|custom_date:request.user }}
|
• {{ strategy.current_price.1|date:"SHORT_DATETIME_FORMAT" }}
|
||||||
</c-amount.display>
|
</c-amount.display>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="tw-text-red-400">{% trans "No exchange rate available" %}</div>
|
<div class="tw-text-red-400">{% trans "No exchange rate available" %}</div>
|
||||||
@@ -84,7 +83,7 @@
|
|||||||
_="install prompt_swal"><i class="fa-solid fa-trash fa-fw"></i></a>
|
_="install prompt_swal"><i class="fa-solid fa-trash fa-fw"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ entry.date|custom_date:request.user }}</td>
|
<td>{{ entry.date|date:"SHORT_DATE_FORMAT" }}</td>
|
||||||
<td>
|
<td>
|
||||||
<c-amount.display
|
<c-amount.display
|
||||||
:amount="entry.amount_received"
|
:amount="entry.amount_received"
|
||||||
@@ -222,7 +221,7 @@
|
|||||||
new Chart(perfomancectx, {
|
new Chart(perfomancectx, {
|
||||||
type: 'line',
|
type: 'line',
|
||||||
data: {
|
data: {
|
||||||
labels: [{% for entry in entries_data %}'{{ entry.entry.date|custom_date:request.user }}'{% if not forloop.last %}, {% endif %}{% endfor %}],
|
labels: [{% for entry in entries_data %}'{{ entry.entry.date|date:"SHORT_DATE_FORMAT" }}'{% if not forloop.last %}, {% endif %}{% endfor %}],
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: '{% trans "P/L %" %}',
|
label: '{% trans "P/L %" %}',
|
||||||
data: [{% for entry in entries_data %}{{ entry.profit_loss_percentage|floatformat:"-40u" }}{% if not forloop.last %}, {% endif %}{% endfor %}],
|
data: [{% for entry in entries_data %}{{ entry.profit_loss_percentage|floatformat:"-40u" }}{% if not forloop.last %}, {% endif %}{% endfor %}],
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
{% load date %}
|
|
||||||
{% load currency_display %}
|
{% load currency_display %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
<div class="card-body show-loading" hx-get="{% url 'exchange_rates_list_pair' %}" hx-trigger="updated from:window" hx-swap="outerHTML" hx-vals='{"page": "{{ page_obj.number }}", "from": "{{ from_currency|default_if_none:"" }}", "to": "{{ to_currency|default_if_none:"" }}"}'>
|
<div class="card-body show-loading" hx-get="{% url 'exchange_rates_list_pair' %}" hx-trigger="updated from:window" hx-swap="outerHTML" hx-vals='{"page": "{{ page_obj.number }}", "from": "{{ from_currency|default_if_none:"" }}", "to": "{{ to_currency|default_if_none:"" }}"}'>
|
||||||
@@ -40,7 +39,7 @@
|
|||||||
_="install prompt_swal"><i class="fa-solid fa-trash fa-fw"></i></a>
|
_="install prompt_swal"><i class="fa-solid fa-trash fa-fw"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="col-3">{{ exchange_rate.date|custom_date:request.user }}</td>
|
<td class="col-3">{{ exchange_rate.date|date:"SHORT_DATETIME_FORMAT" }}</td>
|
||||||
<td class="col-3"><span class="badge rounded-pill text-bg-secondary">{{ exchange_rate.from_currency.code }}</span> x <span class="badge rounded-pill text-bg-secondary">{{ exchange_rate.to_currency.code }}</span></td>
|
<td class="col-3"><span class="badge rounded-pill text-bg-secondary">{{ exchange_rate.from_currency.code }}</span> x <span class="badge rounded-pill text-bg-secondary">{{ exchange_rate.to_currency.code }}</span></td>
|
||||||
<td class="col-3">1 {{ exchange_rate.from_currency.code }} ≅ {% currency_display amount=exchange_rate.rate prefix=exchange_rate.to_currency.prefix suffix=exchange_rate.to_currency.suffix decimal_places=exchange_rate.to_currency.decimal_places%}</td>
|
<td class="col-3">1 {{ exchange_rate.from_currency.code }} ≅ {% currency_display amount=exchange_rate.rate prefix=exchange_rate.to_currency.prefix suffix=exchange_rate.to_currency.suffix decimal_places=exchange_rate.to_currency.decimal_places%}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user