<commit_before>{% extends '::ojsbase.html.twig' %}
{% block title %}{{ 'title.explore'|trans }} {{ parent() }}{% endblock %}
{% set hideleft = true %}

{% block breadcrumb %}
    {% set list = [
        {'link': path('ojs_site_explore_index'), 'title': 'ojs.title'|trans},
        {'title': 'explore'|trans}
    ] %}

    {{ breadcrumb(list) }}
{% endblock %}

{% block body %}
    <div class="row">
        <div class="col-md-3 col-sm-3">
            <div class="panel-group">
                {% if types %}
                    <div class="panel panel-default">
                        <div class="panel-heading">{{ 'title.publisher_types'|trans }}</div>
                        <ul class="list-group">
                            {% for type in types %}
                                <li class="list-group-item">
                                    {% if type_filters is empty %}
                                        {% set parameter = type.key %}
                                        <a href="{{ path('ojs_site_explore_index', {
                                            type_filters: type.key,
                                            publisher_filters: app.request.get('publisher_filters'),
                                            subject_filters: app.request.get('subject_filters')}) }}">{{ type.key|trans }}</a>
                                    {% else %}
                                        {% if type.key in type_filters %}
                                            {% set parameter = type_filters|pop(type.key) %}
                                            {{ type.key|trans }}
                                            <a href="{{ path('ojs_site_explore_index', {
                                                type_filters: parameter|join(','),
                                                publisher_filters: app.request.get('publisher_filters'),
                                                subject_filters: app.request.get('subject_filters')}) }}">
                                                <span class="label label-danger">
                                                    <i class="glyphicon glyphicon-remove"></i>
                                                </span>
                                            </a>
                                        {% else %}
                                            {% set parameter = type_filters|merge([type.key]) %}
                                            <a href="{{ path('ojs_site_explore_index', {
                                                type_filters: parameter|join(','),
                                                publisher_filters: app.request.get('publisher_filters'),
                                                subject_filters: app.request.get('subject_filters')}) }}">{{ type.key|trans }}</a>
                                        {% endif %}
                                    {% endif %}
                                    <span class="badge">{{ type.doc_count }}</span>
                                </li>
                            {% endfor %}
                        </ul>
                    </div>
                {% endif %}
                {% if publishers %}
                    <div id="publishers-filter-box" class="panel panel-default">
                        <div class="panel-heading">{{ 'title.publishers'|trans }}</div>
                        {% if publishers|length>5 %}
                            <input class="search" placeholder="{{ "search"|trans }}"/>
                            <button class="sort btn btn-sm" data-sort="publishers">
                                {{ "search"|trans }}
                            </button>
                        {% endif %}
                        <ul class="list-group list">
                            {% for publisher in publishers %}
                                <li class="list-group-item">
                                    {% if publisher_filters is empty %}
                                        {% set parameter = publisher.key %}
                                        <a href="{{ path('ojs_site_explore_index', {
                                            publisher_filters: publisher.key,
                                            subject_filters: app.request.get('subject_filters'),
                                            type_filters: app.request.get('type_filters') }) }}"
                                           class="publisher-name">{{ publisher.key|trans }}</a>
                                    {% else %}
                                        {% if publisher.key in publisher_filters %}
                                            {% set parameter = publisher_filters|pop(publisher.key) %}
                                            {{ publisher.key|trans }}
                                            <a href="{{ path('ojs_site_explore_index', {
                                                publisher_filters: parameter|join(','),
                                                subject_filters: app.request.get('subject_filters'),
                                                type_filters: app.request.get('type_filters')}) }}">
                                                <span class="label label-danger">
                                                    <i class="glyphicon glyphicon-remove"></i>
                                                </span>
                                            </a>
                                        {% else %}
                                            {% set parameter = publisher_filters|merge([publisher.key]) %}
                                            <a href="{{ path('ojs_site_explore_index', {
                                                publisher_filters: parameter|join(','),
                                                subject_filters: app.request.get('subject_filters'),
                                                type_filters: app.request.get('type_filters')}) }}"
                                               class="publisher-name">{{ publisher.key|trans }}</a>
                                        {% endif %}
                                    {% endif %}
                                    <span class="badge">{{ publisher.doc_count }}</span>
                                </li>
                            {% endfor %}
                        </ul>
                    </div>
                {% endif %}
                {% if subjects %}
                    <div class="panel panel-default" id="subjects-filter-box">
                        <div class="panel-heading">{{ 'title.subjects'|trans }}</div>
                        {% if subjects|length>5 %}
                            <input class="search" placeholder="{{ "search"|trans }}"/>
                            <button class="sort btn btn-sm" data-sort="subject">
                                {{ "search"|trans }}
                            </button>
                        {% endif %}
                        <ul class="list-group list">
                            {% for subject in subjects %}
                                <li class="list-group-item">
                                    {% if subject_filters is empty %}
                                        {% set parameter = subject.key %}
                                        <a href="{{ path('ojs_site_explore_index', {
                                            subject_filters: subject.key,
                                            type_filters: app.request.get('type_filters'),
                                            publisher_filters: app.request.get('publisher_filters')}) }}" class="subject">{{ subject.key }}</a>
                                    {% else %}
                                        {% if subject.key in subject_filters %}
                                            {% set parameter = subject_filters|pop(subject.key) %}
                                            {{ subject.key }}
                                            <a href="{{ path('ojs_site_explore_index', {
                                                subject_filters: parameter|join(','),
                                                type_filters: app.request.get('type_filters'),
                                                publisher_filters: app.request.get('publisher_filters')}) }}"  class="subject">
                                                <span class="label label-danger">
                                                    <i class="glyphicon glyphicon-remove"></i>
                                                </span>
                                            </a>
                                        {% else %}
                                            {% set parameter = subject_filters|merge([subject.key]) %}
                                            <a href="{{ path('ojs_site_explore_index', {
                                                subject_filters: parameter|join(','),
                                                type_filters: app.request.get('type_filters'),
                                                publisher_filters: app.request.get('publisher_filters')}) }}" class="subject">{{ subject.key }}</a>
                                        {% endif %}
                                    {% endif %}
                                    <span class="badge">{{ subject.doc_count }}</span>
                                </li>
                            {% endfor %}
                        </ul>
                    </div>
                {% endif %}
            </div>
        </div>

        <div class="col-md-9 col-sm-9">
            {% for journal in journals %}
                {% include '::journal.html.twig' %}
            {% endfor %}
        </div>

        {% if journals|length>1 %}
        <div class="text-center">
            <ul class="pagination">
                {{ pagerfanta(pagerfanta,'twitter_bootstrap3') }}
            </ul>
        </div>
        {% endif %}
    </div>
{% endblock %}

{% block javascripts %}
    {{ parent() }}
    <script>
        {% if subjects and subjects|length>5 %}
            var options = {
                valueNames: [ 'subject']
            };
            var userList = new List('subjects-filter-box', options);
        {% endif %}
        {% if publishers and publishers|length>5 %}
        var options = {
            valueNames: ['publisher-name']
        };
        var publishersList = new List('publishers-filter-box', options);
        {% endif %}
    </script>
{% endblock %}<commit_msg>Change search forms' appearance<commit_after>{% extends '::ojsbase.html.twig' %}
{% block title %}{{ 'title.explore'|trans }} {{ parent() }}{% endblock %}
{% set hideleft = true %}

{% block breadcrumb %}
    {% set list = [
        {'link': path('ojs_site_explore_index'), 'title': 'ojs.title'|trans},
        {'title': 'explore'|trans}
    ] %}

    {{ breadcrumb(list) }}
{% endblock %}

{% block body %}
    <div class="row">
        <div class="col-md-3 col-sm-3">
            <div class="panel-group">
                {% if types %}
                    <div class="panel panel-default">
                        <div class="panel-heading">{{ 'title.publisher_types'|trans }}</div>
                        <ul class="list-group">
                            {% for type in types %}
                                <li class="list-group-item">
                                    {% if type_filters is empty %}
                                        {% set parameter = type.key %}
                                        <a href="{{ path('ojs_site_explore_index', {
                                            type_filters: type.key,
                                            publisher_filters: app.request.get('publisher_filters'),
                                            subject_filters: app.request.get('subject_filters')}) }}">{{ type.key|trans }}</a>
                                    {% else %}
                                        {% if type.key in type_filters %}
                                            {% set parameter = type_filters|pop(type.key) %}
                                            {{ type.key|trans }}
                                            <a href="{{ path('ojs_site_explore_index', {
                                                type_filters: parameter|join(','),
                                                publisher_filters: app.request.get('publisher_filters'),
                                                subject_filters: app.request.get('subject_filters')}) }}">
                                                <span class="label label-danger">
                                                    <i class="glyphicon glyphicon-remove"></i>
                                                </span>
                                            </a>
                                        {% else %}
                                            {% set parameter = type_filters|merge([type.key]) %}
                                            <a href="{{ path('ojs_site_explore_index', {
                                                type_filters: parameter|join(','),
                                                publisher_filters: app.request.get('publisher_filters'),
                                                subject_filters: app.request.get('subject_filters')}) }}">{{ type.key|trans }}</a>
                                        {% endif %}
                                    {% endif %}
                                    <span class="badge">{{ type.doc_count }}</span>
                                </li>
                            {% endfor %}
                        </ul>
                    </div>
                {% endif %}
                {% if publishers %}
                    <div id="publishers-filter-box" class="panel panel-default">
                        <div class="panel-heading">{{ 'title.publishers'|trans }}</div>
                        {% if publishers|length > 5 %}
                            <input class="search form-control" placeholder="{{ "search"|trans }}"/>
                            <button class="sort btn btn-primary btn-sm" data-sort="publishers">
                                {{ "search"|trans }}
                            </button>
                        {% endif %}
                        <ul class="list-group list">
                            {% for publisher in publishers %}
                                <li class="list-group-item">
                                    {% if publisher_filters is empty %}
                                        {% set parameter = publisher.key %}
                                        <a href="{{ path('ojs_site_explore_index', {
                                            publisher_filters: publisher.key,
                                            subject_filters: app.request.get('subject_filters'),
                                            type_filters: app.request.get('type_filters') }) }}"
                                           class="publisher-name">{{ publisher.key|trans }}</a>
                                    {% else %}
                                        {% if publisher.key in publisher_filters %}
                                            {% set parameter = publisher_filters|pop(publisher.key) %}
                                            {{ publisher.key|trans }}
                                            <a href="{{ path('ojs_site_explore_index', {
                                                publisher_filters: parameter|join(','),
                                                subject_filters: app.request.get('subject_filters'),
                                                type_filters: app.request.get('type_filters')}) }}">
                                                <span class="label label-danger">
                                                    <i class="glyphicon glyphicon-remove"></i>
                                                </span>
                                            </a>
                                        {% else %}
                                            {% set parameter = publisher_filters|merge([publisher.key]) %}
                                            <a href="{{ path('ojs_site_explore_index', {
                                                publisher_filters: parameter|join(','),
                                                subject_filters: app.request.get('subject_filters'),
                                                type_filters: app.request.get('type_filters')}) }}"
                                               class="publisher-name">{{ publisher.key|trans }}</a>
                                        {% endif %}
                                    {% endif %}
                                    <span class="badge">{{ publisher.doc_count }}</span>
                                </li>
                            {% endfor %}
                        </ul>
                    </div>
                {% endif %}
                {% if subjects %}
                    <div class="panel panel-default" id="subjects-filter-box">
                        <div class="panel-heading">{{ 'title.subjects'|trans }}</div>
                        {% if subjects|length > 5 %}
                            <input class="search form-control" placeholder="{{ "search"|trans }}"/>
                            <button class="sort btn btn-primary btn-sm" data-sort="subject">
                                {{ "search"|trans }}
                            </button>
                        {% endif %}
                        <ul class="list-group list">
                            {% for subject in subjects %}
                                <li class="list-group-item">
                                    {% if subject_filters is empty %}
                                        {% set parameter = subject.key %}
                                        <a href="{{ path('ojs_site_explore_index', {
                                            subject_filters: subject.key,
                                            type_filters: app.request.get('type_filters'),
                                            publisher_filters: app.request.get('publisher_filters')}) }}" class="subject">{{ subject.key }}</a>
                                    {% else %}
                                        {% if subject.key in subject_filters %}
                                            {% set parameter = subject_filters|pop(subject.key) %}
                                            {{ subject.key }}
                                            <a href="{{ path('ojs_site_explore_index', {
                                                subject_filters: parameter|join(','),
                                                type_filters: app.request.get('type_filters'),
                                                publisher_filters: app.request.get('publisher_filters')}) }}"  class="subject">
                                                <span class="label label-danger">
                                                    <i class="glyphicon glyphicon-remove"></i>
                                                </span>
                                            </a>
                                        {% else %}
                                            {% set parameter = subject_filters|merge([subject.key]) %}
                                            <a href="{{ path('ojs_site_explore_index', {
                                                subject_filters: parameter|join(','),
                                                type_filters: app.request.get('type_filters'),
                                                publisher_filters: app.request.get('publisher_filters')}) }}" class="subject">{{ subject.key }}</a>
                                        {% endif %}
                                    {% endif %}
                                    <span class="badge">{{ subject.doc_count }}</span>
                                </li>
                            {% endfor %}
                        </ul>
                    </div>
                {% endif %}
            </div>
        </div>

        <div class="col-md-9 col-sm-9">
            {% for journal in journals %}
                {% include '::journal.html.twig' %}
            {% endfor %}
        </div>

        {% if journals|length > 1 %}
        <div class="text-center">
            <ul class="pagination">
                {{ pagerfanta(pagerfanta,'twitter_bootstrap3') }}
            </ul>
        </div>
        {% endif %}
    </div>
{% endblock %}

{% block javascripts %}
    {{ parent() }}
    <script>
        {% if subjects and subjects|length > 5 %}
            var options = {
                valueNames: [ 'subject']
            };
            var userList = new List('subjects-filter-box', options);
        {% endif %}
        {% if publishers and publishers|length > 5 %}
        var options = {
            valueNames: ['publisher-name']
        };
        var publishersList = new List('publishers-filter-box', options);
        {% endif %}
    </script>
{% endblock %}
{'fraction_non_alphanumeric': 0.11545318070932632, 'fraction_numerical': 0.0009382623381497466, 'mean_word_length': 0.8297854077253218, 'pattern_counts': {'":': 0, '<': 163, '<?xml version=': 0, '>': 173, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 324, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4624780', 'n_tokens_mistral': 4378, 'n_tokens_neox': 3950, 'n_words': 790}