forked from AdaGold/video-store-consumer
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Kay Kay and Tay Tay Blockbuster -- Carets #16
Open
misstonbon
wants to merge
28
commits into
Ada-C8:master
Choose a base branch
from
kaylaecker:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
8d9f992
added initial customer and movie files
kaylaeckergoog dc8c5b9
initial set up complete for imports and lists
kaylaeckergoog 3d11f9b
minor changes from var to let to limit scope
kaylaeckergoog 468600a
changes title
misstonbon e63ed4a
sets up basic HTML for the page
misstonbon a79473a
now renders movie list
kaylaeckergoog 86551c8
merging conflicts
kaylaeckergoog eba9597
rearranges HTML so that sections are in the right place
misstonbon a7b5551
adds button
misstonbon afd4a64
adds themoviedb png file
misstonbon 53ce102
resizing image
misstonbon 462f61f
added application pages and basic import/export
kaylaeckergoog b15f666
Merge branch 'master' of https://github.com/KaylaEcker/VideoStoreCons…
kaylaeckergoog e342b5f
pending image
kaylaeckergoog a05260b
backbone extend added
kaylaeckergoog f5ed60d
pending for the photo to be added
kaylaeckergoog cc95fb1
updated to show working individual movie pages/information when clicked
kaylaeckergoog 1c34dae
adds form
misstonbon f21aac8
navigates back to view all when you click on title
kaylaeckergoog 111f8fe
searches api, renders search
misstonbon 6908578
adding moviedb image again
misstonbon 1a8d62c
adds some sweet syling
misstonbon 4d481b3
adds more styling and fixes refresh when click on logo
misstonbon 221acf1
handles adding to movies
misstonbon b86e2de
fixes spacing
misstonbon f03292d
adds more styles
misstonbon b7b765e
resizes photo
misstonbon 4548519
Changes the title in HTML
misstonbon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,46 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Backbone Baseline</title> | ||
</head> | ||
<body> | ||
<main id="main-content"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<title>KT MOVIE STORE</title> | ||
</head> | ||
<body> | ||
|
||
<header> | ||
<a><h1 id="logo" class="logo large-3 medium-3 columns"> Kay Kay and Tay Tay Movie Rentals </h1></a> | ||
<ul class="menu large-4 medium-4 columns"> | ||
<li class="pageDescription">Use this dashboard to browse and add movies. That's it.</li> | ||
</ul> | ||
|
||
<ul id="search" class="menu align-right large-5 medium-5 columns"> | ||
<li><input type="text" name="queryTerm" placeholder="Movie Title" id="search-box" /></li> | ||
<li><a id="search-button" type="button" value="Search">Search</a></li> | ||
</ul> | ||
</header> | ||
|
||
<main id="main-content"> | ||
|
||
<section id='movie'></section> | ||
<section id='movie-list'></section> | ||
<!-- Templates --> | ||
|
||
<script id="movie-template" type="text/template"> | ||
<h2><%- title %></h2> | ||
</script> | ||
|
||
<script id="movie-info-template" type="text/template"> | ||
<h3> <%- title %></h3> | ||
<img src="https://image.tmdb.org/t/p/w185/<%- image_url %>" /> | ||
<h4>Overview:</h4><h5> <%- overview %></h5></h4> | ||
<h4>Release Date:</h4><h5> <%- release_date %></h5> | ||
<h4 class="button" id="add-movie" style="<%- !external_id ? 'display:none;' : '' %>">Add Movie to Store</h4> | ||
</script> | ||
|
||
</main> | ||
|
||
<script src="/app.bundle.js"></script> | ||
<footer> Powered by TheMovieDB </footer> | ||
|
||
<script src="/app.bundle.js"></script> | ||
|
||
</body> | ||
</html> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Backbone from 'backbone'; | ||
import Customer from '../models/customer'; | ||
|
||
let CustomerList = Backbone.Collection.extend({ | ||
model: Customer, | ||
url: 'http://localhost:3000/customers' | ||
}); | ||
|
||
export default CustomerList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Backbone from 'backbone'; | ||
import Movie from '../models/movie'; | ||
|
||
let MovieList = Backbone.Collection.extend({ | ||
model: Movie, | ||
url: 'http://localhost:3000/movies' | ||
}); | ||
|
||
export default MovieList; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Backbone from 'backbone'; | ||
|
||
let Application = Backbone.Model.extend({}); | ||
|
||
export default Application; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
import Backbone from 'backbone'; | ||
|
||
let Customer = Backbone.Model.extend({}); | ||
|
||
export default Customer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Backbone from 'backbone'; | ||
|
||
let Movie = Backbone.Model.extend({ | ||
defaults: { | ||
'title': 'DEFAULT TITLE', | ||
'overview': 'DEFAULT OVERVIEW', | ||
'release_date': 'DEFAULT RELEASE DATE', | ||
'image_url': "https://image.tmdb.org/t/p/w500", | ||
} | ||
}); | ||
|
||
export default Movie; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import Backbone from 'backbone'; | ||
import Movie from '../models/movie'; | ||
import MovieListView from './movie_list_view'; | ||
import MovieDetailsView from './movie_details_view'; | ||
import $ from 'jquery'; | ||
import _ from 'underscore'; | ||
|
||
let ApplicationView = Backbone.View.extend({ | ||
initialize: function (params) { | ||
this.movieList = params.movieList; | ||
this.movieListTemplate = params.movieListTemplate; | ||
this.movieDetailsTemplate = params.movieDetailsTemplate; | ||
}, | ||
events: { | ||
'click h1' : 'showList' | ||
}, | ||
|
||
showList: function () { | ||
let movieListView = new MovieListView({ | ||
model: this.movieList, | ||
template: this.movieListTemplate, | ||
el: 'body', | ||
}); | ||
|
||
this.movieList.fetch({reset: true}); | ||
this.listenTo(movieListView, 'showMovieDetails', this.showMovieDetails); | ||
}, | ||
showMovieDetails: function (movie) { | ||
let movieDetailsView = new MovieDetailsView({ | ||
model: movie, | ||
template: this.movieDetailsTemplate, | ||
el: 'body' | ||
}); | ||
movieDetailsView.render(); | ||
}, | ||
|
||
}); | ||
|
||
export default ApplicationView; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Backbone from 'backbone'; | ||
import _ from 'underscore'; | ||
import $ from 'jquery'; | ||
import Movie from '../models/movie'; | ||
import MovieView from './movie_view'; | ||
|
||
let MovieDetailsView = Backbone.View.extend({ | ||
initialize: function(params) { | ||
this.template = params.template; | ||
this.listenTo(this.model, 'change', this.render); | ||
}, | ||
render: function() { | ||
let compiledTemplate = this.template(this.model.toJSON()); | ||
this.$('main').html(compiledTemplate); | ||
}, | ||
events: { | ||
'click .button#add-movie': 'add' | ||
}, | ||
add(event) { | ||
this.model.save(); | ||
} | ||
}); | ||
|
||
export default MovieDetailsView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import Backbone from 'backbone'; | ||
import _ from 'underscore'; | ||
import $ from 'jquery'; | ||
import Movie from '../models/movie.js'; | ||
import MovieView from './movie_view.js'; | ||
import MovieDetailsView from './movie_details_view'; | ||
|
||
let MovieListView = Backbone.View.extend({ | ||
initialize: function(params) { | ||
this.template = params.template; | ||
this.listenTo(this.model, 'update reset', this.render); | ||
}, | ||
|
||
render: function() { | ||
this.$('main').html('<ul></ul>'); | ||
let that = this; | ||
|
||
this.model.each(function(movie) { | ||
let movieView = new MovieView({ | ||
model: movie, | ||
template: that.template, | ||
tagName: 'li' | ||
}); | ||
that.$('main ul').append(movieView.render().$el); | ||
that.listenTo(movieView, 'showMovieDetails', that.showMovieDetails); | ||
}); | ||
return this; | ||
}, | ||
events: { | ||
'click #search-button' : 'searchMovies' | ||
}, | ||
showMovieDetails: function (movie) { | ||
this.trigger('showMovieDetails', movie); | ||
}, | ||
searchMovies: function () { | ||
var queryTerm = $('#search-box').val(); | ||
$('#search-box').val(''); | ||
|
||
this.model.fetch({ | ||
data: { query: queryTerm }, | ||
processData: true, | ||
}); | ||
}, | ||
}); | ||
|
||
export default MovieListView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Backbone from 'backbone'; | ||
import _ from 'underscore'; | ||
import $ from 'jquery'; | ||
import Movie from '../models/movie.js'; | ||
|
||
let MovieView = Backbone.View.extend({ | ||
initialize: function(params) { | ||
this.template = params.template; | ||
}, | ||
render: function() { | ||
let compiledTemplate = this.template(this.model.toJSON()); | ||
this.$el.html(compiledTemplate); | ||
return this; | ||
}, | ||
events: { | ||
'click' : 'showDetails' | ||
}, | ||
|
||
showDetails: function () { | ||
this.trigger('showMovieDetails', this.model); | ||
} | ||
}); | ||
|
||
export default MovieView; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably need an
if
statement here to get the images to show for IMDB movies, or you could work on the API end.