-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbook.tpl
55 lines (54 loc) · 1.99 KB
/
book.tpl
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
%import markdown
%from datetime import date
<!DOCTYPE html>
<html>
<head>
<title>{{book['title']}}</title>
<link rel="icon" href="/static/favicon.png">
<link rel="stylesheet" href="/static/style.css">
</head>
<body>
<a class="lnav" href="/">< all books</a>
<h1>{{book['title']}} - {{book['author']}}</h1>
<h3>{{book['subtitle']}}</h3>
<h3>{{book['started']}} – {{book['finished'] or 'Unfinished'}}</h3>
<div>
{{!' | '.join('<span class="bookmark">{date}: {location}</span>'.format(**bookmark) for bookmark in bookmarks)}}
%if not book['finished']:
%if bookmarks:
|
%end
<form action="/{{book['isbn']}}/add_bookmark" method="post" style="display: inline">
<input type="date" name="date" value="{{date.today().isoformat()}}">:
<input type="text" name="location">
<input type="submit" value="Add bookmark">
</form>
%end
</div>
%for i, quote in enumerate(quotes):
<div{{!' id="last"' if (i == len(quotes) - 1) else ''}}>
<hr>
<div class="markdown">
{{!markdown.markdown(quote['quote'])}}
</div>
---
<p class="footer">
{{quote['location']}}<br>
{{quote['date']}}
</p>
</div>
%end
<hr>
%if not book['finished']:
<form action="/{{book['isbn']}}/add_quote" method="post">
<p><textarea name="quote"></textarea></p>
---
<p>
<input type="text" name="location"><br>
<input type="date" name="date" value="{{date.today().isoformat()}}">
</p>
<input type="submit" value="Add quote">
</form>
%end
</body>
</html>