entries.html 7.26 KB
{% extends "base.html" %}

{% load i18n %}
{% load static %}
{% load crispy_forms_tags %}

{% block title %}{% trans "Hasła" %}{% endblock %}

{% block styles %}
    <!-- for autocomplete -->
    <link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
    <!-- https://datatables.net/ -->
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4/dt-1.10.22/sc-2.0.3/datatables.min.css"/>
    <!--link rel="stylesheet" type="text/css" href="{% static 'entries/css/panels.css' %}"-->
    <link rel="stylesheet" type="text/css" href="{% static 'entries/css/entries.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'common/css/role_colours.css' %}">
{% endblock %}

{% block scripts %}
    <!-- https://www.cssscript.com/split-view/ -->
    <script src="https://unpkg.com/split.js/dist/split.min.js"></script>
    <!-- https://datatables.net/ -->
    <script type="text/javascript" src="https://cdn.datatables.net/v/bs4/dt-1.10.22/sc-2.0.3/datatables.min.js"></script>
    <script src="{% static 'common/js/csrf.js' %}"></script>
    <!--script src="{% static 'entries/js/panels.js' %}"></script-->
    <script src="{% static 'entries/js/forms.js' %}"></script>
    <script src="{% static 'entries/js/utils.js' %}"></script>
    <script src="{% static 'entries/js/entries.js' %}"></script>
{% endblock %}

{% block additional-nav-items %}
<li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle text-light" href="#" id="nav-filters" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        {% trans "Filtrowanie" %}
    </a>
    <div class="dropdown-menu" id="filters-visited-dropdown" aria-labelledby="nav-filters">
        <a href="#" class="dropdown-item font-weight-bold text-dark text-uppercase" id="filter-button" data-toggle="modal" data-target="#entry-filters">
            {% trans "Hasła" %}
        </a>
        <a href="#" class="dropdown-item font-weight-bold text-dark text-uppercase" id="filter-frames-button" data-toggle="modal" data-target="#frame-filters">
            {% trans "Ramy" %}
        </a>
        <a href="#" class="dropdown-item font-weight-bold text-dark text-uppercase" id="filter-schemata-button" data-toggle="modal" data-target="#schema-filters">
            {% trans "Schematy" %}
        </a>
    </div>
</li>
<li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle text-light" href="#" id="nav-last" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        {% trans "Ostatnio oglądane" %}
    </a>
    <div class="dropdown-menu" id="last-visited-dropdown" aria-labelledby="nav-last">
    {% for lemma, eid in request.session.last_visited|slice:":-1" %}
        <a class="dropdown-item font-weight-bold text-dark text-uppercase last-visited" data-entry="{{ eid }}" href="#">{{ lemma }}</a>
    {% endfor %}
    </div>
</li>
<li class="nav-item dropdown">
    <a class="nav-link dropdown-toggle text-light" href="#" id="nav-options" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        {% trans "Opcje" %}
    </a>
    <div class="dropdown-menu px-1" id="options-dropdown" aria-labelledby="nav-options">
        <div class="form-check custom-control custom-checkbox">
            <input type="checkbox" class="custom-control-input" id="show-realisation-descriptions"{% if request.session.show_reals_desc %} checked{% endif %}>
            <label class="custom-control-label" for="show-realisation-descriptions">
            {% trans "Wyświetlaj opisy realizacji" %} <span data-toggle="tooltip" data-placement="bottom" title="{% trans "Po wybraniu ramy wyświetlaj opisy jej realizacji składniowych. Opisy (dla całej realizacji i dla poszczególnych fraz) są wyświetlane wewnątrz schematów." %}"><img src="/static/common/img/info.svg" alt="info" width="10" height="10"/></span>
            </label>
        </div>
        <div class="form-check custom-control custom-checkbox">
            <input type="checkbox" class="custom-control-input" id="show-linked-entries"{% if request.session.show_linked_entries %} checked{% endif %}>
            <label class="custom-control-label" for="show-linked-entries">
            {% trans "Wyświetlaj powiązane hasła" %} <span data-toggle="tooltip" data-placement="bottom" data-html="true" title="{% trans "Przy filtrowaniu haseł wyświetlaj, oprócz haseł spełniających kryteria filtrowania, hasła powiązane z nimi znaczeniowo (np. <i>podarować</i><i>podarunek</i><i>podarek</i>). Hasła powiązane niespełniające kryteriów filtrowania są wyróżnione jaśniejszym kolorem na liście oraz nie podlegają filtrowaniu schematów i ram (są zawsze wyświetlane w całości niezależnie od użytych filtrów dla schematów/ram)." %}"><img src="/static/common/img/info.svg" alt="info" width="10" height="10"/></span>
            </label>
        </div>
    </div>
</li>
{% endblock %}

{% block content %}

<div class="row h-100 m-0 p-0 bg-secondary">
    <!-- left panel: list of entries -->
    <div id="entries-list" class="col h-100 w-100 px-0">
        <div id="entries-list-div" class="col p-0 h-100 w-100 overflow-auto">
            {% include "entries_list.html" %}
        </div>
    </div>
    
    <!-- right panel: entry display (syntax, semantics, examples) -->
    <div id="entry-display" class="col h-100 p-0">
        {% include "entry_display.html" %}
    </div>
</div>

{% endblock %}

{% block modals %}

<div class="modal fade" id="entry-filters" tabindex="-1" role="dialog" aria-labelledby="entry-filtersLabel" aria-hidden="true">
  <div class="modal-dialog modal-xl" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="entry-filtersLabel">{% trans "Filtrowanie haseł" %}</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body text-dark">
        {% crispy entries_form %}
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="frame-filters" tabindex="-1" role="dialog" aria-labelledby="frame-filtersLabel" aria-hidden="true">
  <div class="modal-dialog modal-xl" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="frame-filtersLabel">{% trans "Filtrowanie ram" %}</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body text-dark">
        {% crispy frames_form %}
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="schema-filters" tabindex="-1" role="dialog" aria-labelledby="schema-filtersLabel" aria-hidden="true">
  <div class="modal-dialog modal-xl" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="schema-filtersLabel">{% trans "Filtrowanie schematów" %}</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body text-dark">
        {% crispy schemata_form %}
      </div>
    </div>
  </div>
</div>

{% endblock %}