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

@ -58,16 +58,16 @@ First written: 2020/7/15
<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">
<div class="dropdown-header">{{ _("Shortcuts") }}</div>
<div class="dropdown-header">{{ _("Shortcuts")|force_escape }}</div>
{% for x in shortcut_accounts %}
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" x %}">
{{ x.title|title_case }}
</a>
{% endfor %}
<div class="dropdown-header">{{ _("All") }}</div>
<div class="dropdown-header">{{ _("All")|force_escape }}</div>
{% for x in all_accounts %}
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" x %}">
{{ x.code }} {{ x.title|title_case }}
@ -84,12 +84,12 @@ First written: 2020/7/15
<table class="table table-striped table-hover d-none d-sm-table general-journal-table">
<thead>
<tr>
<th scope="col">{{ _("Month") }}</th>
<th class="amount" scope="col">{{ _("Income") }}</th>
<th class="amount" scope="col">{{ _("Expense") }}</th>
<th class="amount" scope="col">{{ _("Balance") }}</th>
<th class="amount" scope="col">{{ _("Cumulative Balance") }}</th>
<th class="actions" scope="col">{{ _("View") }}</th>
<th scope="col">{{ _("Month")|force_escape }}</th>
<th class="amount" scope="col">{{ _("Income")|force_escape }}</th>
<th class="amount" scope="col">{{ _("Expense")|force_escape }}</th>
<th class="amount" scope="col">{{ _("Balance")|force_escape }}</th>
<th class="amount" scope="col">{{ _("Cumulative Balance")|force_escape }}</th>
<th class="actions" scope="col">{{ _("View")|force_escape }}</th>
</tr>
</thead>
<tbody>
@ -104,7 +104,7 @@ First written: 2020/7/15
{% if item.month is not None %}
<a class="btn btn-info" role="button" href="{% url "accounting:cash" account item.month|date:"Y-m" %}">
<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>