src/Front/Templates/_includes/_search.html.twig line 1

  1. {% from '@front_templates/_includes/_icons.html.twig' import search, chevronDown, close %}
  2. {# TODO #}
  3. {% set searchPage = front_service.PageByIdName('search_results', app.request.locale) %}
  4. {% set isJournalSearch = journalTemplate|default(false) %}
  5. {% if searchPage %}
  6. <div class="header-area__full-screen header-area__full-screen--search js-search-area {% if isJournalSearch %}header-area__full-screen--search-journal{% endif %}">
  7.     <form class="search-form search-form--center" method="post" action="{{ isJournalSearch ? path('journal_search_results', {journalSlug: current_journal.Journal.slug}) : site_url_generator.Url('page', { slug: searchPage }) }}">
  8.         <h2 class="search-form__title">{{ 'T_GENERAL_SEARCH_TITLE'|trans }}</h2>
  9.         <p class="search-form__subtitle">{{ 'T_GENERAL_SEARCH_TEXT_SIMPLE'|trans }}{# wyszukiwanie proste #}</p>
  10.         <div class="search-form__input-wrapper">
  11.             <input class="search-form__input" type="text" id="search" name="text" value="{{ app.request.query.get('text') }}">
  12.             <label class="search-form__label" for="search">{{ 'T_GENERAL_SEARCH_TEXT_INPUT_PLACEHOLDER'|trans }}</label>
  13.             {{ search('T_SEARCH'|trans, 'black') }}
  14.             <span class="search-form__subinput">np. “cognitive architectures” AND 1993-200 NOT Urban</span>
  15.         </div>
  16.         <div class="search-form__advanced js-search-form__advanced">
  17.             {{ 'T_GENERAL_SEARCH_ADVANCED_SEARCH'|trans }}
  18.             <button type="button" class="search-form__toggle js-search-form__toggle">
  19.                 <span>{{ 'T_EXPAND'|trans }}</span>
  20.                 <span>{{ 'T_RETRACT'|trans }}</span>
  21.                 {{ chevronDown('T_TOOGLE_SEARCH'|trans) }}
  22.             </button>
  23.         </div>
  24.         <div class="grid-form">
  25.             {% if not isJournalSearch %}
  26.             <div class="form__item">
  27.                 <label for="title" class="form__label">{{ 'T_GENERAL_SEARCH_JOURNAL_TITLE'|trans }}</label>
  28.                 <input type="text" id="title" name="journalTitle" class="form__input" value="{{ app.request.get('journalTitle') }}">
  29.             </div>
  30.             {% endif %}
  31.             <div class="form__item">
  32.                 <label for="article-type" class="form__label">{{ 'T_GENERAL_SEARCH_ARTICLE_TYPE'|trans }}</label>
  33.                 <select id="article-type" class="form__select" name="articleType">
  34.                     <option value="" selected="">{{ 'T_GENERAL_SEARCH_ARTICLE_TYPE_ALL'|trans }}</option>
  35.                     {% for articleType in search_util.articleTypes %}
  36.                         <option value="{{ articleType.value }}" {% if app.request.get('articleType') == articleType.value %}selected{% endif %}>{{ articleType|trans_journal_enum }}</option>
  37.                     {% endfor %}
  38.                 </select>
  39.             </div>
  40.             <div class="form__item">
  41.                 <label for="volume" class="form__label">{{ 'T_GENERAL_SEARCH_ISSUE_VOLUME_TITLE'|trans }}</label>
  42.                 <input type="text" id="volume" name="issueTitle" class="form__input" value="{{ app.request.get('issueTitle') }}">
  43.             </div>
  44.             <div class="form__item">
  45.                 <label for="ISSN" class="form__label">{{ 'T_GENERAL_SEARCH_ISSN'|trans }}</label>
  46.                 <input type="text" id="ISSN" name="issn" class="form__input" value="{{ app.request.get('issn') }}">
  47.                 <span class="form__subinput">{{ 'T_GENERAL_SEARCH_ISSN_HINT'|trans }}</span>
  48.             </div>
  49.             <div class="form__item">
  50.                 <label for="article-title" class="form__label">{{ 'T_GENERAL_SEARCH_ARTICLE_TITLE'|trans }}</label>
  51.                 <input type="text" id="article-title" name="articleTitle" class="form__input" value="{{ app.request.get('articleType') }}">
  52.             </div>
  53.             <div class="form__item">
  54.                 <label for="DOI" class="form__label">{{ 'T_GENERAL_SEARCH_DOI'|trans }}</label>
  55.                 <input type="text" id="DOI" name="doi" class="form__input" value="{{ app.request.get('doi') }}">
  56.                 <span class="form__subinput">{{ 'T_GENERAL_SEARCH_DOI_HINT'|trans }}</span>
  57.             </div>
  58.             <div class="form__item">
  59.                 <label for="author" class="form__label">{{ 'T_GENERAL_SEARCH_AUTHOR'|trans }}</label>
  60.                 <input type="text" id="author" name="author" class="form__input" value="{{ app.request.get('author') }}">
  61.             </div>
  62.             <div class="form__item">
  63.                 <label for="affiliation" class="form__label">{{ 'T_GENERAL_SEARCH_AUTHOR_AFFILIATION'|trans }}</label>
  64.                 <input type="text" id="affiliation" name="authorAffiliation" class="form__input" value="{{ app.request.get('authorAffiliation') }}">
  65.                 <span class="form__subinput">{{ 'T_GENERAL_SEARCH_AUTHOR_AFFILIATION_HINT'|trans }}</span>
  66.             </div>
  67.             <div class="form__item">
  68.                 <label for="keywords" class="form__label">{{ 'T_GENERAL_SEARCH_KEYWORDS'|trans }}</label>
  69.                 <input type="text" id="keywords" name="keywords" class="form__input" value="{{ app.request.get('keywords') }}">
  70.             </div>
  71.             <div class="form__item form__item--columns">
  72.                 <label for="dateFrom" class="form__label">{{ 'T_GENERAL_SEARCH_PUBLISH_DATE'|trans }}</label>
  73.                 <input type="date" id="dateFrom" name="releaseDateFrom" class="form__input" placeholder="{{ 'T_GENERAL_SEARCH_DATE_FROM_PLACEHOLDER'|trans }}">
  74.                 <input type="date" name="releaseDateTo" class="form__input" placeholder="{{ 'T_GENERAL_SEARCH_DATE_TO_PLACEHOLDER'|trans }}">
  75.             </div>
  76.         </div>
  77.         <button type="submit" class="btn btn--purple"><span>{{ 'T_SEARCH'|trans }}</span></button>
  78.     </form>
  79. </div>
  80. <div class="close close--search"></div>
  81. <button class="close close--search ico-light justify-c js-search-close">
  82.     {{ close('T_CLOSE_SEARCH'|trans, 'black') }}
  83. </button>
  84. {% endif %}