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

Laura & Severin - Carets #6

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2810b02
Initial models, collections, and views
LauraAddams Dec 18, 2017
dd726a0
Base templates and HTML naming(ids, classes)
LauraAddams Dec 18, 2017
982512e
Collection default code added
LauraAddams Dec 18, 2017
b8928b3
added basic model code
s-wigg Dec 18, 2017
6de4e3c
Merge branch 'master' of https://github.com/s-wigg/VideoStoreConsumer
s-wigg Dec 18, 2017
460f54f
Reformated templates to be single list elements
LauraAddams Dec 18, 2017
29fc502
Templating setup for MovieListView
LauraAddams Dec 18, 2017
684226c
started trying to display all movies
s-wigg Dec 18, 2017
b61967e
getting api response for all movies
s-wigg Dec 18, 2017
9dd9d22
can display all movies from rails API on All movies button click
s-wigg Dec 18, 2017
39c1791
All customers view added
LauraAddams Dec 18, 2017
b013c1c
Image urls hardcoded to display properly
LauraAddams Dec 18, 2017
db91669
can return search results from API inventory
s-wigg Dec 18, 2017
5bfa3d5
search finds results regardless of case
s-wigg Dec 19, 2017
4feabfe
Form has optiona for searching the database or IMDB
LauraAddams Dec 19, 2017
c523627
added IMDB search functionality
s-wigg Dec 19, 2017
ca3d6aa
Removed hardcoded image url
LauraAddams Dec 19, 2017
be948a4
fixed bug where wasnt ref
s-wigg Dec 19, 2017
9e8e876
Removed li from templates
LauraAddams Dec 19, 2017
10364bf
Add inventory button for IMDB searching
LauraAddams Dec 19, 2017
e02dc8e
Removed button from all movie inventory page
LauraAddams Dec 19, 2017
2ce8ccc
initial functionality to add a movie to inventory
s-wigg Dec 19, 2017
e70a80e
List styling baseline
LauraAddams Dec 19, 2017
193ca75
Summary appears on mouseenter
LauraAddams Dec 19, 2017
d1f117d
Add inventory button creates post call to add movie to API
LauraAddams Dec 20, 2017
439764b
Cleaned up the hover list styling
LauraAddams Dec 20, 2017
13eb6f5
tweak to fix for typeError for movies that don't include a date
s-wigg Dec 20, 2017
a798318
Added movie details styling: like, movie rating, rating
LauraAddams Dec 20, 2017
c5fd6f2
Merge branch 'master' of https://github.com/s-wigg/VideoStoreConsumer
LauraAddams Dec 20, 2017
16a6181
added tests for movie model validations
s-wigg Dec 20, 2017
fbb1fc8
added logic to make rating red/green depending on rating
s-wigg Dec 20, 2017
c3c8b16
Cleaned up files, removed comments, unused templates, and commented o…
LauraAddams Dec 20, 2017
2d78421
Replaced like image with a linked source
LauraAddams Dec 21, 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
Form has optiona for searching the database or IMDB
LauraAddams committed Dec 19, 2017
commit 4feabfe4098c47367a17eb1b146e5159c070407b
2 changes: 2 additions & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -10,6 +10,8 @@ <h1>VideoStore</h1>
<section>
<form class='search-form'>
<input type='text' name='search' placeholder='Search' />
<input type="radio" id='inventory' name="search-type" value="search inventory" checked><label for="inventory">Search Inventory</label>
<input type="radio" id='imdb' name="search-type" value="search IMDB"><label for="imdb">Search IMDB</label>
<input type='submit' value='Search' class='button' id="searchButton"></input>
</form>
</section>
37 changes: 21 additions & 16 deletions src/views/movie_list_view.js
Original file line number Diff line number Diff line change
@@ -25,24 +25,29 @@ const MovieListView = Backbone.View.extend({
},
submit(event) {
event.preventDefault();

const searchType = this.$('input[name=search-type]:checked').val();
const searchTerm = this.$('input[name=search]').val().toUpperCase();
console.log(searchTerm);
const movieList = this.model.models;
console.log(movieList);
const filteredMovies = movieList.filter(movie => movie.get('upperCaseTitle').includes(searchTerm));
console.log(filteredMovies);
this.$('#list').empty();

filteredMovies.forEach((movie) => {
const movieView = new MovieView({
model: movie,
template: this.template,
tagName: 'li',
className: 'movie',

if (searchType === 'search inventory') {
const movieList = this.model.models;
const filteredMovies = movieList.filter(movie => movie.get('upperCaseTitle').includes(searchTerm));

this.$('#list').empty();

filteredMovies.forEach((movie) => {
const movieView = new MovieView({
model: movie,
template: this.template,
tagName: 'li',
className: 'movie',
});
this.$('#list').append(movieView.render().$el);
});
this.$('#list').append(movieView.render().$el);
});
return this;
return this;
} else {
console.log('Searching Imdb...');
}

},
events: {