{#
The Mia! Accounting Project
recurring-item-editor-modal.html: The modal of the recurring item editor

 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
#}
<form id="accounting-recurring-item-editor-{{ expense_income }}">
  <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
  <div id="accounting-recurring-item-editor-{{ expense_income }}-modal" class="modal fade" tabindex="-1" aria-labelledby="accounting-recurring-item-editor-{{ expense_income }}-modal-label" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h1 class="modal-title fs-5" id="accounting-recurring-item-editor-{{ expense_income }}-modal-label">{{ title }}</h1>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ A_("Close") }}"></button>
        </div>
        <div class="modal-body">
          <div class="form-floating mb-3">
            <input id="accounting-recurring-item-editor-{{ expense_income }}-name" class="form-control" type="text" value="" placeholder=" " required="required">
            <label for="accounting-recurring-item-editor-{{ expense_income }}-name">{{ A_("Name") }}</label>
            <div id="accounting-recurring-item-editor-{{ expense_income }}-name-error" class="invalid-feedback"></div>
          </div>

          <div class="mb-3">
            <div id="accounting-recurring-item-editor-{{ expense_income }}-account-control" class="form-control accounting-clickable accounting-material-text-field" data-bs-toggle="modal" data-bs-target="#accounting-recurring-accounting-selector-{{ expense_income }}-modal">
              <label class="form-label" for="accounting-recurring-item-editor-{{ expense_income }}-account">{{ A_("Account") }}</label>
              <div id="accounting-recurring-item-editor-{{ expense_income }}-account"></div>
            </div>
            <div id="accounting-recurring-item-editor-{{ expense_income }}-account-error" class="invalid-feedback"></div>
          </div>

          <div class="form-floating mb-3">
            <input id="accounting-recurring-item-editor-{{ expense_income }}-description-template" class="form-control" type="text" value="" placeholder=" " required="required">
            <label for="accounting-recurring-item-editor-{{ expense_income }}-description-template">{{ A_("Description Template") }}</label>
            <div id="accounting-recurring-item-editor-{{ expense_income }}-description-template-error" class="invalid-feedback"></div>
          </div>

          <div class="mb-3 border-top accounting-recurring-description-template-illustration">
            <p>{{ A_("Available template variables:") }}</p>
            <ul>
              <li><code>{this_month_number}</code>: {{ A_("This month, as a number.") }}</li>
              <li><code>{this_month_name}</code>: {{ A_("This month, in its name.") }}</li>
              <li><code>{last_month_number}</code>: {{ A_("Last month, as a number.") }}</li>
              <li><code>{last_month_name}</code>: {{ A_("Last month, in its name.") }}</li>
              <li><code>{last_bimonthly_number}</code>: {{ A_("The previous bimonthly period, as numbers.") }}</li>
              <li><code>{last_bimonthly_name}</code>: {{ A_("The previous bimonthly period, as their names.") }}</li>
            </ul>
            <p>{{ A_("Example:") }} <code>{{ A_("Water bill for {last_bimonthly_name}") }}</code></p>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ A_("Cancel") }}</button>
          <button type="submit" class="btn btn-primary">{{ A_("Save") }}</button>
        </div>
      </div>
    </div>
  </div>
</form>
