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