{#
The Mia! Accounting Project
detail.html: The option detail

 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/22
#}
{% extends "accounting/base.html" %}

{% block header %}{% block title %}{{ A_("Settings") }}{% endblock %}{% endblock %}

{% block content %}

<div class="mb-3 accounting-toolbar">
  <a class="btn btn-primary d-none d-md-inline" role="button" href="{{ url_for("accounting.option.edit")|accounting_inherit_next }}">
    <i class="fa-solid fa-pen-to-square"></i>
    {{ A_("Edit") }}
  </a>
</div>

<div class="d-md-none accounting-material-fab">
  <a class="btn btn-primary" role="button" href="{{ url_for("accounting.option.edit")|accounting_inherit_next }}">
    <i class="fa-solid fa-pen-to-square"></i>
  </a>
</div>

<table class="table table-striped table-hover table-light" aria-label="{{ A_("Settings") }}">
<tbody>
<tr>
  <th scope="row">{{ A_("Default Currency") }}</th>
  <td>{{ obj.default_currency }}</td>
</tr>
<tr>
  <th scope="row">{{ A_("Default Account for the Income and Expenses Log") }}</th>
  <td>{{ obj.default_ie_account }}</td>
</tr>
</tbody>
</table>

<h2>{{ A_("Recurring Expense") }}</h2>

{% if obj.recurring.expenses %}
  <ul class="list-group mb-3 accounting-list-group-stripped accounting-list-group-hover">
    {% for recurring_item in obj.recurring.expenses %}
      <li class="list-group-item">
        <div class="small">{{ recurring_item.account_text }}</div>
        <div>{{ recurring_item.name }}</div>
        <div class="small">{{ recurring_item.description_template }}</div>
      </li>
    {% endfor %}
  </ul>
{% else %}
  <p>{{ A_("There is no data.") }}</p>
{% endif %}

<h2>{{ A_("Recurring Income") }}</h2>

{% if obj.recurring.incomes %}
  <ul class="list-group mb-3 accounting-list-group-stripped accounting-list-group-hover">
    {% for recurring_item in obj.recurring.incomes %}
      <li class="list-group-item">
        <div class="small">{{ recurring_item.account_text }}</div>
        <div>{{ recurring_item.name }}</div>
        <div class="small">{{ recurring_item.description_template }}</div>
      </li>
    {% endfor %}
  </ul>
{% else %}
  <p>{{ A_("There is no data.") }}</p>
{% endif %}

{% endblock %}
