diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2014-11-22 22:50:12 +0100 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2014-11-22 22:50:12 +0100 |
commit | 85ed124b5d9a189d2eceb512c545f57b29e428de (patch) | |
tree | d85264a515a9f8fc31c1928d02645c06ddd5e0e5 /imdb-lookup/index.jinja2.html | |
parent | c08d2b4a03f89c6fe5384474febb2e2f93a25ee2 (diff) | |
download | scripts-85ed124b5d9a189d2eceb512c545f57b29e428de.tar.gz scripts-85ed124b5d9a189d2eceb512c545f57b29e428de.zip |
links to movies sites
Diffstat (limited to 'imdb-lookup/index.jinja2.html')
-rw-r--r-- | imdb-lookup/index.jinja2.html | 189 |
1 files changed, 118 insertions, 71 deletions
diff --git a/imdb-lookup/index.jinja2.html b/imdb-lookup/index.jinja2.html index 019e937..b318b83 100644 --- a/imdb-lookup/index.jinja2.html +++ b/imdb-lookup/index.jinja2.html @@ -2,75 +2,122 @@ "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> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>{{title}}</title> + <style> + .box { + margin: 2em 5em auto; + border-radius: 5px; + box-shadow: 0px 0px 30px 0px gray; + background-color: #fafafa; + clear: both; + } + .error { + background-color: #EFAAAA; + } + .td1, .td2, .td3 { + width: 1em; + font-size: 18pt; + padding: 5px; + } + .td1 .on { color: #ffd700; } + .td2 .on { color: blue; } + .td1, .td2 .off { color: gray; } + .poster { + margin: 10px; + width: 185px; + float: left; + min-height: 200px; + box-shadow: 0px 0px 5px 0px gray; + } + .infos { + padding-left: 2em; + vertical-align: top; + } + .infos table td { padding: .2em; } + </style> + </head> + <body> + {% for (filename, imdb_id) in input %} + {% set info = tmdbcache.infos(imdb_id) %}</h2> + {% if info %} + {% set age = gmtime.tm_year - int(info['release_date'].split('-')[0]) %} + {% set centuries = int(age / 10) %} + {% set posterBase64 = tmdbcache.poster_base64(info['poster_path']) %} + <div class="box"> + <table> + <tr> + {% if "vote_average" in info.keys() %} + <td class="td1"> + <span class="off">{{ " ".join(["☆"] * (10-int(info["vote_average"]))) }}</span> + <span class="on">{{ " ".join(["★"] * int(info["vote_average"])) }}</span> + </td> + <td class="td2"> + <span class="off">{{ " ".join(["☆"] * (10-int(info["popularity"]*10))) }}</span> + <span class="on">{{ " ".join(["★"] * int(info["popularity"]*10)) }}</span> + </td> + <td class="td3"> + <span class="off">{{ " ".join([" "] * (10-centuries)) }}</span> + <span class="on">{{ " ".join(["⌚"] * centuries) }}</span> + </td> + {% endif %} + <td class="poster"> + {% if posterBase64 %} + <a href="{{urlencode(filename)}}"><img src="{{ posterBase64 }}" /></a> + {% else %} + <span> no image </span> + {% endif %} + </td> + <td class="infos"> + <div style="font-size: 2em;"> + {{ info.title }} + {% if info.title != info.original_title %} +  ({{ info.original_title }}) + {% endif %} + </div> + <div>{{ info.overview }}</div> + <table style="padding: 2em;"> + {% if 'runtime' in info %} + <tr> + <td style="font-style: italic">Runtime</td> + <td>{{ info['runtime'] }}</td> + </tr> + {% endif %} + {% if 'homepage' in info %} + <tr> + <td style="font-style: italic">Homepage</td> + <td><a href="{{ info['homepage'] }}">{{ info['homepage'] }}</a></td> + </tr> + {% endif %} + <tr> + <td style="font-style: italic">Release</td> + <td>{{ info['release_date'] }} {% if age > 0 %}  ({{ age }} year{% if age > 1 %}s{% endif %}   old){% endif %}</td> + </tr> + <tr> + <td colspan="2"> + <a href="http://www.themoviedb.org/movie/{{ info.id }}" rel="noreferrer">→ themoviedb.org</a> +   + <a href="http://www.imdb.com/title/{{ info.imdb_id }}" rel="noreferrer">→ imdb.com</a> +   + <a href="http://letterboxd.com/tmdb/{{ info.id }}" rel="noreferrer">→ letterboxd.com</a> +   + <a href="http://www.ofdb.de/view.php?page=suchergebnis&Kat=IMDb&SText={{ info.imdb_id }}" rel="noreferrer">→ ofdb.db</a> + </td> + </tr> + </table> + </td> + </tr> + </table> + </div> + {% else %} + <div class="box error"> + No infos for {{filename}} {{imdb_id}} + </div> + {% endif %} + {% endfor %} + </body> </html> +<!-- +vim: tabstop=1 expandtab shiftwidth=1 softtabstop=1: +--> |