diff --git a/project/controllers/library.py b/project/controllers/library.py index 46fe19a649ee4b326738c96dbaf7fcb493f1e722..81a74e1d908e2b6ae1ba723f8528325e1bad4605 100644 --- a/project/controllers/library.py +++ b/project/controllers/library.py @@ -44,7 +44,14 @@ def removelibraryItem(name, index,user=None): movie = library.hydrateUnit(index) if not movie: return jsonify(response='error',message='Unable to find the given Movie in Library %s' % library.name),404 - library.removeUnit(movie) + + if library.name == 'Master': + libraries = Library.objects(user=user,unit='Movie') + for library in libraries: + library.removeUnit(movie) + else: + library.removeUnit(movie) + return jsonify(response='success',type='redirect',path=url_for(endpoint='library',name=name,_external=True)) @app.route('/libraries/<name>/add', methods=['POST']) diff --git a/project/static/css/style.css b/project/static/css/style.css index c467639afa2569617ed7e638514ab019644f3da4..c803093cfdb9ece5c9c2c0a0ab36899bdebedf59 100644 --- a/project/static/css/style.css +++ b/project/static/css/style.css @@ -25,4 +25,27 @@ html,body { .adjust-left { padding-right: 5%; +} + +.movie-select { + padding: 10px 15px 0px 20px; + border-radius: 15px; + background-color: darkslategray; + margin: 5px; + width: 30%; + height: 200px; + overflow: hidden; +} + +.movie-select.selected { + background-color: slategray; +} + +.clearfix { + float: none !important; +} + +#results { + max-height: 500px; + overflow-y: scroll; } \ No newline at end of file diff --git a/project/templates/library/addmovie_modal.html b/project/templates/library/addmovie_modal.html index 5e3d49fa8a2df15635a4197bf7e2d6db013f5440..2b943bdaf11e8c03fdb50cd74f3aee3d32d479e9 100644 --- a/project/templates/library/addmovie_modal.html +++ b/project/templates/library/addmovie_modal.html @@ -11,7 +11,7 @@ </form> </div> </div> - <div id="results" class="row well col-md-10 col-md-offset-1"> + <div id="results" class="clearfix well col-md-10 col-md-offset-1"> Search for your movie! </div> <div class="hidden"> @@ -45,6 +45,8 @@ listMovies($results,movies); $results.on('click','.movie-select',function(){ var id = $(this).data('id'); + $('.selected').removeClass('selected'); + $(this).addClass('selected'); $addForm.find('input').val(id); }); }, @@ -63,9 +65,9 @@ var html = ""; for (var i = movies.length - 1; i >= 0; i--) { movie = movies[i]; - html += "<div class='col-md-3 movie-select' data-id='"+movie['id']+"'>"; + html += "<div title='"+movie['title']+"' class='col-md-4 movie-select' data-id='"+movie['id']+"'>"; html += "<img class='img-thumbnail' src='"+movie['poster']+"'/>"; - html += "<h3>"+movie['title']+"</h3>"; + html += "<h6>"+movie['title']+"</h6>"; html += "</div>"; }; list.html(html);