summaryrefslogtreecommitdiff
path: root/imdb-lookup/index.jinja2.html
blob: 019e937c01a999aea20f25df52be56f9a15d4108 (plain)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>{{title}}</title>
        <style>
            .box {
                margin: 2em 5em auto;
                border-radius: 5px;
                border: 2px solid gray;
                box-shadow: 0px 0px 30px 0px gray;
                background-color: #fafafa;
                clear: both;
            }
            .td1 {
                width: 1em;
                font-size: 18pt;
                padding: 5px;
            }
            .td2 {
                margin: 10px;
                width: 185px;
                float: left;
                min-height: 200px;
                box-shadow: 0px 0px 5px 0px gray;
            }
            .td3 { padding-left: 2em; }
            .td3 table td { padding: .2em; }
        </style>
    </head>
    <body>
        {% for (filename, imdb_id) in input %}
            {% set info = tmdbcache.infos(imdb_id) %}</h2>
            {% set posterBase64 = tmdbcache.poster_base64(info['poster_path']) %}
            {% if info %}
            <div class="box">
                <table>
                    <tr>
                        {% if "vote_average" in info.keys() %}
                        <td class="td1">
                            <span style="color:gray;">{{ " ".join(["☆"] * (10-int(info["vote_average"]))) }}</span>
                            <span style="color: #ffd700;">{{ " ".join(["★"] * int(info["vote_average"])) }}</span>
                        </td>
                        {% endif %}
                        <td class="td2">
                            {% if posterBase64 %}
                            <a href="{{urlencode(filename)}}"><img src="{{ posterBase64 }}" /></a>
                            {% else %}
                            <span> no image </span>
                            {% endif %}
                        </td>
                        <td class="td3">
                            <div style="font-size: 2em;">{{ info.title }}</div>
                            <div style="font-size: 1.2em;">{{ info.overview }}</div>
                            <table style="padding: 2em;">
                                {% for (key, value) in info.items() %}
                                {% if key in ['runtime','adult','homepage','release_date','original_title'] %}
                                <tr>
                                    <td style="font-style: italic;">{{ key }}</td>
                                    <td>{{ value }}</td>
                                </tr>
                                {% endif %}
                                {% endfor %}
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
            {% else %}
            <span>No infos for {{filename}} {{imdb_id}}</span>
            {% endif %}
        {% endfor %}
    </body>
</html>