Applied the force_escape filter to the gettext shortcut _("...") in the templates, because it returns SafeString instead of str.

This commit is contained in:
2020-08-06 23:55:24 +08:00
parent f970974e71
commit f6c6ee7fe4
19 changed files with 225 additions and 225 deletions

View File

@ -59,7 +59,7 @@ First written: 2020/7/16
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="d-none d-md-inline">{{ account.title|title_case }}</span>
<span class="d-md-none">{{ _("Account") }}</span>
<span class="d-md-none">{{ _("Account")|force_escape }}</span>
</button>
<div class="dropdown-menu account-picker">
{% for x in accounts %}
@ -85,13 +85,13 @@ First written: 2020/7/16
<table class="table table-striped table-hover d-none d-md-table general-journal-table">
<thead>
<tr>
<th scope="col">{{ _("Date") }}</th>
<th scope="col">{{ _("Account") }}</th>
<th scope="col">{{ _("Summary") }}</th>
<th class="amount" scope="col">{{ _("Debit") }}</th>
<th class="amount" scope="col">{{ _("Credit") }}</th>
<th class="amount" scope="col">{{ _("Balance") }}</th>
<th class="actions" scope="col">{{ _("View") }}</th>
<th scope="col">{{ _("Date")|force_escape }}</th>
<th scope="col">{{ _("Account")|force_escape }}</th>
<th scope="col">{{ _("Summary")|force_escape }}</th>
<th class="amount" scope="col">{{ _("Debit")|force_escape }}</th>
<th class="amount" scope="col">{{ _("Credit")|force_escape }}</th>
<th class="amount" scope="col">{{ _("Balance")|force_escape }}</th>
<th class="actions" scope="col">{{ _("View")|force_escape }}</th>
</tr>
</thead>
<tbody>
@ -101,19 +101,19 @@ First written: 2020/7/16
<td>{{ item.account.title|title_case }}</td>
<td>{{ item.summary|default:"" }}{% if not item.is_balanced %}
<span class="badge badge-danger badge-pill">
{{ _("Unbalanced") }}
{{ _("Unbalanced")|force_escape }}
</span>
{% endif %}{% if item.has_order_hole %}
<span class="badge badge-danger badge-pill">
{{ _("Need Reorder") }}
{{ _("Need Reorder")|force_escape }}
</span>
{% endif %}{% if not item.is_credit_card_paid %}
<span class="badge badge-danger badge-pill">
{{ _("Unpaid") }}
{{ _("Unpaid")|force_escape }}
</span>
{% endif %}{% if item.is_existing_equipment %}
<span class="badge badge-info badge-pill">
{{ _("Existing") }}
{{ _("Existing")|force_escape }}
</span>
{% endif %}</td>
<td class="amount">{{ item.debit_amount|accounting_amount }}</td>
@ -123,7 +123,7 @@ First written: 2020/7/16
{% if item.pk is not None %}
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" class="btn btn-info" role="button">
<i class="fas fa-eye"></i>
<span class="d-none d-lg-inline">{{ _("View") }}</span>
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
</a>
{% endif %}
</td>
@ -146,22 +146,22 @@ First written: 2020/7/16
{{ item.summary|default:"" }}
{% if not item.is_balanced %}
<span class="badge badge-danger badge-pill">
{{ _("Unbalanced") }}
{{ _("Unbalanced")|force_escape }}
</span>
{% endif %}
{% if item.has_order_hole %}
<span class="badge badge-danger badge-pill">
{{ _("Need Reorder") }}
{{ _("Need Reorder")|force_escape }}
</span>
{% endif %}
{% if not item.is_credit_card_paid %}
<span class="badge badge-danger badge-pill">
{{ _("Unpaid") }}
{{ _("Unpaid")|force_escape }}
</span>
{% endif %}
{% if item.is_existing_equipment %}
<span class="badge badge-info badge-pill">
{{ _("Existing") }}
{{ _("Existing")|force_escape }}
</span>
{% endif %}
</div>