From 1212430927e2ae20874eacbae5915c40a7e9bee2 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Mon, 30 Mar 2015 00:22:47 +0200 Subject: grid variant --- movietool/__init__.py | 14 ++++++++-- movietool/html/movies-files/css/style.css | 43 +++++++++++++++++++++++++++++++ movietool/html/movies-files/js/app.js | 1 + movietool/html/movies-grid.html | 42 ++++++++++++++++++++++++++++++ 4 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 movietool/html/movies-grid.html (limited to 'movietool') diff --git a/movietool/__init__.py b/movietool/__init__.py index 33a0a5a..6084c70 100755 --- a/movietool/__init__.py +++ b/movietool/__init__.py @@ -345,8 +345,15 @@ def do_index(args, imdb_ids): out = os.path.join("movies-files/poster", imdb_id+".jpg") open(out, "wb").write(data) return out - else: - return None + return None + + def poster_grid(imdb_id): + data = db.poster_low(imdb_id, format="w154") + if data: + out = os.path.join("movies-files/poster", imdb_id+"-grid.jpg") + open(out, "wb").write(data) + return out + return None def compile_summary(imdb, omdb, tmdb): buf = [] @@ -373,6 +380,7 @@ def do_index(args, imdb_ids): 'title': tmdb['title'], 'summary': compile_summary(imdb, omdb, tmdb), 'poster': poster(imdb_id), + 'posterGrid': poster_grid(imdb_id), 'tagline': 'tagline' in imdb and imdb['tagline'] or None, 'plot': 'plot' in imdb and imdb['plot']['outline'] or None, 'website': 'homepage' in imdb and imdb['homepage'] or omdb['Website'] != 'N/A' and omdb['Website'] or None, @@ -393,8 +401,10 @@ def do_index(args, imdb_ids): datadir = os.path.join(os.path.dirname(__file__), "html") index_files = os.path.join(datadir, "movies-files") index_html = os.path.join(datadir, "movies.html") + index_html_grid = os.path.join(datadir, "movies-grid.html") shutil.copytree(index_files, "movies-files", copy_function=shutil.copyfile) shutil.copyfile(index_html, "movies.html") + shutil.copyfile(index_html_grid, "movies-grid.html") os.mkdir("movies-files/poster") write_data("dataCb") diff --git a/movietool/html/movies-files/css/style.css b/movietool/html/movies-files/css/style.css index 6f95335..7ff5474 100644 --- a/movietool/html/movies-files/css/style.css +++ b/movietool/html/movies-files/css/style.css @@ -89,3 +89,46 @@ font-weight: bold; border: 1px solid #a0a0a0; border-radius: 4px; } +/* grid variant */ +.grid-poster { + margin: 10px 20px auto; + border-radius: 5px; + box-shadow: 0px 0px 15px 0px gray; + background-color: #fafafa; + float: left; + + margin: 10px; + width: 154px; + float: left; + height: 231px; +} +.grid-poster > .grid-label { + width: 154px; + position: relative; + font-size: 3pt; + text-align: center; + color: #fafafa; +} +.grid-poster:hover > .grid-label { + width: 180px; + z-index: 10; + font-size: 23pt; + color: black; + border-radius: 5px; + box-shadow: 0px 0px 15px 0px gray; + background-color: #fafafa; +} +.grid { + padding-bottom: 100px; + padding-top: 30px; +} +.grid-filter { + text-align: center; + width: 100%; + position: fixed; + padding-top: 5px; +} +.grid-filter > input { + box-shadow: 0px 0px 5px 0px gray; + background-color: #fafafa; +} \ No newline at end of file diff --git a/movietool/html/movies-files/js/app.js b/movietool/html/movies-files/js/app.js index a3a9632..9b380d9 100644 --- a/movietool/html/movies-files/js/app.js +++ b/movietool/html/movies-files/js/app.js @@ -13,6 +13,7 @@ App.Movie = DS.Model.extend({ summary: DS.attr('string'), path: DS.attr('string'), poster: DS.attr('string'), + posterGrid: DS.attr('string'), tagline: DS.attr('string'), plot: DS.attr('string'), website: DS.attr('string'), diff --git a/movietool/html/movies-grid.html b/movietool/html/movies-grid.html new file mode 100644 index 0000000..7e63ccb --- /dev/null +++ b/movietool/html/movies-grid.html @@ -0,0 +1,42 @@ + + + + + Movies + + + + + + + + + + + + -- cgit v1.2.1