{% extends "jocondelab/front_base.html" %}
{% load i18n %}
{% load jlutils %}

{% block js_import %}
    {{block.super}}
    <script type="text/javascript" src="{{STATIC_URL}}jocondelab/lib/jquery.magnific-popup.min.js"></script>
{% endblock %}

{% block js_declaration %}
    {{block.super}}
    <script type="text/javascript">
        var notice_id = "{{object.id}}",
            csrf_token = "{{csrf_token}}";
        urls.ajax_contribute = "{% url 'ajax_contribute' %}";
        urls.upvote = "{% url 'ajax_upvote' %}";
        urls.downvote = "{% url 'ajax_downvote' %}";
        urls.wikipedia = {{wikipedia_urls|safe}};
    </script>
    <script type="text/javascript" src="{{STATIC_URL}}jocondelab/js/front-notice.js"></script>
{% endblock %}

{% block css_import %}
    {{block.super}}
    <link rel="stylesheet" href="{{STATIC_URL}}jocondelab/lib/magnific-popup.css" type="text/css" />
{% endblock %}

{% block css_declaration %}
    {{block.super}}
    <link rel="stylesheet" href="{{STATIC_URL}}jocondelab/css/front-notice.css" type="text/css" />
{% endblock %}

{% block title %}JocondeLab &raquo; {% trans "Détail d'une notice" %}{% endblock %}

{% block breadcrumbs %}<a href="{% url 'front_notice' object.id %}">{% trans "Détail d'une notice" %}</a>{% endblock %}

{% block main %}
            <div class="notice-colright-wrapper">
                <div class="notice-colright">
                    <table class="notice-datasheet">
                    {% if object.autr %}
                        <tr class="datasheet-title">
                            <th>{% trans 'Auteur(s)&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'AUTR' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.ecol %}
                        <tr>
                            <th>{% trans 'École&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'ECOL' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.domn %}
                        <tr>
                            <th>{% trans 'Domaine(s)&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'DOMN' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.titr or object.deno or object.appl %}
                        <tr class="datasheet-title">
                            <th>{% trans 'Désignation&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'TITR' %}{% show_datasheet_row 'APPL' %}{% show_datasheet_row 'DENO' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.repr or object.srep %}
                        <tr>
                            <th>{% trans 'Sujet représenté&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'REPR' %}{% show_datasheet_row 'SREP' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.peri or object.mill or object.epoq %}
                        <tr>
                            <th>{% trans 'Datation&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'PERI' %}{% show_datasheet_row 'MILL' %}{% show_datasheet_row 'EPOQ' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.tech %}
                        <tr>
                            <th>{% trans 'Matériaux / Techniques&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'TECH' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.tech %}
                        <tr>
                            <th>{% trans 'Mesures&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'DIMS' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.lieux or object.decv %}
                        <tr>
                            <th>{% trans 'Provenance&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'LIEUX' %}{% show_datasheet_row 'DECV' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.hist %}
                        <tr>
                            <th>{% trans 'Historique&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'HIST' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.loca %}
                        <tr>
                            <th>{% trans 'Lieu de conservation&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'LOCA' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.copy %}
                        <tr class="notice-small">
                            <th>{% trans 'Copyright notice&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'COPY' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.phot %}
                        <tr class="notice-small">
                            <th>{% trans 'Crédits photographiques&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'PHOT' %}</td>
                        </tr>
                    {% endif %}
                    </table>

                    <p class="notice-jocondelink">
                        <a href="{{JOCONDE_NOTICE_BASE_URL}}{{ notice.ref }}" target="_blank">{% trans 'Visiter sur le portail Joconde' %}</a>
                    </p>

{% block contribution %}
                    <form class="contribution-frame folksonomy-frame">
                        <h2>{% trans 'Contribution (Folksonomie)' %}</h2>
                        <input class="notice-contribution-field" type="text" size="60" placeholder="{% trans 'Complétez les mots-clés de la fiche' %}" />
                        <ul class="notice-term-list notice-contribution-list">
                        {% for term in contributions %}
                            {% include "jocondelab/partial/contributed_item.html" %}
                        {% endfor %}
                        </ul>
                    </form>
{% endblock %}

                </div>
            </div>
            <ul class="notice-images">
                {% for img in images %}
                <li>
                    <a href="{{img}}" title="{{title}}">
                        <img src="{{img}}" />
                    </a>
                </li>
                {% endfor %}
            </ul>
{% endblock %}
