{% 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 %}{% trans "Détail d'une notice" %}{% endblock %}

{% block main %}
            <div class="notice-colright-wrapper">
                <div class="notice-colright">
    {% block datasheet %}
                    <table class="notice-datasheet">
                    {% if object.autr %}
                        <tr class="datasheet-title">
                            <th>{% trans 'Artiste(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 %}
            {% block datasheet_title %}
                    {% if object.titr %}
                        <tr class="datasheet-title">
                            <th>{% trans 'Titre&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'TITR' %}</td>
                        </tr>
                    {% endif %}
            {% endblock %}
                    {% if object.domn %}
                        <tr>
                            <th>{% trans 'Domaine(s)&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'DOMN' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.deno or object.appl %}
                        <tr>
                            <th>{% trans 'Désignation&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'DENO' isbold=True %}{% show_datasheet_row 'APPL' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.repr %}
                        <tr>
                            <th>{% trans 'Sujet représenté&nbsp;:' %}</th>
                            <td>{% show_datasheet_row 'REPR' %}</td>
                        </tr>
                    {% endif %}
                    {% if object.srep %}
                        <tr>
                            <th>{% trans 'Source&nbsp;:' %}</th>
                            <td>{% 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 '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 'Conservé à&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 'Cette œuvre sur le portail Joconde' %}</a>
                    </p>
    {% endblock %}

    {% block contribution %}
                    <form class="contribution-frame folksonomy-frame">
                        <h2>{% trans "Ajoutez vos mots-clés" %}</h2>
                        <p>{% trans "Les termes proposés proviennent de Wikipédia." %}</p>
                        <input class="notice-contribution-field" type="text" size="60" />
                        <ul class="notice-term-list notice-contribution-list">
                        {% for term in contributions %}
                            {% include "jocondelab/partial/contributed_item.html" %}
                        {% endfor %}
                        </ul>
                    </form>
    {% endblock %}

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