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

    {% block head_title %}書類ファイル一覧{% endblock %}
    {% block head %}
        <link rel="stylesheet" href="{% static 'documents/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 'documents_upload_document_file' %}">ファイル追加</a>
                </div>
            </div>
        </div>
        <div id="data-list">
        {% if document_files %}
            <div class="row">
                <div class="col col-3 col-lg-3 text-center"><label>タイトル</label></div>
                <div class="col col-3 col-lg-3 text-center"><label>コメント</label></div>
                <div class="col col-2 col-lg-1 text-center"><label>優先順</label></div>
                <div class="col col-1 col-lg-1 text-center">空室情報</div>
                <div class="col col-1 col-lg-1 text-center">WEB</div>
                <div class="col col-2 col-lg-3 text-center"></div>
            </div>
            {% for item in document_files %}
            <div class="row">
                <div class="col col-3 col-lg-3 col-form-label text-center">{{ item.file_title | default_if_none:'' }}</div>
                <div class="col col-3 col-lg-3 col-form-label text-center">{{ item.comment | default_if_none:'' }}</div>
                <div class="col col-2 col-lg-1 col-form-label text-center">{{ item.priority }}</div>
                <div class="col col-1 col-lg-1 text-center">{% if item.is_publish_vacancy %}〇公開{% endif %}</div>
                <div class="col col-1 col-lg-1 text-center">{% if item.is_publish_web %}〇公開{% endif %}</div>
                <div class="col col-2 col-lg-3">
                    <a href="{% url 'documents_edit_document_file' item.idb64 %}?back_url={% url 'documents_index' %}" class="btn btn-sm btn-outline-primary">編集</a>
                    <a href="{% url 'documents_delete_document_file' item.idb64 %}?back_url={% url 'documents_index' %}" 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 %}
