diff options
Diffstat (limited to 'imdb-lookup/index.jinja2.html')
-rw-r--r-- | imdb-lookup/index.jinja2.html | 251 |
1 files changed, 65 insertions, 186 deletions
diff --git a/imdb-lookup/index.jinja2.html b/imdb-lookup/index.jinja2.html index 23e75fc..f19fdd0 100644 --- a/imdb-lookup/index.jinja2.html +++ b/imdb-lookup/index.jinja2.html @@ -1,232 +1,111 @@ -<!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> +<!DOCTYPE html> +<html lang="en"> <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta charset="utf-8"> <title>{{title}}</title> - <style> - .box { - margin: 20px 50px auto; - border-radius: 5px; - box-shadow: 0px 0px 15px 0px gray; - background-color: #fafafa; - clear: both; - position: relative; - } - .error { - background-color: #EFAAAA; - height: 150px; - } - .td1, .td2, .td3, .td4, .td5 { - width: 1em; - font-size: 16pt; - margin: 2px; - vertical-align: top; - } - .td1 .on { color: rgba(0,0,0,0); } - .td2 .on { color: blue; } - .td3 .on { color: rgba(0,0,0,0); } - .td4 .on { color: black; } - .td1 .off, .td2 .off, .td4 .off, .td5 .off{ color: #c0c0c0; } - .off div { - opacity: 0.1; - } - .imdb { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABWklEQVQ4y6VTu0oDQRQ9uxslARM3SSGkEbLtNpLGRyeW/oP6ARYWoq34ATaLP2AVsRS7iE0QhNgYSCCRaKGCCIYksM/JtZidNZvd4CMHhjMM99x77swd6fZcJUyBRN9JY6oEALC6NhscMOazy9nzfHa/RZ7Dudl2eII44U9iES8NOhr9pWqk0OFulgBQ2SgQAFIzMr0/aASAAJBxvBDsS3qSGpUiAaD2jUaNSpHk8Uvp9oZottzIZZWNAmp1C6dnnwAAl/HHSwi7AmpGxs7eG9SMjG5vGJyX9FQo7ujkA60nBxEH+ayCx2cX+awS+2yi99y8glrdiiZYXkqFmPkOhWWBjZU5AIDMxtrNqUqIBe7urVhHEQeb62loizORwK39V5T0ZFB5++CFz0GnqtFob8Iqs6WR6aTQLAjYJiBfXPUnihmjWLFt8lVtDPgo/7aqbU74TJfXg3//xi8q0rI5o/Rj/gAAAABJRU5ErkJggg==) no-repeat center; - } - .tomato { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACd0lEQVQ4y4WTS0iUYRSGn/+fcUQdzZwZRnDUmsYLUUQXaooC29uiaFVUFLQLXGSSRJtoJ102rSKiWtSmC7SLLi4iUhdBhKBoVmqW02/jODPOzPd/32nhrWiyszrn5ZyXc3kPrGJbu+Id/MfsYmD8WKsF4M+qSwfObY2vRuApBm5rX39056HoLTM8G6pcVxmN7qurHuqdHCiWay054c211O8N1YUrfc9qass2Dg3nTNXgD7va76O6LZwPOoWrnXcTN4NTH8eKEgDcObm983nU1yOlNqbUQ85xCTWVEXw3R1nK5X2Djy1z8vBCT99hJxIjMDGyQtC7pfn6dIXdcWDKxecVjnc30PRqhs+tFRDycePiODbwotbGCZT0HX85GAewnEgMYJcNb03Yw/NmH08aS6nHors/DZ8U50+HOfIgwSbHLCxOQFucAm5bAE4k9pRyq93T4qO8sQJvqBylNLnJDHp0noGcgAU7Jt3fJ3YCEyNBLwBCO+UWVqWXQrAMWsKYZBY7qxB/nt3jBcZKVyoFUEgAwLuMasAVUBqdzCLzCpRGtKCASFqW03IipGQh9i7e4g0Z2WNmXKyvWWTeXSCaziM/DShBgDxCRoSfxpARowG8CdYAXKEge8wXhSjB9ucRDeK4yHeNArIipMQwYwzftUK0exnA0un+Eo9/p3IisVdAG7KoDllsF2EOIWk0Ca355uZJF/LjnelUA4C9WExgYmQ/8BhrYUk5S0hi+GY0465itJDnQyZFIpt5dzYUi96vqvlTiUvKSkRi8XmRrlkxB6eNJqEVSaVIqtxrv1jXzmTnHt2pquFEaqb4d03Ubfjn592rWvsX9guv1i7Q6dsNWAAAAABJRU5ErkJggg==) no-repeat center; - } - .poster { - margin: 10px; - width: 154px; - float: left; - min-height: 200px; - box-shadow: 0px 0px 5px 0px gray; - } - .info { - padding-left: 5px; - vertical-align: top; - } - .info table td { padding: .2em; } - .details { padding: 0.5em; } - .files { - list-style: none; - padding-left: 0px; - font-size: 0.7em; - margin: 0px; - } - .imdbid { - font-family: monospace; - padding: 3px; - background-color: #f0f0f0; - border: 1px solid #e0e0e0; - border-radius: 4px; - } - .title { font-size: 2em; } - .headline { font-size: 0.9em; color: 3e3e3e; } - .plot { margin-top: 10px; } - .box-footer { - position: absolute; - bottom: 0px; - right: 0px; - font-size: 1.4em; - color: #ccc; - font-style: italic; - } - .rated { - border: 1px solid black; - border-radius: 5px; - font-size:0.7em; - padding: 2px; - } - </style> + <link rel="stylesheet" href="{{ install("css/normalize.css") }}"> + <link rel="stylesheet" href="{{ install("css/style.css") }}"> </head> <body> - {% for (path, imdb_id) in input %} - {% set info = tmdbcache.infos(imdb_id) %}</h2> - {% set imdb_data = tmdbcache.imdb_movie(imdb_id)['data'] %} - {% set omdb_data = tmdbcache.omdb_movie(imdb_id) %} - {% if info and imdb_data and omdb_data %} - {% set year = info['release_date'] and int(info['release_date'].split('-')[0]) or gmtime.tm_year %} - {% set age = gmtime.tm_year - year %} - {% set centuries = int(age / 10) %} - {% set posterBase64 = tmdbcache.poster_base64(info['poster_path'],'w154') %} - {% set local_title = tmdbcache.alternative_title(imdb_id, "DE") %} - {% set votes = imdb_data['num_votes'] %} - {% set popularity = int( 9*(1 - (1+math.exp(-1))/(1+math.exp(votes/70000.0 -1 ))) + 1 ) %} - {% set fresh = (omdb_data.tomatoMeter != 'N/A') and int(omdb_data.tomatoMeter) or None %} - {% set userMeter = (omdb_data.tomatoUserMeter != 'N/A') and int(omdb_data.tomatoUserMeter) or None %} + {% raw %} + <script type="text/x-handlebars"> + {{outlet}} + </script> + <script type="text/x-handlebars" id="index"> + {{#each movie in model}} <div class="box"> <table> <tr> - {% if "vote_average" in info.keys() %} - <td class="td1" title="IMDB Rating: {{imdb_data.rating}}"> - <span class="off"> - {% for i in range(int(imdb_data.rating),10) %} - <div class="imdb">☆</div> - {% endfor %} - </span> - <span class="on"> - {% for i in range(0, int(imdb_data.rating)) %} - <div class="imdb">★</div> - {% endfor %} - </span> - </td> - {% if userMeter %} - <td class="td2" title="Rotten tomatoes user rating: {{userMeter}}%"> - <span class="off">{{ " ".join(["☆"] * (10-int(userMeter/10))) }}</span> - <span class="on">{{ " ".join(["★"] * int(userMeter/10)) }}</span> - </td> - {% else %} - <td class="td2"></td> - {% endif %} - {% if fresh %} - <td class="td3" title="Rotten tomatoes: {{fresh}}% fresh"> - <span class="off"> - {% for i in range(int(fresh/10),10) %} - <div class="tomato">☆</div> - {% endfor %} - </span> - <span class="on"> - {% for i in range(0, int(fresh/10)) %} - <div class="tomato">★</div> - {% endfor %} - </span> - </td> - {% else %} - <td class="td3"></td> - {% endif %} - <td class="td4" title="IMDB Popularity: {{votes}} votes"> - <span class="off">{{ " ".join(["☆"] * (10-popularity)) }}</span> - <span class="on">{{ " ".join(["★"] * popularity) }}</span> - </td> - <td class="td5" title="Centuries since release"> - <span class="off">{{ " ".join(["⌚"] * (9-centuries)) }}</span> - <span class="on">{{ " ".join(["⌚"] * (centuries + 1)) }}</span> - </td> - {% endif %} <td class="poster"> - {% if posterBase64 %} - <a href="{{urlencode(path)}}"><img src="{{ posterBase64 }}" /></a> - {% else %} + {{#if movie.poster}} + <img {{bind-attr src=movie.poster}} /> + {{else}} <span> no image </span> - {% endif %} + {{/if}} </td> <td class="info"> <div class="title"> - {{ info.title }} + {{movie.title}} </div> <div class="headline"> - {% if local_title != info.title %} “{{ local_title }}”, {% endif %} - {% if info.original_title != info.title %} “{{ info.original_title }}”, {% endif %} + <!-- + {% if local_title != info.title %} “{ local_title }}”, {% endif %} + {% if info.original_title != info.title %} “{ info.original_title }}”, {% endif %} </div> <div class="headline"> - by {{ imdb_data["directors_summary"] | join(", ", attribute="name.name") }}, - runtime {{ info['runtime'] }} min, {{year}} + by { imdb_data["directors_summary"] | join(", ", attribute="name.name") }}, + runtime { info['runtime'] }} min, {year}} {% if omdb_data.Rated != 'N/A' %} - <span class="rated">{{omdb_data.Rated}}</span> + <span class="rated">{omdb_data.Rated}}</span> {% endif %} </div> <div class="headline"> - Starring: {{ imdb_data["cast_summary"] | join(", ", attribute="name.name") }} + Starring: { imdb_data["cast_summary"] | join(", ", attribute="name.name") }} </div> - <div class="plot">{{ "plot" in imdb_data and imdb_data.plot.outline or ""}}</div> + --> + <div class="plot">{{movie.plot}}</div> + <div class="consensus">{{movie.omdbTomatoConsensus}}</div> <table class="details"> - {% if 'homepage' in info and info['homepage'] %} - <tr> - <td colspan="2"> - ➜ <a href="{{ info['homepage'] }}">{{ info['homepage'] }}</a> - </td> - </tr> - {% elif omdb_data.Website != "N/A" %} + {{#if movie.website}} <tr> <td colspan="2"> - ➜ <a href="{{ omdb_data.Website }}">{{ omdb_data.Website }}</a> + ➜ <a {{bind-attr href=movie.website}}>{{movie.website}}</a> </td> </tr> - {% endif %} + {{/if}} <tr> <td colspan="2"> - ➜ <a href="http://www.themoviedb.org/movie/{{ info.id }}" rel="noreferrer">themoviedb.org</a> + ➜ <a {{bind-attr href=movie.linkTmdb}} rel="noreferrer">themoviedb.org</a>   - ➜ <a href="http://www.imdb.com/title/{{ info.imdb_id }}" rel="noreferrer">imdb.com</a> + ➜ <a {{bind-attr href=movie.linkImdb}} rel="noreferrer">imdb.com</a>   - ➜ <a href="http://letterboxd.com/tmdb/{{ info.id }}" rel="noreferrer">letterboxd.com</a> + ➜ <a {{bind-attr href=movie.linkLetterboxd}} 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> + ➜ <a {{bind-attr href=movie.linkOfdb}} rel="noreferrer">ofdb.db</a>   - ➜ <span class="imdbid">{{ info.imdb_id }}</span> + ➜ <span class="imdbid">{{movie.id}}</span> </td> </tr> </table> <ul class="files"> - {% for file in listMovieFiles(path) %} - <li> - {% set pathElements = file.split("/") %} - {% for i in range(1,pathElements.__len__()) %} - ➜ - <a href="{{urlencode(pathjoin(*pathElements[:i+1]))}}"> - {{ pathElements[i] }} - </a> - {% endfor %} - </li> - {% endfor %} + {{#each file in movie.movieFiles}} + <li>{{filelink file}}</li> + {{/each}} </ul> </td> + <td class="ratings"> + <table> + <tr><td>IMDB</td><td>{{movie.imdbRating}}</td></tr> + <tr><td>IMDB votes</td><td>{{movie.imdbVotes}}</td></tr> + {{#if movie.omdbTomatoFresh}} + <tr><td>Fresh</td><td>{{movie.omdbTomatoFresh}}</td></tr> + {{/if}} + {{#if movie.omdbTomatoRating}} + <tr><td>RT</td><td>{{movie.omdbTomatoRating}}</td></tr> + {{/if}} + {{#if movie.omdbTomatoUserRating}} + <tr><td>RT User</td><td>{{movie.omdbTomatoUserRating}}</td></tr> + {{/if}} + {{#if movie.omdbTomato}} + <tr><td>Meter</td><td>{{movie.omdbTomato}}%</td></tr> + {{/if}} + {{#if movie.omdbUserTomato}} + <tr><td>Meter User</td><td>{{movie.omdbUserTomato}}%</td></tr> + {{/if}} + </table> + </td> </tr> </table> <div class="box-footer"> - {{ info.tagline and info.tagline or "" }} + {{movie.tagline}} </div> </div> - {% else %} - <div class="box error"> - No infos for <a href="{{path}}">{{path}}</a> {{imdb_id}} - </div> - {% endif %} - {% endfor %} + {{/each}} + </script> + {% endraw %} + + <script type="text/javascript" src="{{ install("js/all.min.js") }}"></script> + <script type="text/javascript" src="{{ data('dataCb') }}"></script> </body> </html> <!-- |