-
Notifications
You must be signed in to change notification settings - Fork 0
/
chapters.html
90 lines (70 loc) · 2.52 KB
/
chapters.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{% extends "main.html" %}
{% block title %}Book: {{book.title|escape}}{% endblock %}
{% block menu %}
<li><a href="/books">Books</a></li>
<li><a href="/book-preview?key={{book.key}}">Preview this book</a></li>
<li><a href="/book-edit?key={{book.key}}">Edit book details</a></li>
{% endblock %}
{% block body %}
<p class="floating-cover">
<a href="/book-edit?key={{book.key}}"><img src="{% if book.cover_url %}{{book.cover_url}}{% else %}/static/images/sample-cover.jpg{% endif %}" alt="cover image for {{book.title|escape}}"/><br />
Click to edit
</a>
</p>
<div style="margin-left: 100px;">
<h2>{{book.title|escape}}</h2>
{% if chapters %}
<div class="conversion" id="generation">
{% if book.converting %}
<p class="wait"><em>Generating ebook file...</em></p>
{% else %}
{% ifequal book.conversion_status "OK" %}
{% if book.conversion_key %}
<p class="download"><a href="/final-serve/{{book.title|urlencode}}.mobi?key={{book.key}}"><strong>Download generated e-book</strong></a> (generated <em>{{book.conversion_time}} GMT</em>)</p>
{% endif %}
{% else %}
{% ifequal book.conversion_status "ERROR" %}
<p>E-book generation failed</p>
<p>Log:</p>
<pre>{{book.conversion_errors}}</pre>
{% endifequal %}
{% endifequal %}
<p class="generate">
<a href="javascript:void(0)" onclick="generate('{{book.key}}')">Generate a new e-book file</a>
</p>
{% endif %}
</div>
{% else %}
<div class="conversion">
<b>NB!</b> You need to <a href="/chapter-add?book={{book.key}}">add chapters</a> before you can generate an ebook file!
</div>
{% endif %}
</div>
<div style="clear: both;"></div>
{% if specials %}
<h3 class="underline">Special pages</h3>
<ul>
{% if book.use_index %}
<li><a href="/chapter-index?book={{book.key}}">Index page</a></li>
{% endif %}
{% if book.use_toc %}
<li><a href="/chapter-toc?book={{book.key}}">Table of contents</a></li>
{% endif %}
{% if book.use_copyright %}
<li><a href="/chapter-copyright?book={{book.key}}">Copyright info</a></li>
{% endif %}
</ul>
{% endif %}
<h3 class="underline">Chapters</h3>
{% if chapters %}
<ul>
{% for chapter in chapters %}
<li><a href="/chapter?key={{chapter.key}}">Chapter {{forloop.counter}}.{% if chapter.title %} {{chapter.title}}{%endif%}</a></li>
{% endfor %}
</ul>
<p class="plus"><a href="/chapter-add?book={{book.key}}">Add another</a></p>
{% else %}
<p><em>No chapters yet!</em></p>
<p class="plus"><a href="/chapter-add?book={{book.key}}">Add one!</a></p>
{% endif %}
{% endblock %}