From 8819eabcd084db4c13d44b4f55ac8bb880c7f2c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Thu, 9 Mar 2023 14:14:47 +0800 Subject: [PATCH] Replaced the separated toolbar for the desktop and mobile screen with the accounting-toolbar class that acts differently on different screen sizes. --- src/accounting/static/css/style.css | 70 ++++++++---- .../accounting/report/balance-sheet.html | 14 +-- .../report/include/toolbar-buttons.html | 100 +++++++++--------- .../accounting/report/income-expenses.html | 15 +-- .../accounting/report/income-statement.html | 14 +-- .../templates/accounting/report/journal.html | 13 +-- .../templates/accounting/report/ledger.html | 15 +-- .../templates/accounting/report/search.html | 17 +-- .../accounting/report/trial-balance.html | 14 +-- 9 files changed, 111 insertions(+), 161 deletions(-) diff --git a/src/accounting/static/css/style.css b/src/accounting/static/css/style.css index 9d44089..caf7d6c 100644 --- a/src/accounting/static/css/style.css +++ b/src/accounting/static/css/style.css @@ -29,7 +29,6 @@ } .btn-group .btn .accounting-search-input { min-height: calc(1em + .5rem + 2px); - padding: 0 0.5rem; } .btn-group .btn .accounting-search-label button { border: none; @@ -45,30 +44,59 @@ background-color: #D3D3D4; } -/** The toolbar for the mobile devices */ -.accounting-mobile-toolbar { +/** The toolbar */ +.accounting-toolbar { display: flex; } -.accounting-mobile-toolbar .accounting-toolbar-button { - height: 3.2rem; - width: 3.2rem; - border-radius: 50%; - margin-left: 1rem; -} -.accounting-mobile-toolbar > a.accounting-toolbar-button { - padding-top: 0.7rem; -} -.accounting-search-mobile-form { - width: 12rem; - margin-left: 1rem; - height: 2.8rem; - align-items: center; - margin-top: 0.3rem; -} -.accounting-search-mobile-form button { +.accounting-toolbar .input-group > .input-group-text { + padding: 0; background-color: transparent; - border: 0; color: inherit; + border: 0; +} +.accounting-toolbar .input-group > .input-group-text > button { + background-color: transparent; + color: inherit; + border: 0; +} +.accounting-toolbar form.btn > .form-control { + min-height: calc(1.5em + 2px); + padding-top: 0.1rem; + padding-bottom: 0.1rem; +} +@media(min-width: 768px) { + .accounting-toolbar > .btn, .accounting-toolbar > .btn-group > .btn { + border-radius: 0; + } + .accounting-toolbar > .btn:first-child, .accounting-toolbar > .btn-group:first-child > .btn { + border-top-left-radius: 0.375rem; + border-bottom-left-radius: 0.375rem; + } + .accounting-toolbar > .btn:last-child, .accounting-toolbar > .btn-group:last-child > .btn { + border-top-right-radius: 0.375rem; + border-bottom-right-radius: 0.375rem; + } + .accounting-toolbar .btn.input-group { + width: 16rem; + } +} +@media(max-width:767px) { + .accounting-toolbar > .btn:not(form), .accounting-toolbar > .btn-group > .btn { + height: 3.2rem; + width: 3.2rem; + border-radius: 50%; + margin-left: 1rem; + } + .accounting-toolbar > a.btn, .accounting-toolbar > .btn-group > a.btn { + padding-top: 0.7rem; + } + .accounting-toolbar > form.btn { + width: 12rem; + height: 2.6rem; + border-radius: 0.375rem; + margin-top: 0.3rem; + margin-left: 1rem; + } } /** The card layout */ diff --git a/src/accounting/templates/accounting/report/balance-sheet.html b/src/accounting/templates/accounting/report/balance-sheet.html index 1e5f4eb..245d098 100644 --- a/src/accounting/templates/accounting/report/balance-sheet.html +++ b/src/accounting/templates/accounting/report/balance-sheet.html @@ -30,10 +30,8 @@ First written: 2023/3/7 {% block content %} -
- {% with use_add_new = true, - use_report_chooser = true, - use_currency_chooser = true, +
+ {% with use_currency_chooser = true, use_period_chooser = true %} {% include "accounting/report/include/toolbar-buttons.html" %} {% endwith %} @@ -41,14 +39,6 @@ First written: 2023/3/7 {% include "accounting/report/include/add-txn-material-fab.html" %} -
- {% with use_report_chooser = true, - use_currency_chooser = true, - use_period_chooser = true %} - {% include "accounting/report/include/toolbar-buttons.html" %} - {% endwith %} -
- {% include "accounting/report/include/period-chooser.html" %} {% include "accounting/report/include/search-modal.html" %} diff --git a/src/accounting/templates/accounting/report/include/toolbar-buttons.html b/src/accounting/templates/accounting/report/include/toolbar-buttons.html index 3e5d4b1..94bed9a 100644 --- a/src/accounting/templates/accounting/report/include/toolbar-buttons.html +++ b/src/accounting/templates/accounting/report/include/toolbar-buttons.html @@ -19,60 +19,56 @@ toolbar-buttons.html: The toolbar buttons on the report Author: imacat@mail.imacat.idv.tw (imacat) First written: 2023/3/8 #} -{% if use_add_new %} - {% if accounting_can_edit() %} - - {% endif %} -{% endif %} -{% if use_report_chooser %} -
- -
{% endif %} +
+ + +
{% if use_currency_chooser %}
- @@ -89,7 +85,7 @@ First written: 2023/3/8 {% endif %} {% if use_account_chooser %}
- @@ -105,19 +101,19 @@ First written: 2023/3/8
{% endif %} {% if use_period_chooser %} - {% endif %} - + {{ A_("Download") }} {% if use_search %} -