Revised the income statement for the small screens on mobile devices.

This commit is contained in:
依瑪貓 2020-07-20 22:36:14 +08:00
parent 434b109a75
commit d2ea9ff279

View File

@ -154,7 +154,6 @@ First written: 2020/7/1
</div> </div>
{# The list for small screens #} {# The list for small screens #}
{% comment %}
<div class="d-sm-none report-block report-block-sm"> <div class="d-sm-none report-block report-block-sm">
<div class="row justify-content-center"> <div class="row justify-content-center">
<h2>{{ title }}</h2> <h2>{{ title }}</h2>
@ -163,46 +162,62 @@ First written: 2020/7/1
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<ul class="list-group income-statement-list"> <ul class="list-group income-statement-list">
{% for item in item_list %} {% for section in item_list %}
<li class="list-group-item d-flex justify-content-between align-items-center <%=$record->class%>"> <li class="list-group-item d-flex justify-content-between align-items-center first-level-header">
% if (!defined $record->class && defined $record->subject->code) { {{ section.title|title|escape }}
<a class="list-group-item-action" href="<%=url_for("acct.ledger", {"subject_code" => $record->subject->code})%>"> </li>
<%=$record->subject->title%> {% if section.groups %}
{% for group in section.groups %}
<li class="list-group-item d-flex justify-content-between align-items-center second-level-header">
{{ group.title|title|escape }}
</li>
{% for item in group.details %}
<li class="list-group-item d-flex justify-content-between align-items-center subject">
<a class="list-group-item-action" href="{% url "accounting:ledger" item.code period.spec %}">
{{ item.title|title|escape }}
<div class="float-right"> <div class="float-right">
% if (defined $record->amount) { <span class="badge {% if item.balance < 0 %} badge-warning {% else %} badge-secondary {% endif %} badge-pill">
<span class="badge <%=$record->amount < 0? "badge-warning": "badge-secondary"%> badge-pill"> {{ item.balance|accounting_amount }}
<%=format_amount($record->amount)%>
</span> </span>
% }
% if (defined $record->total) {
<span class="badge <%=$record->total < 0? "badge-danger": "badge-info"%> badge-pill">
<%=format_amount($record->total)%>
</span>
% }
</div> </div>
</a> </a>
% } else {
<%=$record->subject->title%>
<div class="float-right">
% if (defined $record->amount) {
<span class="badge <%=$record->amount < 0? "badge-warning": "badge-secondary"%> badge-pill">
<%=format_amount($record->amount)%>
</span>
% }
% if (defined $record->total) {
<span class="badge <%=$record->total < 0? "badge-danger": "badge-info"%> badge-pill">
<%=format_amount($record->total)%>
</span>
% }
</div>
% }
</li> </li>
{% endfor %} {% endfor %}
<li class="list-group-item d-flex justify-content-between align-items-center total">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}
<div class="float-right">
<span class="badge {% if group.total < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
{{ group.total|accounting_amount }}
</span>
</div>
</li>
{% endfor %}
{% else %}
<li class="list-group-item d-flex justify-content-between align-items-center total">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}
<div class="float-right">
<span class="badge {% if group.total < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">-</span>
</div>
</li>
{% endif %}
{% if section.cumulative_total is not None %}
<li class="list-group-item d-flex justify-content-between align-items-center cum-total">
{{ section.cumulative_total.title|title|escape }}
<div class="float-right">
<span class="badge {% if section.cumulative_total.total < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
{{ section.cumulative_total.total|accounting_amount }}
</span>
</div>
</li>
{% endif %}
{% if section.has_next %}
<li class="list-group-item d-flex justify-content-between align-items-center"></li>
{% endif %}
{% endfor %}
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
{% endcomment %}
{% else %} {% else %}
<p>{{ _("There is currently no data.")|force_escape }}</p> <p>{{ _("There is currently no data.")|force_escape }}</p>
{% endif %} {% endif %}