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

{% block js_declaration %}
    {{block.super}}
    <script type="text/javascript" src="{{STATIC_URL}}jocondelab/js/front-search.js"></script>
{% endblock %}

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

{% block title %}JocondeLab &raquo; {% trans 'Multilingual search' %}{% endblock %}

{% block breadcrumbs %}<a href="{% url 'multilingual_search' %}">{% trans 'Multilingual search' %}</a>{% endblock %}

{% block header_search %}{% endblock %}

{% block main %}

            <form class="big-search-form">
                <input class="big-search-input" type="search" name="q" value="{{queryterms}}" />
            </form>
            
            <ul class="term-cloud">
                {% for word in words %}
                    <li style="font-size: {{word.font_size|unlocalize}}em">
                        <a href="{% url 'multilingual_search' %}?q={{word.label|urlencode}}" data-dbpedia-uri="{{word.uri}}">{{word.label}} <span class="term-frequency">({{word.notice_count}})</span></a>
                    </li>
                {% endfor %}
            </ul>
            
            <div class="resultcount">{{rescount}} {% trans 'results' %} -- {{duration}} secondes</div>
            
            <ul class="notice-list clearfix">
                {% for notice in notices %}
                    <li class="notice-item" data-notice-id="{{notice.id}}">
                        <div class="notice-contents">
                            <a href="{% url 'front_notice' notice.id %}" title="{{notice.imagetitle}}">
                                <img class="notice-image" alt="{{notice.imagetitle}}" src="{{JOCONDE_IMG_BASE_URL}}{{ notice.image }}" />
                            </a>
                            <div class="notice-metadata">
                                {% if notice.title %}<h2><a href="{% url 'front_notice' notice.id %}">{% trans 'Title:' %} <span class="notice-title">{{notice.title}}</span></a></h2>{% endif %}
                                {% if not notice.title and notice.denomination %}<h2><a href="{% url 'front_notice' notice.id %}">{% trans 'Denomination:' %} <span class="notice-title">{{notice.denomination}}</span></a></h2>{% endif %}
                                <ul>
                                {% if not notice.terms_by_thesaurus.AUTR and notice.authors %}
                                    <li class="notice-thesaurus">
                                        <h3 class="notice-thesaurus-title">{% trans 'Author(s):' %}</h3>
                                        <ul class="notice-terms-list">
                                        {% for author in notice.authors %}
                                            <li class="notice-term"><a href="{% url 'multilingual_search' %}?q={{author|urlencode}}">{{author}}</a></li>
                                        {% endfor %}
                                        </ul>
                                    </li>
                                {% endif %}
                                {% for thesaurus, terms in notice.terms_by_thesaurus.items %}
                                     <li class="notice-thesaurus">
                                         <h3>{% trans thesaurus %}{% trans ':' %}</h3>
                                         <ul class="notice-term-list">
                                         {% for term in terms %}
                                            <li class="notice-term"><a href="{% url 'multilingual_search' %}?q={{term.locale_label|urlencode}}" data-dbpedia-uri="{{term.dbpedia_uri}}">{{term.locale_label}}</a></li>
                                         {% endfor %}
                                         </ul>
                                     </li>
                                {% endfor %}
                                </ul>
                            </div>
                        </div>
                    </li>
                {% endfor %}
            </ul>
{% endblock %}
