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

    {% block head_title %}管理お知らせ情報{% endblock %}
    {% block head %}
        <link rel="stylesheet" href="{% static 'info/css/style.css' %}">
    {% endblock %}

    {% block page_top %}{% endblock %}

    {% block header %}{% endblock %}

    {% block h1_title %}【管理お知らせ情報】{% endblock %}

    {% block contents %}
        <div id="data-form">
        {% if back_url %}
            <form action="{% url 'info_edit_management_info' info.idb64 %}?back_url={{ escaped_back_url }}" method="post" enctype="multipart/form-data">
        {% else %}
            <form action="{% url 'info_edit_management_info' info.idb64 %}" 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 col-3 col-md-2 col-form-label"><label class="float-right">管理お知らせID</label></div>
                    <div class="col col-9 col-md-10 col-form-label">{{ info.id }}</div>
                </div>
                <div class="form-group row">
                    <div class="col col-3 col-md-2 col-form-label"><label class="float-right">お知らせ内容</label></div>
                    <div class="col col-9 col-md-10">{{ form.information }}</div>
                </div>
                <div class="form-group row">
                    <div class="col col-3 col-md-2 col-form-label text-right"><label>優先順:</label></div>
                    <div class="col col-9 col-md-10 form-inline">{{ form.priority }}</div>
                </div>
                <div class="form-group row">
                    <div class="col-2 col-form-label"><label class="float-right">公開日</label></div>
                    <div class="col-10">{{ form.start_date }}</div>
                </div>
                <div class="form-group row">
                    <div class="col-2 col-form-label"><label class="float-right">終了日</label></div>
                    <div class="col-10">{{ form.end_date }}</div>
                </div>
                <div class="form-group row">
                    <div class="col col-3 col-md-2 col-form-label text-right"><label>リンクURL:</label></div>
                    <div class="col col-9 col-md-10 form-inline">{{ form.link_url }}</div>
                </div>
                <div class="form-group row">
                    <div class="col col-3 col-md-2 col-form-label"><label class="float-right">強調</label></div>
                    <div class="col col-3 col-md-2 col-form-label text-center">{{ form.is_emphasized }}<label class="form-check-label">{{form.is_emphasized.label}}</label></div>
                    <div class="col col-6 col-md-8"></div>
                </div>
                <div class="form-group row">
                    <div class="col col-3 col-md-2 col-form-label"><label class="float-right">登録情報</label></div>
                    <div class="col col-9 col-md-10 col-form-label">
                        <div>
                            <label>登録日時:</label>{{ info.created_at }}
                            <label>登録ユーザ:</label>{{ info.created_user }}
                        </div>
                        <div>
                            <label>更新日時:</label>{{ info.updated_at }}
                            <label>更新ユーザ:</label>{{ info.updated_user }}
                        </div>
                    </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 %}
                        <input type="button" value="閉じる" onclick="window.close();" class="btn d-block mx-auto d-flex align-items-center btn-secondary">
                    {% endif %}
                    </div>
                    <div class="col-2"></div>
                </div>
            </form>
        </div>
    {% endblock %}

    {% block footer %}{% endblock %}

    {% block page_bottom %}{% endblock %}
