c6ea3836d62eff3b5a9e7f8febab38a54e86e96a
[wolnelektury.git] / src / search / templates / search / results.html
1 {% extends "2022/base.html" %}
2
3
4 {% block main %}
5   <main class="l-main">
6     <div class="l-section">
7       <div class="l-author__header">
8         <h1><span>Wynik wyszukiwania dla:</span> {{ query }}</h1>
9       </div>
10     </div>
11
12     <form class="c-form j-form-auto">
13       <div class="c-form__inline-radio">
14         format: {{ filters.format }}
15       </div>
16       <div class="c-form__controls-row">
17         <label class="c-form__control">
18           <span>język:</span>
19           {{ filters.lang }}
20         </label>
21         <label class="c-form__control">
22           <span>epoka:</span>
23           {{ filters.epoch }}
24         </label>
25         <label class="c-form__control">
26           <span>gatunek</span>
27           {{ filters.genre }}
28         </label>
29       </div>
30       <div class="c-form__inline-radio">
31         kategoria:
32         {{ filters.category }}
33       </div>
34       {{ filters.q }}
35       <button type="submit" class="c-form__hidden-submit">wyślij</button>
36     </form>
37
38     {% if results.author %}
39     <div class="l-container">
40       <h2 class="header">Autorzy</h2>
41       <ul class="c-search-result c-search-result-author">
42         {% for tag in results.author %}
43           <li>
44             <a href="{{ tag.get_absolute_url }}">
45               {% if tag.photo %}
46                 <figure>
47                   <img src="{{ tag.photo.url }}">
48                 </figure>
49               {% endif %}
50               {{ tag.name }}
51             </a>
52           </li>
53         {% endfor %}
54       </ul>
55     </div>
56     {% endif %}
57
58     {% if results.theme %}
59       <div class="l-container">
60         <h2 class="header">Motywy</h2>
61         <ul class="c-search-result">
62           {% for tag in results.theme %}
63             <li>
64               <a href="{{ tag.get_absolute_url }}">
65                 {% if tag.photo %}
66                   <figure>
67                     <img src="{{ tag.photo.url }}">
68                   </figure>
69                 {% endif %}
70                 {{ tag.name }}
71               </a>
72             </li>
73           {% endfor %}
74         </ul>
75       </div>
76     {% endif %}
77
78     {% if results.book %}
79       <div class="l-container">
80         <h2 class="header">Książki</h2>
81       </div>
82       <div class="l-section l-section--col">
83         <div class="l-books__grid">
84           {% for book in results.book %}
85             {% include 'catalogue/2022/book_box.html' %}
86           {% endfor %}
87         </div>
88       </div>
89     {% endif %}
90
91     {% if results.art %}
92       <div class="l-container">
93         <h2 class="header">Obrazy</h2>
94       </div>
95       <div class="l-section l-section--col">
96         <div class="l-books__grid">
97           {% for book in results.art %}
98             {% include 'catalogue/2022/book_box.html' %}
99           {% endfor %}
100         </div>
101       </div>
102     {% endif %}
103
104     {% if results.fragment or results.snippet %}
105       <div class="l-container">
106         <h2 class="header">W treści</h2>
107         {% for f in results.snippet %}
108           <div class="c-search-result-fragment">
109             {% for author in f.book.authors %}
110               <a class="c-search-result-fragment-author" href="{{ author.get_absolute_url }}">{{ author }}</a>
111             {% endfor %}
112             <a class="c-search-result-fragment-title" href="{{ f.book.get_absolute_url }}">
113               {{ f.book.title }}
114             </a>
115             <a class="c-search-result-fragment-text" href='{% url 'book_text' f.book.slug %}#sec{{ f.sec }}'>
116               {{ f.headline|safe }}
117             </a>
118           </div>
119         {% endfor %}
120       </div>
121     {% endif %}
122
123     {% if results.collection %}
124       <div class="l-container">
125         <h2 class="header">Kolekcje</h2>
126         <div class="c-search-result-collection">
127           {% for collection in results.collection %}
128             {% include 'catalogue/2022/collection_box.html' %}
129             {% include 'catalogue/2022/collection_box.html' %}
130           {% endfor %}
131         </div>
132       </div>
133     {% endif %}
134
135     {% if pd_authors %}
136       <div class="l-container">
137         <div class="c-search-result-pd">
138           <h2>Domena publiczna?</h2>
139           <p>
140             Dzieła tych autorów przejdą do zasobów domeny publicznej i będą mogły
141             być publikowane bez żadnych ograniczeń.
142             Dowiedz się, dlaczego biblioteki internetowe nie mogą udostępniać dzieł tego autora.
143           </p>
144           <div>
145             {% for tag in pd_authors %}
146               <div><a href="{{ tag.get_absolute_url }}">
147                 <strong>{{ tag }}</strong>
148                 Dzieła tego autora będą mogły być publikowane bez ograniczeń w&nbsp;roku&nbsp;<em>{{ tag.goes_to_pd }}</em>.
149               </a></div>
150             {% endfor %}
151           </div>
152         </div>
153       </div>
154     {% endif %}
155   </main>
156 {% endblock %}