fix unwanted horizontal scrollbar
[redakcja.git] / apps / catalogue / templates / catalogue / book_text.html
1 {% extends "catalogue/base.html" %}
2 {% load i18n pipeline catalogue_files %}
3
4 {% block title %}{{ sst.meta.title }}{% endblock %}
5
6 {% load thumbnail %}
7
8 {% block content %}
9 <div class="navbar navbar-default row" style="margin-top:-20px;">
10     <div class="col-md-8 col-md-offset-2">
11
12 {% if doc.owner_organization %}
13
14 {% if doc.owner_organization.logo %}
15
16 {% thumbnail doc.owner_organization.logo '80x50'  format='PNG' as th %}
17 <a class="navbar-brand" href="{{ doc.owner_organization.get_absolute_url }}" style="padding: 0;">
18     <img src="{{ th.url }}" style="padding: {{ th|margin:'80x50' }}" title="{{ doc.owner_organization }}">
19 </a>
20 {% endthumbnail %}
21
22 {% else %}
23 <span class="navbar-text">{% trans "Resource owner" %}:</span>
24 <a class="navbar-text" href="{{ doc.owner_organization.get_absolute_url }}">
25     {{ doc.owner_organization }}
26 </a>
27 {% endif %}
28
29 {% else %}
30 <div class="navbar-text" href="">{% trans "Resource owner" %}: {{ doc.owner_user.get_full_name }}</div>
31 {% endif %}
32
33 <div class="btn-group navbar-right">
34
35 {% if can_edit %}
36 <a class="btn btn-default navbar-btn" href="{% url 'wiki_editor' doc.pk %}"
37             data-toggle="tutorial" data-tutorial="5" data-placement="bottom"
38             data-content="{% trans "You can edit your resource here." %}">{% trans "Edit" %}</a>
39 <a class="btn btn-default navbar-btn" href="{% url 'catalogue_book_schedule' doc.pk %}"
40             data-toggle="tutorial" data-tutorial="6" data-placement="bottom"
41             data-content="{% trans "You can assign work stages and deadlines to people on your team." %}">{% trans "Schedule" %}</a>
42 <a class="btn btn-default navbar-btn" href="{% url 'catalogue_fork' doc.pk %}"
43             data-toggle="tutorial" data-tutorial="7" data-placement="bottom"
44             data-content="{% trans "You can also create another, independent version of this resource – e.g. for translation to other language or simply for adapting it to your needs." %}"
45 >{% trans "Create another version" %}</a>
46 <a class="btn btn-default navbar-btn" href="{% url 'catalogue_book_owner' doc.pk %}">{% trans "Change owner" %}</a>
47 <a class="btn btn-default navbar-btn" href="{% url 'catalogue_book_delete' doc.pk %}">{% trans "Delete" %}</a>
48
49 {% elif doc %}
50 <a class="navbar-right btn btn-default navbar-btn" href="{% url 'catalogue_fork' doc.pk %}"
51             data-toggle="tutorial" data-tutorial="7" data-placement="bottom"
52             data-content="{% trans "You can create and edit another, independent version of this resource – e.g. for translation to other language or simply for adapting it to your needs." %}"
53 >{% trans "Create another version" %}</a>
54 {% endif %}
55
56 </div>
57
58 </div>
59 </div>
60
61 {% if preview or can_edit and revision == published_revision %}
62 <div class="jumbotron" style="margin-bottom: 20px;">
63 <p style="text-align: center">
64     
65 {% if specific %}
66 {% url 'catalogue_html' doc.pk as url %}
67 {% blocktrans %}This is a preview of a specific revision of <a href="{{ url }}">this resource</a>.{% endblocktrans %}<br>
68 {% endif %}
69
70 {% if revision.pk != doc.revision.pk and doc.revision.pk != published_revision.pk %}
71 {% url 'catalogue_preview' doc.pk as url %}
72 {% blocktrans %}There have been some changes since this revision. <a href="{{ url }}">See the current revision.</a>{% endblocktrans %}<br>
73 {% endif %}
74
75 {% if published_revision %}
76     {% if published_revision != revision %}
77         {% url 'catalogue_html' doc.pk as url %}
78         {% blocktrans %}This resource has a <a href="{{ url }}">published version</a>.{% endblocktrans %}
79     {% endif %}
80 {% else %}
81     {% trans "This resource hasn't been published yet." %}
82 {% endif %}
83
84 </p>
85
86 {% if can_edit and not revision == published_revision %}
87     <form onsubmit="return confirm('{% trans "Do you really want to publish this revision?" %}');" method="POST" action="{% url 'catalogue_publish' doc.pk %}" style="text-align: center;">
88         {% csrf_token %}
89         <input type="hidden" name="textpublish-revision" value="{{ revision.pk }}">
90         <button class="btn btn-default btn-warning"
91             data-toggle="tutorial" data-tutorial="1" data-placement="bottom"
92             data-content="{% trans "When the resource is ready for use, you can mark its specific revision as published here." %}"
93 >{% trans "Publish this revision" %}</button>
94     </form>
95 {% endif %}
96 {% if can_edit and revision == published_revision %}
97     <form onsubmit="return confirm('{% trans "Do you really want to undo publishing this resource?" %}');" method="POST" action="{% url 'catalogue_unpublish' doc.pk %}" style="text-align: center;">
98         {% csrf_token %}
99         <button class="btn btn-default btn-danger"
100             data-toggle="tutorial" data-tutorial="1" data-placement="bottom"
101             data-content="{% trans "If you have published the resource by mistake, you can un-publish it here." %}"
102         >{% trans "Undo publishing this resource" %}</button>
103     </form>
104 {% endif %}
105
106 </div>
107 {% endif %}
108
109
110
111 <style>
112     #cover {
113         margin-top: -20px;
114         display: block;
115         width: 100%;
116         position: relative;
117
118 {% if doc.meta.cover_url %}
119         height: 300px;
120         background-image: url('{{ doc.meta.cover_url|as_media_for:doc }}');
121         background-repeat: no-repeat;
122         background-size: 100%;
123         background-position: 0 15%;
124 {% else %}
125     height: 150px;
126 {% endif %}
127     }
128     #cover-info {
129         position: absolute;
130         left:0;
131         right:0;
132         bottom: 0;
133         margin: 0;
134         padding: 3em 0 2em 0;
135         color: white;
136 /* IE9 SVG, needs conditional override of 'filter' to 'none' */
137 background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
138 background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%); /* FF3.6+ */
139 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,1))); /* Chrome,Safari4+ */
140 background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
141 background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Opera 11.10+ */
142 background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* IE10+ */
143 background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* W3C */
144 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#000000',GradientType=0 ); /* IE6-8 */
145     }
146 </style>
147 <div id="cover">
148     <div id="cover-info" class="row">
149         <div class="col-md-4 col-md-offset-2">
150 {% trans "Audience" %}: {{ doc.meta.audience|join:", "|default:"–" }}
151         </div>
152         <div class="col-md-4">
153 <a class="btn btn-default" href="{% url 'catalogue_pdf' doc.pk revision.pk %}"
154             data-toggle="tutorial" data-tutorial="2" data-placement="top"
155             data-content="{% trans "You can download and share a PDF version." %}"
156 >{% trans "Download PDF" %}</a>
157           <a class="btn btn-default" href="{% url 'catalogue_epub' doc.pk revision.pk %}"
158             data-toggle="tutorial" data-tutorial="3" data-placement="top"
159             data-content="{% trans "You can also download an ebook version as EPUB…" %}"
160 >{% trans "Download EPUB" %}</a>
161           <a class="btn btn-default" href="{% url 'catalogue_mobi' doc.pk revision.pk %}"
162             data-toggle="tutorial" data-tutorial="4" data-placement="top"
163             data-content="{% trans "…and MOBI." %}"
164 >{% trans "Download MOBI" %}</a>
165         </div>
166     </div>
167 </div>
168
169 <div id="digcontent"
170             data-toggle="tutorial" data-tutorial="9" data-placement="top"
171             data-content="{% trans "And, of course, you can read and share the resource in a handy webpage form right here." %}"
172 >
173     {{ block.super }}
174 </div>
175
176
177
178
179 {% endblock %}
180
181 {% block inner_content %}
182         {{ html|safe }}
183 {% endblock %}