{% 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-list-header">
            <div class="row">
                <div id="link-add-item" class="col col-6 text-left">
                    <a href="{% url 'info_create_management_info' %}">お知らせ追加</a>
                </div>
            </div>
        </div>
        <div id="data-list">
        {% if infos %}
            <div class="row">
                <div class="col col-2 text-center"><label>公開日<br>終了日</label></div>
                <div class="col col-5 text-center"><label>内容</label></div>
                <div class="col col-2 text-center"><label>優先順</label></div>
                <div class="col col-1 text-center">強調</div>
                <div class="col col-2  text-center"></div>
            </div>
            {% for item in infos %}
            <div class="row">
                <div class="col col-2 col-form-label text-center">
                    {{ item.start_date | default_if_none:'-----------' }}<br>
                    {{ item.end_date | default_if_none:'-----------' }}
                </div>
                <div class="col col-5 col-form-label">{{ item.information | default_if_none:'' | linebreaksbr }}</div>
                <div class="col col-2 col-form-label text-center">{{ item.priority }}</div>
                <div class="col col-1 text-center">{% if item.is_emphasized %}〇{% endif %}</div>
                <div class="col col-2">
                    <a href="{% url 'info_edit_management_info' item.idb64 %}?back_url={% url 'info_management_info_list' %}" class="btn btn-sm btn-outline-primary">編集</a>
                    <a href="{% url 'info_delete_management_info' item.idb64 %}?back_url={% url 'info_management_info_list' %}" class="btn btn-sm btn-outline-danger">削除</a>
                </div>
            </div>
            {% endfor %}
        {% else %}
            <div class="row">
                <div class="col col-12 text-center">該当するお知らせはありません。</div>
            </div>
        {% endif %}
        </div>
    {% endblock %}

    {% block footer %}{% endblock %}

    {% block page_bottom %}{% endblock %}
