From b310898696202fafc63fab3349d13c7f9a16fa40 Mon Sep 17 00:00:00 2001 From: Sahana Murthy Date: Tue, 13 Jun 2017 16:05:34 -0700 Subject: [PATCH 01/22] initial backbone setup created. Movies header showing, but list of movies not showing --- build/index.html | 14 ++++++++++++++ src/app.js | 14 +++++++++----- src/collections/movie_list.js | 13 +++++++++++++ src/models/movie.js | 16 ++++++++++++++++ src/views/movie_list_view.js | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 src/collections/movie_list.js create mode 100644 src/models/movie.js create mode 100644 src/views/movie_list_view.js diff --git a/build/index.html b/build/index.html index 03869595f..5736b832c 100644 --- a/build/index.html +++ b/build/index.html @@ -9,6 +9,20 @@ +
+

Movies!

+
+ +
+
+ +
+ + + + diff --git a/src/app.js b/src/app.js index 58b77997c..069287535 100644 --- a/src/app.js +++ b/src/app.js @@ -1,12 +1,16 @@ -// /src/app.js - -// Import jQuery & Underscore import $ from 'jquery'; import _ from 'underscore'; +import MovieList from 'collections/movie_list'; +import MovieListView from 'views/movie_list_view'; + +var myMovieList = new MovieList(); +myMovieList.fetch(); -// ready to go $(document).ready(function() { - $('section.main-content').append('

Hello World!

'); + var myMovieListView = new MovieListView ({ + model: myMovieList, + el: 'main' + }) }); diff --git a/src/collections/movie_list.js b/src/collections/movie_list.js new file mode 100644 index 000000000..5651bf234 --- /dev/null +++ b/src/collections/movie_list.js @@ -0,0 +1,13 @@ +import Backbone from 'backbone'; + +import Movie from 'models/movie'; + +var MovieList = Backbone.Collection.extend({ + model: Movie, + url: "http://localhost:3000/movies", + parse: function(data) { + return data.movies; + } +}); + +export default MovieList; diff --git a/src/models/movie.js b/src/models/movie.js new file mode 100644 index 000000000..6442d9ad4 --- /dev/null +++ b/src/models/movie.js @@ -0,0 +1,16 @@ +import Backbone from 'backbone'; + +var Movie = Backbone.Model.extend({ + defaults: { + title: "Unknown", + overview: "Unknown", + release_date: "Unknown", + inventory: "Unknown" + }, + initialize: function(options) { + console.log("Created new movie with options " + this.options); + } + +}); + +export default Movie; diff --git a/src/views/movie_list_view.js b/src/views/movie_list_view.js new file mode 100644 index 000000000..d58efe511 --- /dev/null +++ b/src/views/movie_list_view.js @@ -0,0 +1,32 @@ +import $ from 'jquery'; +import _ from 'underscore'; +import Backbone from 'backbone'; +// import MovieView from './movie_view'; +import Movie from '../models/movie.js'; + +var MovieListView = Backbone.View.extend({ + initialize: function(options) { + this.template = _.template($('#movie-template').html()); + this.listenTo(this.model, 'update', this.render); + // this.listElement = this.$('.movie-list'); + }, + + render: function() { + this.$('#movie-list').empty(); + + var self = this; + + this.model.forEach(function(rawMovie) { + var movieView = new MovieView({ + model: movie, + template: self.template + }); + + self.$("#movie-list").append(movieView.render().$el); + }); + + return this; + } +}); + +export default MovieListView; From 13bfd4ffeee73cdc32752920a5bf9cb0f25b57f1 Mon Sep 17 00:00:00 2001 From: Sahana Murthy Date: Tue, 13 Jun 2017 16:26:14 -0700 Subject: [PATCH 02/22] Movies from rails database showing up on localhost:8081 --- src/collections/movie_list.js | 6 +++--- src/views/movie_list_view.js | 4 ++-- src/views/movie_view.js | 21 +++++++++++++++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 src/views/movie_view.js diff --git a/src/collections/movie_list.js b/src/collections/movie_list.js index 5651bf234..5504e753e 100644 --- a/src/collections/movie_list.js +++ b/src/collections/movie_list.js @@ -5,9 +5,9 @@ import Movie from 'models/movie'; var MovieList = Backbone.Collection.extend({ model: Movie, url: "http://localhost:3000/movies", - parse: function(data) { - return data.movies; - } + // parse: function(data) { + // return data.movies; + // } }); export default MovieList; diff --git a/src/views/movie_list_view.js b/src/views/movie_list_view.js index d58efe511..0271430d1 100644 --- a/src/views/movie_list_view.js +++ b/src/views/movie_list_view.js @@ -1,7 +1,7 @@ import $ from 'jquery'; import _ from 'underscore'; import Backbone from 'backbone'; -// import MovieView from './movie_view'; +import MovieView from './movie_view'; import Movie from '../models/movie.js'; var MovieListView = Backbone.View.extend({ @@ -16,7 +16,7 @@ var MovieListView = Backbone.View.extend({ var self = this; - this.model.forEach(function(rawMovie) { + this.model.each(function(movie) { var movieView = new MovieView({ model: movie, template: self.template diff --git a/src/views/movie_view.js b/src/views/movie_view.js new file mode 100644 index 000000000..41e792663 --- /dev/null +++ b/src/views/movie_view.js @@ -0,0 +1,21 @@ +import Backbone from 'backbone'; +import $ from 'jquery'; +import _ from 'underscore'; + +var MovieView = Backbone.View.extend({ + initialize: function(options) { + this.template = options.template; + + this.listenTo(this.model, 'change', this.render); + }, + + render: function() { + // console.log(this.model.attributes); + var html = this.template({movie: this.model.toJSON()}); + this.$el.html(html); + + return this; + } +}); + +export default MovieView; From 49ba66d8a982212955cebeae30d55059802005f0 Mon Sep 17 00:00:00 2001 From: Sahana Murthy Date: Wed, 14 Jun 2017 10:35:32 -0700 Subject: [PATCH 03/22] Refactored MovieList collection to accept URL as a parameter --- src/app.js | 2 +- src/collections/movie_list.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app.js b/src/app.js index 069287535..35a7b161f 100644 --- a/src/app.js +++ b/src/app.js @@ -3,7 +3,7 @@ import _ from 'underscore'; import MovieList from 'collections/movie_list'; import MovieListView from 'views/movie_list_view'; -var myMovieList = new MovieList(); +var myMovieList = new MovieList({url: "http://localhost:3000/movies"}); myMovieList.fetch(); $(document).ready(function() { diff --git a/src/collections/movie_list.js b/src/collections/movie_list.js index 5504e753e..a2394425c 100644 --- a/src/collections/movie_list.js +++ b/src/collections/movie_list.js @@ -3,8 +3,10 @@ import Backbone from 'backbone'; import Movie from 'models/movie'; var MovieList = Backbone.Collection.extend({ - model: Movie, - url: "http://localhost:3000/movies", + initialize : function(options){ + this.model = Movie, + this.url = options.url + } // parse: function(data) { // return data.movies; // } From 2f2480274563c930a26fef36fc981462b2bc52ae Mon Sep 17 00:00:00 2001 From: Sahana Murthy Date: Wed, 14 Jun 2017 11:26:57 -0700 Subject: [PATCH 04/22] View Rental library button working --- build/index.html | 1 + src/app.js | 9 +++++---- src/views/movie_list_view.js | 9 +++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/build/index.html b/build/index.html index 5736b832c..14f80082a 100644 --- a/build/index.html +++ b/build/index.html @@ -14,6 +14,7 @@

Movies!

+
    diff --git a/src/app.js b/src/app.js index 35a7b161f..78318e10b 100644 --- a/src/app.js +++ b/src/app.js @@ -3,14 +3,15 @@ import _ from 'underscore'; import MovieList from 'collections/movie_list'; import MovieListView from 'views/movie_list_view'; -var myMovieList = new MovieList({url: "http://localhost:3000/movies"}); -myMovieList.fetch(); +// var myMovieList = new MovieList({url: "http://localhost:3000/movies"}); +// myMovieList.fetch(); +// console.log("fetch"); $(document).ready(function() { - + var myMovieList = new MovieList({url: "http://localhost:3000/movies"}); var myMovieListView = new MovieListView ({ model: myMovieList, el: 'main' - }) + }); }); diff --git a/src/views/movie_list_view.js b/src/views/movie_list_view.js index 0271430d1..01a666caf 100644 --- a/src/views/movie_list_view.js +++ b/src/views/movie_list_view.js @@ -12,6 +12,7 @@ var MovieListView = Backbone.View.extend({ }, render: function() { + console.log("In render"); this.$('#movie-list').empty(); var self = this; @@ -26,6 +27,14 @@ var MovieListView = Backbone.View.extend({ }); return this; + }, + + showList: function() { + this.model.fetch(); + }, + + events: { + "click #rental-library": "showList" } }); From 54eab3de42200d70cb6d1c25545e60d60fa152f0 Mon Sep 17 00:00:00 2001 From: Andrea Valliere Date: Wed, 14 Jun 2017 14:02:35 -0700 Subject: [PATCH 05/22] Adding search functionality --- build/index.html | 6 ++++++ src/app.js | 6 ++++++ src/views/movie_list_view.js | 8 +++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/build/index.html b/build/index.html index 14f80082a..af9d17614 100644 --- a/build/index.html +++ b/build/index.html @@ -17,6 +17,12 @@

    Movies!

      + +
      + + + +
      diff --git a/src/app.js b/src/app.js index 78318e10b..ed839382a 100644 --- a/src/app.js +++ b/src/app.js @@ -14,4 +14,10 @@ $(document).ready(function() { el: 'main' }); + var searchMovieList = new MovieList({url: "http://localhost:3000/movies?query="}); + var searchMovieListView = new MovieListView ({ + model: searchMovieList, + el: 'main' + }); + }); diff --git a/src/views/movie_list_view.js b/src/views/movie_list_view.js index 01a666caf..381c59393 100644 --- a/src/views/movie_list_view.js +++ b/src/views/movie_list_view.js @@ -31,10 +31,16 @@ var MovieListView = Backbone.View.extend({ showList: function() { this.model.fetch(); + console.log("showlist"); + }, + + searchList: function() { + this.model.fetch(); }, events: { - "click #rental-library": "showList" + "click #rental-library": "showList", + "click #search-button": "searchList" } }); From cb07439dfdd02805ad0d33b938b9e9d00cc93217 Mon Sep 17 00:00:00 2001 From: Andrea Valliere Date: Wed, 14 Jun 2017 14:05:56 -0700 Subject: [PATCH 06/22] Gave html sections, fixed loading issue of movies from different sources --- build/index.html | 44 ++++++++++++++++++++++++-------------------- src/app.js | 4 ++-- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/build/index.html b/build/index.html index af9d17614..becd5f28e 100644 --- a/build/index.html +++ b/build/index.html @@ -1,36 +1,40 @@ - - - - - - Backbone Baseline - - + + + + + + Backbone Baseline + + -
      -

      Movies!

      -
      +
      +

      Movies!

      +
      -
      +
      +
        +
        +
        -
        + +
        - - + + - + - - + + diff --git a/src/app.js b/src/app.js index ed839382a..2e0b9501d 100644 --- a/src/app.js +++ b/src/app.js @@ -11,13 +11,13 @@ $(document).ready(function() { var myMovieList = new MovieList({url: "http://localhost:3000/movies"}); var myMovieListView = new MovieListView ({ model: myMovieList, - el: 'main' + el: '#rental' }); var searchMovieList = new MovieList({url: "http://localhost:3000/movies?query="}); var searchMovieListView = new MovieListView ({ model: searchMovieList, - el: 'main' + el: '#movie-db' }); }); From 687fd2b001d11ccb56becbc298092a2a9981c0e5 Mon Sep 17 00:00:00 2001 From: Andrea Valliere Date: Wed, 14 Jun 2017 14:29:44 -0700 Subject: [PATCH 07/22] Added search functions to movie list view. Now getting CORS issue --- src/views/movie_list_view.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/views/movie_list_view.js b/src/views/movie_list_view.js index 381c59393..95929a340 100644 --- a/src/views/movie_list_view.js +++ b/src/views/movie_list_view.js @@ -35,7 +35,25 @@ var MovieListView = Backbone.View.extend({ }, searchList: function() { + var formData = this.readNewSearchForm(); + this.url="http://localhost:3000/movies?query=" + formData; this.model.fetch(); + console.log(formData); + }, + + clearForm: function() { + $('#search').val(''); + }, + + readNewSearchForm: function() { + var formSearch = $('#search').val(); + this.clearForm(); + + var formData = {}; + if (formSearch && formSearch != "") { + formData['search'] = formSearch + } + return formData; }, events: { From 217867f3b750ce53a4a01dad42a3cb1d5f1d7762 Mon Sep 17 00:00:00 2001 From: Andrea Valliere Date: Wed, 14 Jun 2017 14:59:39 -0700 Subject: [PATCH 08/22] Resolved CORS issue by updating API. Still trying to pass query term to search request --- src/app.js | 4 +++- src/views/movie_list_view.js | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app.js b/src/app.js index 2e0b9501d..e1319245b 100644 --- a/src/app.js +++ b/src/app.js @@ -14,7 +14,9 @@ $(document).ready(function() { el: '#rental' }); - var searchMovieList = new MovieList({url: "http://localhost:3000/movies?query="}); + var searchMovieList = new MovieList( + {url: "http://localhost:3000/movies?query="} + ); var searchMovieListView = new MovieListView ({ model: searchMovieList, el: '#movie-db' diff --git a/src/views/movie_list_view.js b/src/views/movie_list_view.js index 95929a340..53e9085e5 100644 --- a/src/views/movie_list_view.js +++ b/src/views/movie_list_view.js @@ -36,9 +36,11 @@ var MovieListView = Backbone.View.extend({ searchList: function() { var formData = this.readNewSearchForm(); - this.url="http://localhost:3000/movies?query=" + formData; - this.model.fetch(); console.log(formData); + var self = this; + self.set( "http://localhost:3000/movies?query=" + formData["search"]); + this.model.fetch(); + }, clearForm: function() { From 05895aaac30fa176e2d1b8528a37453472609ca3 Mon Sep 17 00:00:00 2001 From: Sahana Murthy Date: Wed, 14 Jun 2017 16:03:54 -0700 Subject: [PATCH 09/22] Search feature working --- build/index.html | 5 +++-- src/views/movie_list_view.js | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build/index.html b/build/index.html index becd5f28e..78fc45b34 100644 --- a/build/index.html +++ b/build/index.html @@ -17,14 +17,15 @@

        Movies!

        -
          +
          - +
          +
          diff --git a/src/views/movie_list_view.js b/src/views/movie_list_view.js index 53e9085e5..f3f3fbf9f 100644 --- a/src/views/movie_list_view.js +++ b/src/views/movie_list_view.js @@ -37,10 +37,10 @@ var MovieListView = Backbone.View.extend({ searchList: function() { var formData = this.readNewSearchForm(); console.log(formData); - var self = this; - self.set( "http://localhost:3000/movies?query=" + formData["search"]); + console.log(this.model.url) + var newUrl = this.model.url + formData.search; + this.model.url = newUrl; this.model.fetch(); - }, clearForm: function() { From 9353c5129301ddb4c3fe4def56cc1c722c08aa2c Mon Sep 17 00:00:00 2001 From: Andrea Valliere Date: Wed, 14 Jun 2017 16:18:03 -0700 Subject: [PATCH 10/22] Allowed url to reset with new search term, rather than appending new search term with each new search --- build/index.html | 4 ++-- src/views/movie_list_view.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build/index.html b/build/index.html index 78fc45b34..afc1c7348 100644 --- a/build/index.html +++ b/build/index.html @@ -14,13 +14,13 @@

          Movies!

          -
          +
          -
          +
          diff --git a/src/views/movie_list_view.js b/src/views/movie_list_view.js index f3f3fbf9f..f2ef185dd 100644 --- a/src/views/movie_list_view.js +++ b/src/views/movie_list_view.js @@ -38,6 +38,7 @@ var MovieListView = Backbone.View.extend({ var formData = this.readNewSearchForm(); console.log(formData); console.log(this.model.url) + this.model.url = "http://localhost:3000/movies?query="; var newUrl = this.model.url + formData.search; this.model.url = newUrl; this.model.fetch(); From 76248d9474dafda7047ee72483fd66612fc200f9 Mon Sep 17 00:00:00 2001 From: Andrea Valliere Date: Thu, 15 Jun 2017 09:48:56 -0700 Subject: [PATCH 11/22] Created new template --- build/index.html | 5 +++++ src/app.js | 2 ++ src/views/movie_list_view.js | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/build/index.html b/build/index.html index afc1c7348..cdfd07868 100644 --- a/build/index.html +++ b/build/index.html @@ -35,6 +35,11 @@

          Movies!

        • <%- movie.title %>
        • + + diff --git a/src/app.js b/src/app.js index e1319245b..c44039544 100644 --- a/src/app.js +++ b/src/app.js @@ -11,6 +11,7 @@ $(document).ready(function() { var myMovieList = new MovieList({url: "http://localhost:3000/movies"}); var myMovieListView = new MovieListView ({ model: myMovieList, + template: _.template($('#movie-template').html()), el: '#rental' }); @@ -19,6 +20,7 @@ $(document).ready(function() { ); var searchMovieListView = new MovieListView ({ model: searchMovieList, + template: _.template($('#search-template').html()), el: '#movie-db' }); diff --git a/src/views/movie_list_view.js b/src/views/movie_list_view.js index f2ef185dd..5351dc22e 100644 --- a/src/views/movie_list_view.js +++ b/src/views/movie_list_view.js @@ -6,7 +6,7 @@ import Movie from '../models/movie.js'; var MovieListView = Backbone.View.extend({ initialize: function(options) { - this.template = _.template($('#movie-template').html()); + this.template = options.template; this.listenTo(this.model, 'update', this.render); // this.listElement = this.$('.movie-list'); }, From 08382821c5d9b09547f1514f1da8f84950d0b72c Mon Sep 17 00:00:00 2001 From: Andrea Valliere Date: Thu, 15 Jun 2017 10:26:24 -0700 Subject: [PATCH 12/22] Adding function to post new movie from DB to rails API & attaching to button click event --- build/css/styles.css | 4 ++++ build/index.html | 4 ++-- src/views/movie_list_view.js | 13 ++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/build/css/styles.css b/build/css/styles.css index 68a79a569..fa27b5149 100644 --- a/build/css/styles.css +++ b/build/css/styles.css @@ -42,3 +42,7 @@ div { border-style: solid; } */ + +#add-button { + /*float: right;*/ +} diff --git a/build/index.html b/build/index.html index cdfd07868..75f0ec823 100644 --- a/build/index.html +++ b/build/index.html @@ -36,8 +36,8 @@

          Movies!

          diff --git a/src/views/movie_list_view.js b/src/views/movie_list_view.js index 5351dc22e..6cd606d83 100644 --- a/src/views/movie_list_view.js +++ b/src/views/movie_list_view.js @@ -59,9 +59,20 @@ var MovieListView = Backbone.View.extend({ return formData; }, + addMovie: function(event) { + // var url = "http://localhost:3000/movies"; + // var data = this. + // $.post(url, data, function(response){ + // console.log(response); + // console.log("added!"); + // }) + console.log(this.model.title); + }, + events: { "click #rental-library": "showList", - "click #search-button": "searchList" + "click #search-button": "searchList", + "click #add-button": "addMovie" } }); From 7b312349ec8a608b972b045c3218614169df4273 Mon Sep 17 00:00:00 2001 From: Sahana Murthy Date: Fri, 16 Jun 2017 10:45:32 -0700 Subject: [PATCH 13/22] All requirements met --- build/index.html | 2 +- src/views/movie_list_view.js | 11 ----------- src/views/movie_view.js | 14 ++++++++++++++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/build/index.html b/build/index.html index 75f0ec823..26de2af88 100644 --- a/build/index.html +++ b/build/index.html @@ -36,7 +36,7 @@

          Movies!

          diff --git a/src/views/movie_list_view.js b/src/views/movie_list_view.js index 6cd606d83..bdd01dd57 100644 --- a/src/views/movie_list_view.js +++ b/src/views/movie_list_view.js @@ -59,20 +59,9 @@ var MovieListView = Backbone.View.extend({ return formData; }, - addMovie: function(event) { - // var url = "http://localhost:3000/movies"; - // var data = this. - // $.post(url, data, function(response){ - // console.log(response); - // console.log("added!"); - // }) - console.log(this.model.title); - }, - events: { "click #rental-library": "showList", "click #search-button": "searchList", - "click #add-button": "addMovie" } }); diff --git a/src/views/movie_view.js b/src/views/movie_view.js index 41e792663..1c54a0e93 100644 --- a/src/views/movie_view.js +++ b/src/views/movie_view.js @@ -9,12 +9,26 @@ var MovieView = Backbone.View.extend({ this.listenTo(this.model, 'change', this.render); }, + addMovie: function(event) { + var url = "http://localhost:3000/movies"; + var data = { movie: this.model.attributes }; + $.post(url, data, function(response){ + console.log(response); + console.log("added!"); + }); + console.log(this.model.attributes); + }, + render: function() { // console.log(this.model.attributes); var html = this.template({movie: this.model.toJSON()}); this.$el.html(html); return this; + }, + + events: { + "click #add-button": "addMovie" } }); From 74688cb6dcd871f8956b0d783b97a088f22e0a13 Mon Sep 17 00:00:00 2001 From: Andrea Valliere Date: Mon, 19 Jun 2017 14:26:58 -0700 Subject: [PATCH 14/22] Added images to templates for rental library and search results --- build/index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/index.html b/build/index.html index 26de2af88..8682eac5b 100644 --- a/build/index.html +++ b/build/index.html @@ -33,13 +33,18 @@

          Movies!

          + + From f971354a98810ff4ac8a075fba2de5ce77a34cdc Mon Sep 17 00:00:00 2001 From: Andrea Valliere Date: Mon, 19 Jun 2017 14:46:01 -0700 Subject: [PATCH 15/22] Organized and centered rental library results --- build/css/styles.css | 11 +++++++++++ build/index.html | 12 +++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/build/css/styles.css b/build/css/styles.css index fa27b5149..9404444b8 100644 --- a/build/css/styles.css +++ b/build/css/styles.css @@ -46,3 +46,14 @@ div { #add-button { /*float: right;*/ } + +#rental { + text-align: center; +} + +#title-card { + display: inline-block; + margin: 25px; + height: 300px; + width: 250px; +} diff --git a/build/index.html b/build/index.html index 8682eac5b..d2f3f1b41 100644 --- a/build/index.html +++ b/build/index.html @@ -14,13 +14,13 @@

          Movies!

          -
          +
          -
          +
          @@ -32,12 +32,14 @@

          Movies!

          From fe9bde743c8febb1f4292cc06da2edfdf9475da2 Mon Sep 17 00:00:00 2001 From: Sahana Murthy Date: Tue, 20 Jun 2017 14:44:50 -0700 Subject: [PATCH 16/22] Images centered. Titles reformatted. About to begin moving buttons to header --- build/css/styles.css | 2 +- build/index.html | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build/css/styles.css b/build/css/styles.css index 9404444b8..14ac88fe6 100644 --- a/build/css/styles.css +++ b/build/css/styles.css @@ -47,7 +47,7 @@ div { /*float: right;*/ } -#rental { +#rental, #movie-db { text-align: center; } diff --git a/build/index.html b/build/index.html index d2f3f1b41..3594b56ef 100644 --- a/build/index.html +++ b/build/index.html @@ -39,8 +39,11 @@
          <%- movie.title %>
          From a9a5fd5f59c2921b51bed97e255a540e087ac056 Mon Sep 17 00:00:00 2001 From: Sahana Murthy Date: Tue, 20 Jun 2017 14:58:27 -0700 Subject: [PATCH 17/22] Buttons added to header and working --- build/index.html | 21 ++++++++++++--------- src/app.js | 4 ++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/build/index.html b/build/index.html index 3594b56ef..76c88abfb 100644 --- a/build/index.html +++ b/build/index.html @@ -11,22 +11,25 @@

          Movies!

          + +
          + +
          + +
          + + +
          +
          -
          - +
          -
          -
          -
          - - +
          - -
          diff --git a/src/app.js b/src/app.js index c44039544..5695e5c32 100644 --- a/src/app.js +++ b/src/app.js @@ -12,7 +12,7 @@ $(document).ready(function() { var myMovieListView = new MovieListView ({ model: myMovieList, template: _.template($('#movie-template').html()), - el: '#rental' + el: '.rental' }); var searchMovieList = new MovieList( @@ -21,7 +21,7 @@ $(document).ready(function() { var searchMovieListView = new MovieListView ({ model: searchMovieList, template: _.template($('#search-template').html()), - el: '#movie-db' + el: '.movie-db' }); }); From 4525c1185ba68954a456941e48455dae0dc9d015 Mon Sep 17 00:00:00 2001 From: Sahana Murthy Date: Tue, 20 Jun 2017 16:48:27 -0700 Subject: [PATCH 18/22] End of day Tuesday --- build/css/styles.css | 4 ++-- build/index.html | 4 ++-- src/views/movie_list_view.js | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/build/css/styles.css b/build/css/styles.css index 14ac88fe6..9a97ecef5 100644 --- a/build/css/styles.css +++ b/build/css/styles.css @@ -47,11 +47,11 @@ div { /*float: right;*/ } -#rental, #movie-db { +.rental, .movie-db { text-align: center; } -#title-card { +.title-card { display: inline-block; margin: 25px; height: 300px; diff --git a/build/index.html b/build/index.html index 76c88abfb..875b054f9 100644 --- a/build/index.html +++ b/build/index.html @@ -35,14 +35,14 @@

          Movies!

          +