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