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

Pipes - Eva and Rebecca - VideoStore #23

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
140 changes: 130 additions & 10 deletions dist/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,135 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Backbone Baseline</title>
</head>
<body>
<main id="main-content">

</main>

<head>
<meta charset="utf-8">
<title>Backbone Baseline</title>
</head>
<body>
<main id="main-content">
<script src="/app.bundle.js"></script>
<header class= >
<h1 class="text-center">Movie Store</h1>
</header>
<section>
<button id="modalBtn" class= "button black float-right"> Add a new movie</button>
</section>

<section>
<section id="myModal" class = "columns small-12 modal hide">
<!-- <div class= "modal-content"> -->
<section>


<button id ="close" class="button black float-right" aria-label="Close">&#215;</button>
<div id="movie-search" class= "columns large-12 small-12 white">
<div class="movie-entry-form">
<h3>Find a new movie</h3>
<form id="form" method="get">
<label>Title</label>
<input type="text" id="title" name="title"></input>
<button class="btn-search-api success button">Search Movies</button>
</form>
<div class="new-form-errors">
</div>
</div>
<div id="search-error-message" class = "red">
</div>
<div id="search-results">
<table>
<thead>
<th class="img_url">Image</th>
<th class="title">Title</th>
<th class="overview">Overview</th>
<th class="release_date">Release Date</th>
<th>Add Movie</th>
</thead>
<tbody id="search-list">
</tbody>
</table>
</div>
<!-- </div> -->

</section>
</div>
</section>


<div id="movie-list">
<div id="movies" class="columns small-12 trade-column">
<div class="movie-search-form columns small-12">
<h3>Find a movie in the store:</h3>
<form id="form" method="get">
<label>Title</label>
<input type="text" id="title" name="title"></input>
<button class="btn-search success button">Search Store</button>
<button class="btn-showAll success button">Show All Movies</button>
</form>
<div class="new-form-errors">
</div>
</div>
<p id="movie-success-messages" class = "green">
</p>
<p id="movie-fail-messages" class = "red">
</p>
<table>
<thead>
<th class="img_url">Image</th>
<th class="title">Title</th>
<th class="release_date">Release Date</th>
<th class="overview">Overview</th>
</thead>
<tbody id="movie-list">
</tbody>
</table>
</div>
</div>
</section>
</main>
</body>


<script type="text/template" id="movie-template">
<td>
<img class = "float-center" src= "<%- image_url %>" />
</td>
<td>
<h4>
<%- title %>
</h4>
</td>
<td>
<p class="small">
<%- overview %>
</p>
</td>
<td>
<p>
<%- release_date %>
</p>
</td>
</script>

<script type="text/template" id="search-template">
<td>
<img class = "float-center" src= "<%- image_url %>" />
</td>
<td>
<h4>
<%- title %>
</h4
</td>
<td class= "small">
<%-overview%>
</td>
<td>
<p>
<%- release_date %>
</p>
</td>
<td>
<button class="button add">Add movie</button>
<p class="nothing red hide">Added Movie!</p>
</td>

</body>
</script>
</html>
87 changes: 79 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@
},
"dependencies": {
"backbone": "^1.3.3",
"foundation-sites": "^6.4.4-rc1",
"foundation-sites": "^6.3.1",
"jquery": "^3.2.1",
"save": "^2.3.2",
"underscore": "^1.8.3"
}
}
28 changes: 28 additions & 0 deletions spec/models/movie_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import Movie from 'models/movie';

describe('Movie spec', () => {

describe('validate', () => {
it ('requires a release_date', () => {
const invalidMovieNoReleaseDate = new Movie({
title: 'Jaws',
})
expect(invalidMovieNoReleaseDate.isValid()).toBeFalsy();
});

it ('requires a title', () => {
const invalidMovieNoTitle = new Movie({
release_date: '1975-06-18',
})
expect(invalidMovieNoTitle.isValid()).toBeFalsy();
});

it ('creates a movie if title and release date are provided', () => {
const validMovie = new Movie({
title: 'Jaws',
release_date: '1975-06-18',
});
expect(validMovie.isValid()).toBeTruthy();
});
});
});
28 changes: 28 additions & 0 deletions spec/models/search_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import Search from 'models/search';

describe('Search spec', () => {

describe('validate', () => {
it ('requires a release_date', () => {
const invalidSearchNoReleaseDate = new Search({
title: 'Jaws',
})
expect(invalidSearchNoReleaseDate.isValid()).toBeFalsy();
});

it ('requires a title', () => {
const invalidSearchNoTitle = new Search({
release_date: '1975-06-18',
})
expect(invalidSearchNoTitle.isValid()).toBeFalsy();
});

it ('creates a movie if title and release date are provided', () => {
const validSearch = new Search({
title: 'Jaws',
release_date: '1975-06-18',
});
expect(validSearch.isValid()).toBeTruthy();
});
});
});
Loading