Introduce DRF and start replacing the views.
[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           {% if not funding_no_show_current %}
39             {% cache 120 funding_top_bar LANGUAGE_CODE %}
40               {% funding_top_bar %}
41             {% endcache %}
42           {% endif %}
43         {% endblock %}
44
45         <div id="whole-header">
46           <div id="header-wrapper">
47             <header id="main">
48               <a href="/" id="logo">
49                 <img src="{% static 'img/logo-neon.png' %}" alt="Wolne Lektury"/>
50               </a>
51
52               <p id="tagline">
53                 {% url 'book_list' as b %}
54                 {% url 'infopage' 'prawa' as r %}
55                 {% count_books book_count %}
56                 {% blocktrans count book_count as c %}
57                   <a href='{{ b }}'>{{ c }}</a> free reading you have <a href='{{ r }}'>right to</a>
58                 {% plural %}
59                   <a href='{{ b }}'>{{ c }}</a> free readings you have <a href='{{ r }}'>right to</a>
60                 {% endblocktrans %}
61               </p>
62
63               <div id="lang-menu" class="hoverget">
64                 <span id='lang-button' class='hoverclick'>
65                   <span class="lang-flag">⚐</span>
66                   <span class="label"> {% trans "Language" %}</span>
67                 </span>
68                 <div id="lang-menu-items">
69                   {% for lang in LANGUAGES %}
70                     <form action="{% url 'django.views.i18n.set_language' %}" method="post">
71                       {% ssi_csrf_token %}
72                       <input type="hidden" name="language" value="{{ lang.0 }}"/>
73                       <button type="submit" lang="{{ lang.0 }}"
74                               class="{% ifequal lang.0 LANGUAGE_CODE %}active{% endifequal %}">{{ lang.1 }}</button>
75                     </form>
76                   {% endfor %}
77                 </div>
78               </div>
79
80               <a id="show-menu"></a>
81               <nav id="menu">
82                 <ul id="user-info">
83                   {% user_username as user_username %}
84                   {% user_is_staff as user_is_staff %}
85                   {{ user_username.if }}
86                     <li>
87                       <a href="{% url 'user_settings' %}">
88                         <strong>{{ user_username }}</strong>
89                       </a>
90                     </li>
91                     <li>
92                       <a href="{% url 'social_my_shelf' %}" id="user-shelves-link">{% trans "My shelf" %}</a>
93                     </li>
94                   {{ user_username.endif }}
95                   {{ user_is_staff.if }}
96                     <li><a href="{% url 'admin:index' %}">{% trans "Administration" %}</a></li>
97                   {{ user_is_staff.endif }}
98                   {{ user_username.if }}
99                     <li>
100                       <a href="{% url 'logout' %}?next={% block logout %}{{ request.get_full_path }}{% endblock %}">{% trans "Logout" %}</a>
101                     </li>
102                   {{ user_username.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                   {{ user_username.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 == 'gallery' %} class="active"{% endif %}>
121                     <a href="{% url 'gallery' %}">{% trans "Gallery" %}</a>
122                   </li>
123                   <li{% if active_menu_item == 'all_works' %} class="active"{% endif %}>
124                     <a href="{% url 'catalogue' %}">{% trans "All works" %}</a>
125                   </li>
126                 </ul>
127               </nav>
128               <form id="search-area" action="{% url 'wlsearch' %}">
129                 <div id="search-field">
130                   <label for="search">{{ search_form.q.label }}</label>
131                   {{ search_form.q }}
132                 </div>
133                 <button type='submit'>{% trans "Search" %}</button>
134               </form>
135             </header>
136           </div>
137         </div>
138
139         <div id="main-content">
140           {% comment %}
141           <div id="banners">
142             <a href="https://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/">
143               <img src="{% static 'img/banners/960x150_wolneLektury.jpg' %}"
144                    alt="Wesprzyj działalność Nowoczesnej Polski"/>
145             </a>
146           </div>
147           {% endcomment %}
148           {% block body %}
149           {% endblock %}
150           <div class="clearboth"></div>
151         </div>
152
153         <div id="footer-wrapper">
154           <footer id="main">
155             {% ssi_include 'chunk' key='footer' %}
156             {% block add_footer %}{% endblock %}
157             {% ssi_include 'sponsor_page' name='footer' %}
158           </footer>
159         </div>
160
161         {# template #}
162         <div id="ajaxable-window" class='dialog-window'>
163           <div class="header"><a href="#" class="jqmClose">{% trans "Close" %}</a></div>
164           <div class="target">
165             <p><img src="{% static "img/indicator.gif" %}" alt="*"/> {% trans "Loading" %}</p>
166           </div>
167         </div>
168       {% endblock bodycontent %}
169
170       <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
171       <script type="text/javascript">
172         var LANGUAGE_CODE = "{{ LANGUAGE_CODE }}";
173         var STATIC_URL = "{{ STATIC_URL }}";
174       </script>
175       {% javascript "base" %}
176
177       {% tracking_code %}
178
179       {% block extrabody %}{% endblock %}
180
181       <script src="{% static "js/contrib/modernizr.custom.19652.js" %}"></script>
182     </body>
183   </html>
184 {% endspaceless %}