optimize db usage in tagged object list
[wolnelektury.git] / src / wolnelektury / templates / base / superbase.html
1 <!DOCTYPE html>
2 {% spaceless %}
3   <html lang="{{ LANGUAGE_CODE }}" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
4     {% load pipeline i18n %}
5     {% load static from staticfiles %}
6     {% load catalogue_tags funding_tags reporting_stats %}
7     {% load piwik_tags %}
8     {% load ssi_include ssi_csrf_token from ssify %}
9     {% load user_username user_is_staff from common_tags %}
10     <head>
11       <meta charset="utf-8">
12       <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
13       <meta name="application-name" content="Wolne Lektury" />
14       <meta property="og:site_name" content="Wolne Lektury" />
15       <meta property="og:title" content="{% block ogtitle %}{{ page_title }}{% endblock %}" />
16       <meta property="og:type" content="{% block ogtype %}website{% endblock %}" />
17       <meta property="og:image" content="{% block ogimage %}{{ FULL_STATIC_URL }}img/wiatrak.jpg{% endblock %}" />
18       <meta name="description" content="{% block metadescription %}Darmowe, opracowane, pełne teksty lektur, e-booki, audiobooki i pliki DAISY na wolnej licencji.{% endblock %}" />
19       {% block ogextra %}{% endblock %}
20
21       <title>
22         {% block title %}{% block titleextra %}{{ page_title }}{% endblock %} :: {% trans "Wolne Lektury" %}{% endblock %}
23       </title>
24       <link rel="icon" href="{% static 'img/favicon.png' %}" type="image/png"/>
25       <link rel="search" type="application/opensearchdescription+xml" title="Wolne Lektury"
26             href="{% static 'opensearch.xml' %}"/>
27       {% stylesheet "main" %}
28       {% block extrahead %}{% endblock %}
29     </head>
30     <body id="{% block bodyid %}base{% endblock %}">
31
32       {% block bodycontent %}
33
34         {% if not funding_no_show_current %}
35           {% current_offer as current_offer %}
36           {{ current_offer.if }}
37           {% ssi_include 'funding_top_bar' pk=current_offer %}
38           {{ current_offer.endif }}
39         {% endif %}
40
41         <div id="whole-header">
42           <div id="header-wrapper">
43             <header id="main">
44               <a href="/" id="logo">
45                 <img src="{% static 'img/logo-neon.png' %}" alt="Wolne Lektury"/>
46               </a>
47
48               <p id="tagline">
49                 {% url 'book_list' as b %}
50                 {% url 'infopage' 'prawa' as r %}
51                 {% count_books book_count %}
52                 {% blocktrans count book_count as c %}
53                   <a href='{{ b }}'>{{ c }}</a> free reading you have <a href='{{ r }}'>right to</a>
54                 {% plural %}
55                   <a href='{{ b }}'>{{ c }}</a> free readings you have <a href='{{ r }}'>right to</a>
56                 {% endblocktrans %}
57               </p>
58
59               <div id="lang-menu" class="hoverget">
60                 <span id='lang-button' class='hoverclick'>
61                   <span class="lang-flag">⚐</span>
62                   <span class="label"> {% trans "Language" %}</span>
63                 </span>
64                 <div id="lang-menu-items">
65                   {% for lang in LANGUAGES %}
66                     <form action="{% url 'django.views.i18n.set_language' %}" method="post">
67                       {% ssi_csrf_token %}
68                       <input type="hidden" name="language" value="{{ lang.0 }}"/>
69                       <button type="submit" lang="{{ lang.0 }}"
70                               class="{% ifequal lang.0 LANGUAGE_CODE %}active{% endifequal %}">{{ lang.1 }}</button>
71                     </form>
72                   {% endfor %}
73                 </div>
74               </div>
75
76               <a id="show-menu"></a>
77               <nav id="menu">
78                 <ul id="user-info">
79                   {% user_username as user_username %}
80                   {% user_is_staff as user_is_staff %}
81                   {{ user_username.if }}
82                     <li>
83                       <a href="{% url 'user_settings' %}">
84                         <strong>{{ user_username }}</strong>
85                       </a>
86                     </li>
87                     <li>
88                       <a href="{% url 'social_my_shelf' %}" id="user-shelves-link">{% trans "My shelf" %}</a>
89                     </li>
90                   {{ user_username.endif }}
91                   {{ user_is_staff.if }}
92                     <li><a href="{% url 'admin:index' %}">{% trans "Administration" %}</a></li>
93                   {{ user_is_staff.endif }}
94                   {{ user_username.if }}
95                     <li>
96                       <a href="{% url 'logout' %}?next={% block logout %}{{ request.get_full_path }}{% endblock %}">{% trans "Logout" %}</a>
97                     </li>
98                   {{ user_username.else }}
99                     <li>
100                       <a href="{% url 'login' %}?next={{ request.path }}" id="login">{% trans "Sign in" %}</a>
101                       / <a href="{% url 'register' %}?next={{ request.path }}" id="register">{% trans "Register" %}</a>
102                     </li>
103                   {{ user_username.endif }}
104                 </ul>
105
106                 <ul id="main-menu">
107                   <li{% if active_menu_item == 'books' %} class="active"{% endif %}>
108                     <a href="{% url 'book_list' %}">{% trans "Literature" %}</a>
109                   </li>
110                   <li{% if active_menu_item == 'theme' %} class="active"{% endif %}>
111                     <a href="{% url 'theme_catalogue' %}">{% trans "Themes" %}</a>
112                   </li>
113                   <li{% if active_menu_item == 'audiobooks' %} class="active"{% endif %}>
114                     <a href="{% url 'audiobook_list' %}">{% trans "Audiobooks" %}</a>
115                   </li>
116                   <li{% if active_menu_item == 'gallery' %} class="active"{% endif %}>
117                     <a href="{% url 'gallery' %}">{% trans "Gallery" %}</a>
118                   </li>
119                   <li{% if active_menu_item == 'all_works' %} class="active"{% endif %}>
120                     <a href="{% url 'catalogue' %}">{% trans "All works" %}</a>
121                   </li>
122                 </ul>
123               </nav>
124               <form id="search-area" action="{% url 'search' %}">
125                 <div id="search-field">
126                   <label for="search">{{ search_form.q.label }}</label>
127                   {{ search_form.q }}
128                 </div>
129                 <button type='submit'>{% trans "Search" %}</button>
130               </form>
131             </header>
132           </div>
133         </div>
134
135         <div id="main-content">
136           <div id="banners">
137             <a href="https://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/">
138               <img src="{% static 'img/banners/960x150_wolneLektury.jpg' %}"
139                    alt="Wesprzyj działalność Nowoczesnej Polski"/>
140             </a>
141           </div>
142           {% block body %}
143           {% endblock %}
144           <div class="clearboth"></div>
145         </div>
146
147         <div id="footer-wrapper">
148           <footer id="main">
149             {% ssi_include 'chunk' key='footer' %}
150             {% block add_footer %}{% endblock %}
151             {% ssi_include 'sponsor_page' name='footer' %}
152           </footer>
153         </div>
154
155         {# template #}
156         <div id="ajaxable-window" class='dialog-window'>
157           <div class="header"><a href="#" class="jqmClose">{% trans "Close" %}</a></div>
158           <div class="target">
159             <p><img src="{% static "img/indicator.gif" %}" alt="*"/> {% trans "Loading" %}</p>
160           </div>
161         </div>
162       {% endblock bodycontent %}
163
164       <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
165       <script type="text/javascript">
166         var LANGUAGE_CODE = "{{ LANGUAGE_CODE }}";
167         var STATIC_URL = "{{ STATIC_URL }}";
168       </script>
169       {% javascript "base" %}
170
171       {% tracking_code %}
172
173       {% block extrabody %}{% endblock %}
174
175       <script src="{% static "js/contrib/modernizr.custom.19652.js" %}"></script>
176     </body>
177   </html>
178 {% endspaceless %}