{% extends 'vacancy_mgr/base.html' %}
{% load static %}
{% load humanize %}

    {% block head_title %}駐車場 {{ data.garagea_name }} {{ data.building.building_name }} {% endblock %}
    {% block head %}
        <link rel="stylesheet" href="{% static 'property/css/style.css' %}">
        <link rel="stylesheet" href="{% static 'property/css/style_ids.css' %}">
    {% endblock %}

    {% block page_top %}{% endblock %}

    {% block header %}{% endblock %}

    {% block h1_title %}【駐車場】{{ data.building.building_name }}{% endblock %}

    {% block contents %}
        <div id="data-form">
        {% if back_url %}
            <form action="{% url 'property_edit_building_garage'  data.building.oid data.id %}?back_url={{ escaped_back_url }}" method="post" enctype="multipart/form-data">
        {% else %}
            <form action="{% url 'property_edit_building_garage'  data.building.oid data.id %}" method="post" enctype="multipart/form-data">
        {% endif %}
                {% csrf_token %}
                {% if form.errors %}
                    {% for field in form %}
                        {% for error in field.errors %}
                            <p>*&nbsp;{{ field.label }} : {{ error }}</p>
                        {% endfor %}
                     {% endfor %}
                {% endif %}
                <div class="form-group row">
                    <div class="col-2 col-form-label"><label class="float-right">駐車場名:</label></div>
                    <div class="col-10">{{ form.garage_name }}</div>
                </div>
                <div class="form-group row">
                    <div class="col-2 col-form-label"><label class="float-right">空き状況:</label></div>
                    <div class="col-3">{{ form.garage_status }}</div>
                    <div class="col-2">{{ form.allow_no_room }} 外部貸し可</div>
                    <div class="col-5"></div>
                </div>
                <div class="form-group row">
                    <div class="col col-2 col-form-label text-right"><label>優先順:</label></div>
                    <div class="col col-10 form-inline">{{ form.priority }}</div>
                </div>
                <div class="form-group row">
                    <div class="col col-2 col-form-label text-right"><label>月額:</label></div>
                    <div class="col col-10 form-inline">
                        {{ form.garage_fee }}&nbsp;円
                        <label>税区分:</label>{{ form.garage_fee_tax_type }}
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col col-2 col-form-label text-right"><label>手数料:</label></div>
                    <div class="col col-10 form-inline">
                        {{ form.garage_charge }}&nbsp;円
                        <label>税区分:</label>{{ form.garage_charge_tax_type }}
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col col-2 col-form-label text-right"><label>保証料:</label></div>
                    <div class="col col-10 form-inline">
                        {{ form.garage_deposit }}&nbsp;円
                        <label>税区分:</label>{{ form.garage_deposit_tax_type }}
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col col-2 col-form-label text-right"><label>車庫証明費用:</label></div>
                    <div class="col col-10 form-inline">
                        {{ form.certification_fee }}&nbsp;円
                        <label>税区分:</label>{{ form.certification_fee_tax_type }}
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col col-2 col-form-label text-right"><label>初期費用1:</label></div>
                    <div class="col col-10 form-inline">
                        <label>費用名:</label>{{ form.initial_cost_name1 }}
                        <label>金額:</label>{{ form.initial_cost1 }}&nbsp;円
                        <label>税区分:</label>{{ form.initial_cost_tax_type1 }}
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col col-2 col-form-label text-right"><label>初期費用2:</label></div>
                    <div class="col col-10 form-inline">
                        <label>費用名:</label>{{ form.initial_cost_name2 }}
                        <label>金額:</label>{{ form.initial_cost2 }}&nbsp;円
                        <label>税区分:</label>{{ form.initial_cost_tax_type2 }}
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col col-2 col-form-label text-right"><label>初期費用3:</label></div>
                    <div class="col col-10 form-inline">
                        <label>費用名:</label>{{ form.initial_cost_name3 }}
                        <label>金額:</label>{{ form.initial_cost3 }}&nbsp;円
                        <label>税区分:</label>{{ form.initial_cost_tax_type3 }}
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col col-2 col-form-label text-right"><label>サイズ:</label></div>
                    <div class="col col-10 form-inline">
                        <label>幅:</label>{{ form.width }}&nbsp;m
                        <label>奥行き:</label>{{ form.length }}&nbsp;m
                        <label>高さ:</label>{{ form.height }}&nbsp;m
                    </div>
                </div>
                <div class="form-group row">
                    <div class="col col-2 col-form-label text-right"><label>コメント:</label></div>
                    <div class="col col-10 form-inline">{{ form.comment }}</div>
                </div>
                <div class="form-group row">
                    <div class="col col-2 col-form-label text-right"><label>備考:</label></div>
                    <div class="col col-10 form-inline">{{ form.note }}</div>
                </div>

                <div class="form-group row">
                    <div class="col-2"></div>
                    <div class="col-4">
                        <input type="submit" value="保存" class="btn d-block mx-auto d-flex align-items-center btn-primary">
                    </div>
                    <div class="col-4">
                    {% if back_url %}
                        <a href="{{ back_url }}" class="btn btn-secondary">戻る</a>
                    {% else %}
                        <a href="{% url 'property_building' data.building.oid %}?page=garage_page#garage-list-anchor" class="btn btn-secondary">戻る</a>
                    {% endif %}
                    </div>
                    <div class="col-2"></div>
                </div>
            </form>
        </form>
    {% endblock %}

    {% block footer %}{% endblock %}

    {% block page_bottom %}{% endblock %}
