Added the currency-chooser.html template to simplify the templates of the report.
This commit is contained in:
		| @@ -59,21 +59,7 @@ First written: 2023/3/7 | ||||
|   {% with report_chooser = report.report_chooser %} | ||||
|     {% include "accounting/report/include/report-chooser.html" %} | ||||
|   {% endwith %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-money-bill-wave"></i> | ||||
|       {{ report.currency.name|title }} | ||||
|     </button> | ||||
|     <ul class="dropdown-menu"> | ||||
|       {% for currency in report.currency_options %} | ||||
|         <li> | ||||
|           <a class="dropdown-item {% if currency.is_active %} active {% endif %}" href="{{ currency.url }}"> | ||||
|             {{ currency.title }} | ||||
|           </a> | ||||
|         </li> | ||||
|       {% endfor %} | ||||
|     </ul> | ||||
|   </div> | ||||
|   {% include "accounting/report/include/currency-chooser.html" %} | ||||
|   <button class="btn btn-primary" type="button" data-bs-toggle="modal" data-bs-target="#accounting-period-chooser-modal"> | ||||
|     <i class="fa-solid fa-calendar-day"></i> | ||||
|     {{ report.period.desc|title }} | ||||
| @@ -92,20 +78,7 @@ First written: 2023/3/7 | ||||
|   {% with report_chooser = report.report_chooser %} | ||||
|     {% include "accounting/report/include/report-chooser.html" %} | ||||
|   {% endwith %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-money-bill-wave"></i> | ||||
|     </button> | ||||
|     <ul class="dropdown-menu"> | ||||
|       {% for currency in report.currency_options %} | ||||
|         <li> | ||||
|           <a class="dropdown-item {% if currency.is_active %} active {% endif %}" href="{{ currency.url }}"> | ||||
|             {{ currency.title }} | ||||
|           </a> | ||||
|         </li> | ||||
|       {% endfor %} | ||||
|     </ul> | ||||
|   </div> | ||||
|   {% include "accounting/report/include/currency-chooser.html" %} | ||||
|   <button class="btn btn-primary" type="button" data-bs-toggle="modal" data-bs-target="#accounting-period-chooser-modal"> | ||||
|     <i class="fa-solid fa-calendar-day"></i> | ||||
|     {{ A_("Period") }} | ||||
|   | ||||
| @@ -0,0 +1,36 @@ | ||||
| {# | ||||
| The Mia! Accounting Flask Project | ||||
| currency-chooser.html: The currency chooser in the action buttons | ||||
|  | ||||
|  Copyright (c) 2023 imacat. | ||||
|  | ||||
|  Licensed under the Apache License, Version 2.0 (the "License"); | ||||
|  you may not use this file except in compliance with the License. | ||||
|  You may obtain a copy of the License at | ||||
|  | ||||
|      http://www.apache.org/licenses/LICENSE-2.0 | ||||
|  | ||||
|  Unless required by applicable law or agreed to in writing, software | ||||
|  distributed under the License is distributed on an "AS IS" BASIS, | ||||
|  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
|  See the License for the specific language governing permissions and | ||||
|  limitations under the License. | ||||
|  | ||||
| Author: imacat@mail.imacat.idv.tw (imacat) | ||||
| First written: 2023/3/8 | ||||
| #} | ||||
| <div class="btn-group"> | ||||
|   <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|     <i class="fa-solid fa-money-bill-wave"></i> | ||||
|     <span class="d-none d-md-inline">{{ report.currency.name|title }}</span> | ||||
|   </button> | ||||
|   <ul class="dropdown-menu"> | ||||
|     {% for currency in report.currency_options %} | ||||
|       <li> | ||||
|         <a class="dropdown-item {% if currency.is_active %} active {% endif %}" href="{{ currency.url }}"> | ||||
|           {{ currency.title }} | ||||
|         </a> | ||||
|       </li> | ||||
|     {% endfor %} | ||||
|   </ul> | ||||
| </div> | ||||
| @@ -60,21 +60,7 @@ First written: 2023/3/5 | ||||
|   {% with report_chooser = report.report_chooser %} | ||||
|     {% include "accounting/report/include/report-chooser.html" %} | ||||
|   {% endwith %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-money-bill-wave"></i> | ||||
|       {{ report.currency.name|title }} | ||||
|     </button> | ||||
|     <ul class="dropdown-menu"> | ||||
|       {% for currency in report.currency_options %} | ||||
|         <li> | ||||
|           <a class="dropdown-item {% if currency.is_active %} active {% endif %}" href="{{ currency.url }}"> | ||||
|             {{ currency.title }} | ||||
|           </a> | ||||
|         </li> | ||||
|       {% endfor %} | ||||
|     </ul> | ||||
|   </div> | ||||
|   {% include "accounting/report/include/currency-chooser.html" %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-clipboard"></i> | ||||
| @@ -108,20 +94,7 @@ First written: 2023/3/5 | ||||
|   {% with report_chooser = report.report_chooser %} | ||||
|     {% include "accounting/report/include/report-chooser.html" %} | ||||
|   {% endwith %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-money-bill-wave"></i> | ||||
|     </button> | ||||
|     <ul class="dropdown-menu"> | ||||
|       {% for currency in report.currency_options %} | ||||
|         <li> | ||||
|           <a class="dropdown-item {% if currency.is_active %} active {% endif %}" href="{{ currency.url }}"> | ||||
|             {{ currency.title }} | ||||
|           </a> | ||||
|         </li> | ||||
|       {% endfor %} | ||||
|     </ul> | ||||
|   </div> | ||||
|   {% include "accounting/report/include/currency-chooser.html" %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-clipboard"></i> | ||||
|   | ||||
| @@ -59,21 +59,7 @@ First written: 2023/3/7 | ||||
|   {% with report_chooser = report.report_chooser %} | ||||
|     {% include "accounting/report/include/report-chooser.html" %} | ||||
|   {% endwith %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-money-bill-wave"></i> | ||||
|       {{ report.currency.name|title }} | ||||
|     </button> | ||||
|     <ul class="dropdown-menu"> | ||||
|       {% for currency in report.currency_options %} | ||||
|         <li> | ||||
|           <a class="dropdown-item {% if currency.is_active %} active {% endif %}" href="{{ currency.url }}"> | ||||
|             {{ currency.title }} | ||||
|           </a> | ||||
|         </li> | ||||
|       {% endfor %} | ||||
|     </ul> | ||||
|   </div> | ||||
|   {% include "accounting/report/include/currency-chooser.html" %} | ||||
|   <button class="btn btn-primary" type="button" data-bs-toggle="modal" data-bs-target="#accounting-period-chooser-modal"> | ||||
|     <i class="fa-solid fa-calendar-day"></i> | ||||
|     {{ report.period.desc|title }} | ||||
| @@ -92,20 +78,7 @@ First written: 2023/3/7 | ||||
|   {% with report_chooser = report.report_chooser %} | ||||
|     {% include "accounting/report/include/report-chooser.html" %} | ||||
|   {% endwith %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-money-bill-wave"></i> | ||||
|     </button> | ||||
|     <ul class="dropdown-menu"> | ||||
|       {% for currency in report.currency_options %} | ||||
|         <li> | ||||
|           <a class="dropdown-item {% if currency.is_active %} active {% endif %}" href="{{ currency.url }}"> | ||||
|             {{ currency.title }} | ||||
|           </a> | ||||
|         </li> | ||||
|       {% endfor %} | ||||
|     </ul> | ||||
|   </div> | ||||
|   {% include "accounting/report/include/currency-chooser.html" %} | ||||
|   <button class="btn btn-primary" type="button" data-bs-toggle="modal" data-bs-target="#accounting-period-chooser-modal"> | ||||
|     <i class="fa-solid fa-calendar-day"></i> | ||||
|     {{ A_("Period") }} | ||||
|   | ||||
| @@ -60,21 +60,7 @@ First written: 2023/3/5 | ||||
|   {% with report_chooser = report.report_chooser %} | ||||
|     {% include "accounting/report/include/report-chooser.html" %} | ||||
|   {% endwith %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-money-bill-wave"></i> | ||||
|       {{ report.currency.name|title }} | ||||
|     </button> | ||||
|     <ul class="dropdown-menu"> | ||||
|       {% for currency in report.currency_options %} | ||||
|         <li> | ||||
|           <a class="dropdown-item {% if currency.is_active %} active {% endif %}" href="{{ currency.url }}"> | ||||
|             {{ currency.title }} | ||||
|           </a> | ||||
|         </li> | ||||
|       {% endfor %} | ||||
|     </ul> | ||||
|   </div> | ||||
|   {% include "accounting/report/include/currency-chooser.html" %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-clipboard"></i> | ||||
| @@ -108,20 +94,7 @@ First written: 2023/3/5 | ||||
|   {% with report_chooser = report.report_chooser %} | ||||
|     {% include "accounting/report/include/report-chooser.html" %} | ||||
|   {% endwith %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-money-bill-wave"></i> | ||||
|     </button> | ||||
|     <ul class="dropdown-menu"> | ||||
|       {% for currency in report.currency_options %} | ||||
|         <li> | ||||
|           <a class="dropdown-item {% if currency.is_active %} active {% endif %}" href="{{ currency.url }}"> | ||||
|             {{ currency.title }} | ||||
|           </a> | ||||
|         </li> | ||||
|       {% endfor %} | ||||
|     </ul> | ||||
|   </div> | ||||
|   {% include "accounting/report/include/currency-chooser.html" %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-clipboard"></i> | ||||
|   | ||||
| @@ -59,21 +59,7 @@ First written: 2023/3/5 | ||||
|   {% with report_chooser = report.report_chooser %} | ||||
|     {% include "accounting/report/include/report-chooser.html" %} | ||||
|   {% endwith %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-money-bill-wave"></i> | ||||
|       {{ report.currency.name|title }} | ||||
|     </button> | ||||
|     <ul class="dropdown-menu"> | ||||
|       {% for currency in report.currency_options %} | ||||
|         <li> | ||||
|           <a class="dropdown-item {% if currency.is_active %} active {% endif %}" href="{{ currency.url }}"> | ||||
|             {{ currency.title }} | ||||
|           </a> | ||||
|         </li> | ||||
|       {% endfor %} | ||||
|     </ul> | ||||
|   </div> | ||||
|   {% include "accounting/report/include/currency-chooser.html" %} | ||||
|   <button class="btn btn-primary" type="button" data-bs-toggle="modal" data-bs-target="#accounting-period-chooser-modal"> | ||||
|     <i class="fa-solid fa-calendar-day"></i> | ||||
|     {{ report.period.desc|title }} | ||||
| @@ -92,20 +78,7 @@ First written: 2023/3/5 | ||||
|   {% with report_chooser = report.report_chooser %} | ||||
|     {% include "accounting/report/include/report-chooser.html" %} | ||||
|   {% endwith %} | ||||
|   <div class="btn-group"> | ||||
|     <button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> | ||||
|       <i class="fa-solid fa-money-bill-wave"></i> | ||||
|     </button> | ||||
|     <ul class="dropdown-menu"> | ||||
|       {% for currency in report.currency_options %} | ||||
|         <li> | ||||
|           <a class="dropdown-item {% if currency.is_active %} active {% endif %}" href="{{ currency.url }}"> | ||||
|             {{ currency.title }} | ||||
|           </a> | ||||
|         </li> | ||||
|       {% endfor %} | ||||
|     </ul> | ||||
|   </div> | ||||
|   {% include "accounting/report/include/currency-chooser.html" %} | ||||
|   <button class="btn btn-primary" type="button" data-bs-toggle="modal" data-bs-target="#accounting-period-chooser-modal"> | ||||
|     <i class="fa-solid fa-calendar-day"></i> | ||||
|     {{ A_("Period") }} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user