Skip to content

Commit 656e886

Browse files
author
Hal Eisen
committed
ADFA-5205 storing the pebble template for dynamic bookshelf
1 parent c7e7f74 commit 656e886

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html>
2+
<html lang="en-us">
3+
<head>
4+
<style type="text/css">
5+
.filelink { background-color: yellow; }
6+
.weblink { background-color: cyan; }
7+
</style>
8+
{% macro expandBooks(result, category) %}
9+
{% for item in result %}
10+
{% if item.category == category %}
11+
<h1>Category: {{ category }}</h1>
12+
{% if item.description != '' %}
13+
<h2>Description: {{ item.description }}</h2>
14+
{% endif %}
15+
{% for book in item.books %}
16+
<p>
17+
{% if book.pdf == 1 %}
18+
<a href="/p/web/viewer.html?file=/{{ book.link }}" target="_blank" class="filelink">{{ book.title }}</a>
19+
{% if book.description != '' %}
20+
({{ book.description }} <i>PDF</i>)
21+
{% endif %}
22+
{% else %}
23+
<a href="/{{ book.link }}" target="_blank" class="weblink">{{ book.title }}</a>
24+
{% if book.description != '' %}
25+
({{ book.description }})
26+
{% endif %}
27+
{% endif %}
28+
</p>
29+
{% endfor %}
30+
{% endif %}
31+
{% endfor %}
32+
{% endmacro %}
33+
34+
</head><body><p>The following books and reference materials are included with Code on the Go.</p>
35+
{{ expandBooks(result, 'Android') }}
36+
{{ expandBooks(result, 'Java') }}
37+
{{ expandBooks(result, 'Kotlin') }}
38+
{{ expandBooks(result, 'C and C++') }}
39+
{{ expandBooks(result, 'Pebble') }}
40+
</body></html>

0 commit comments

Comments
 (0)