Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tamira-Mariana-Pipes-VideoStoreConsumer #12

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2471c25
made basic Movie model:
tvojnar Dec 18, 2017
9f01368
made basic collection for MOvieList
tvojnar Dec 18, 2017
2402ed6
make template
lmarianarp19 Dec 18, 2017
368a166
fixed bugs in Movie model and MovieList collection
tvojnar Dec 18, 2017
e1fdb65
Merge pull request #1 from lmarianarp19/html-table
lmarianarp19 Dec 18, 2017
34a8e14
added url to MovieList collection
tvojnar Dec 18, 2017
22fbf92
fixed url ; to ,
tvojnar Dec 18, 2017
93191d5
Merge pull request #2 from lmarianarp19/movie-model-collection
tvojnar Dec 18, 2017
2fd3b13
made MovieView
tvojnar Dec 18, 2017
dcef991
Merge pull request #3 from lmarianarp19/show-all-movies
tvojnar Dec 18, 2017
0d3478d
last push before switching branches
tvojnar Dec 18, 2017
dbf0a8a
Merge branch 'master' of https://github.com/lmarianarp19/VideoStoreCo…
tvojnar Dec 18, 2017
deb8f2e
Show list of movies
lmarianarp19 Dec 18, 2017
8b32d57
Merge pull request #4 from lmarianarp19/movie-list-view
lmarianarp19 Dec 18, 2017
e1988de
added search bar
tvojnar Dec 18, 2017
26d1941
can click on the search button and get into searchForMovie
tvojnar Dec 19, 2017
97d326b
can now pull out the form text in the searh input. End of the day on …
tvojnar Dec 19, 2017
7d4c094
can make a search query to the external api via the local api to get …
tvojnar Dec 19, 2017
7aa29f4
Merge pull request #5 from lmarianarp19/playing-with-api
tvojnar Dec 19, 2017
7de495c
can show search results
lmarianarp19 Dec 19, 2017
2a35445
status message appears if there are no results for the search
tvojnar Dec 19, 2017
3dc69e2
was checking if we already have the movie by making another api call,…
tvojnar Dec 19, 2017
1149936
only adds the 'add to library' button if you don't already have the m…
tvojnar Dec 20, 2017
a9ecf35
Merge pull request #6 from lmarianarp19/add-movie
tvojnar Dec 20, 2017
0cfc2f3
few changes to save in data base
lmarianarp19 Dec 20, 2017
30a6fc0
can make a post request to the api now. Doesn't do what we want on th…
tvojnar Dec 20, 2017
c329b53
can make a post request and get back a new instance of a movie from t…
tvojnar Dec 20, 2017
dcb6442
clean the results table
lmarianarp19 Dec 20, 2017
5f0cce7
failure case to save movie
lmarianarp19 Dec 20, 2017
1557208
added back functionality to display error message if no search result…
tvojnar Dec 20, 2017
90f2c7f
fixed .done for post request to correctly check if the object returne…
tvojnar Dec 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Show list of movies
lmarianarp19 committed Dec 18, 2017
commit deb8f2e77bdfa9b235a08ab487b1f76f3500b02d
20 changes: 19 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
@@ -10,11 +10,29 @@ import Backbone from 'backbone';
// Import models and collections
import Movie from 'models/movie'
import MovieList from 'collections/movie_list'
import MovieListView from './views/movie_list_view'

// ready to go
$(document).ready(function() {

const movieTemplate = _.template($('#all-movies-template').html());
const movieTemplate = _.template($('#all-movies-template').html());


const moviesList = new MovieList();

console.log("this is moesList");
console.log(moviesList);

const movieListView = new MovieListView({
model: moviesList,
template: movieTemplate,
el: $('#list-movies'),
});

moviesList.fetch();
// movieListView.render();





29 changes: 29 additions & 0 deletions src/views/movie_list_view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import Backbone from 'backbone';
import MovieView from './movie_view';

const MovieListView = Backbone.View.extend({
initialize(params){
this.template = params.template;
// this.model = params.model;
this.listenTo(this.model, 'update', this.render);
},
render() {
console.log("inside render in movie list view");
console.log( this.model);
this.model.each((movie) => {
console.log("inside the loop");
const movieView = new MovieView({
model: movie,
template: this.template,
tagName: 'tr',
});
this.$('#movies-list').append(movieView.render().$el);
});


return this
}

});

export default MovieListView;
2 changes: 2 additions & 0 deletions src/views/movie_view.js
Original file line number Diff line number Diff line change
@@ -14,3 +14,5 @@ const MovieView = Backbone.View.extend({
return this;
}, // render
}) // MovieView

export default MovieView;