From cda995b180a53cfcff70f74a03de7a3a9194c83f Mon Sep 17 00:00:00 2001 From: Nathan Bills <ndbills@gmail.com> Date: Sat, 19 Apr 2014 20:43:20 -0600 Subject: [PATCH] Login is working. Signup is working. Server side validation on each form is also working :) --- project/controllers/login.py | 46 +++++++- project/controllers/test.py | 5 +- project/templates/home/home.html | 36 +++--- project/templates/index.html | 2 +- project/templates/library/library.html | 110 +++++++++--------- project/templates/library/libraryItem.html | 56 +++++----- project/templates/library/master.html | 124 +++++++++++---------- project/templates/login/master.html | 75 +++++-------- project/templates/login/signup.html | 42 +++++++ project/templates/movies/master.html | 111 +++++++++--------- project/templates/movies/movie.html | 56 +++++----- 11 files changed, 370 insertions(+), 293 deletions(-) create mode 100644 project/templates/login/signup.html diff --git a/project/controllers/login.py b/project/controllers/login.py index 5cceeb4..62833ed 100644 --- a/project/controllers/login.py +++ b/project/controllers/login.py @@ -1,8 +1,50 @@ # -*- coding: utf-8 -*- from project import app -from flask import render_template, request +from flask import render_template, request, session, redirect, url_for from flask.ext.wtf import Form, TextField, validators +from project.model.User import User -@app.route('/login') +@app.route('/login', methods=['GET', 'POST']) def login(): + if request.method == 'GET': + return render_template('login/master.html') + if request.method == 'POST': + email = request.form['email'] + password = request.form['password'] + + user = User.validateUser(email, password) + + if user is not None: + session['user'] = user.toJson() + return redirect(url_for('libraries')) + else: + error = "That email or password is not valid. Please check your credentials and try again." + return render_template('login/master.html', error=error) + return render_template('login/master.html') + +@app.route('/signup', methods=['GET', 'POST']) +def signup(): + if request.method == 'GET': + return render_template('login/signup.html') + if request.method == 'POST': + email = request.form['email'] + password = request.form['password'] + passwordConfirm = request.form['passwordConfirm'] + + if password == passwordConfirm: + #check unique user + if len(User.objects(email=email)) == 0: + from project.model.Library import Library + #if unique, create user + user = User.createUser(email, password) + user.addRole('user').save() + session['user'] = user.toJson() + Library(user=user, unit='Movie', name='Master').save() + Library(user=user, unit='Movie', name='Borrowed').save() + return redirect(url_for('libraries')) + else: + error = "The passwords you entered did not match. Please try again." + return render_template('login/signup.html', error=error, email=email) + pass + return render_template('login/signup.html') \ No newline at end of file diff --git a/project/controllers/test.py b/project/controllers/test.py index 2273b7c..5c3b8bb 100644 --- a/project/controllers/test.py +++ b/project/controllers/test.py @@ -22,9 +22,8 @@ def test(): @app.route('/test-user') def test_user(): - from project.models.User import User - test_user = User(created_at=datetime.datetime.now(), email='test@user.org', password='password', role='admin').save() - print "date: %s" % test_user.created_at + from project.model.User import User + test_user = User.createUser(email='ndbills@gmail.com', password='password') #check if test_user exists #if yes, return a success render_template #else add the user and return some other template diff --git a/project/templates/home/home.html b/project/templates/home/home.html index ae77ccd..1d7946a 100644 --- a/project/templates/home/home.html +++ b/project/templates/home/home.html @@ -1,25 +1,27 @@ {% extends "index.html" %} {% block content %} - <div class="jumbotron"> - <h1>It's working!!!</h1> - <p>Here, all of your wildest dreams can come true.</p> - <p><a class="btn btn-primary btn-lg" role="button">The Demo</a></p> - </div> + <div class="col-sm-12"> + <div class="jumbotron"> + <h1>It's working!!!</h1> + <p>Here, all of your wildest dreams can come true.</p> + <p><a class="btn btn-primary btn-lg" role="button">The Demo</a></p> + </div> - <div class="row"> - <div class="col-xs-12 col-sm-6"> - <div class="thumbnail"> - <img data-src="holder.js/100%x200/sky" alt="..."> - <div class="caption"> - <h3>Awesome Sauce!</h3> + <div class="row"> + <div class="col-xs-12 col-sm-6"> + <div class="thumbnail"> + <img data-src="holder.js/100%x200/sky" alt="..."> + <div class="caption"> + <h3>Awesome Sauce!</h3> + </div> </div> </div> - </div> - <div class="col-xs-12 col-sm-6"> - <div class="thumbnail"> - <img data-src="holder.js/100%x200/vine" alt="..."> - <div class="caption"> - <h3>It is so cool!</h3> + <div class="col-xs-12 col-sm-6"> + <div class="thumbnail"> + <img data-src="holder.js/100%x200/vine" alt="..."> + <div class="caption"> + <h3>It is so cool!</h3> + </div> </div> </div> </div> diff --git a/project/templates/index.html b/project/templates/index.html index 2e6da52..0fe0b91 100644 --- a/project/templates/index.html +++ b/project/templates/index.html @@ -37,7 +37,7 @@ </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="{{ url_for('login') }}">Login</a></li> - <li><a href="#">Sign-up</a></li> + <li><a href="{{ url_for('signup') }}">Sign-up</a></li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> diff --git a/project/templates/library/library.html b/project/templates/library/library.html index a3238b4..df6e30a 100644 --- a/project/templates/library/library.html +++ b/project/templates/library/library.html @@ -1,57 +1,59 @@ {% extends "index.html" %} {% block content %} - <h3>Action Movies</h3> - <table class="table table-striped table-hover"> - <thead> - <tr> - <td>Movie</td> - <td>Summary</td> - <td>Rating</td> - <td>Options</td> - </tr> - </thead> - <tbody> - <tr> - <td> - <!--<img data-src="holder.js/165x200/sky" alt="movie title">--> - <img src="http://1.bp.blogspot.com/__cfySUj2yhk/TKE8n5fJo4I/AAAAAAAAAnY/Vwf39Hilx2Y/s1600/Bourne_Identity.jpg" style="max-width: 200px;" alt="The Bourne Identity"> - <p>The Bourne Identity</p> - </td> - <td> - <p>A man is picked up by a fishing boat, bullet-riddled and without memory, then races to elude assassins and recover from amnesia.</p> - </td> - <td> - <p>7.9/10</p> - </td> - <td> - <button class="btn btn-info btn-sm"> - <span class="glyphicon glyphicon-hand-right"></span> Lend - </button> - <button class="btn btn-default btn-sm"> - <span class="glyphicon glyphicon-pencil"></span> Edit - </button> - </td> - </tr> - <tr> - <td> - <img src="http://www.eeriedigest.com/wordpress/wp-content/uploads/2011/08/bourne-supremacy.jpg" style="max-width: 200px;" alt="The Bourne Supremacy"> - <p>The Bourne Supremacy</p> - </td> - <td> - <p>When Jason Bourne is framed for a CIA operation gone awry, he is forced to resume his former life as a trained assassin to survive.</p> - </td> - <td> - <p>7.8/10</p> - </td> - <td> - <button class="btn btn-info btn-sm"> - <span class="glyphicon glyphicon-hand-right"></span> Lend - </button> - <button class="btn btn-default btn-sm"> - <span class="glyphicon glyphicon-pencil"></span> Edit - </button> - </td> - </tr> - </tbody> - </table> + <div class="col-sm-12"> + <h3>Action Movies</h3> + <table class="table table-striped table-hover"> + <thead> + <tr> + <td>Movie</td> + <td>Summary</td> + <td>Rating</td> + <td>Options</td> + </tr> + </thead> + <tbody> + <tr> + <td> + <!--<img data-src="holder.js/165x200/sky" alt="movie title">--> + <img src="http://1.bp.blogspot.com/__cfySUj2yhk/TKE8n5fJo4I/AAAAAAAAAnY/Vwf39Hilx2Y/s1600/Bourne_Identity.jpg" style="max-width: 200px;" alt="The Bourne Identity"> + <p>The Bourne Identity</p> + </td> + <td> + <p>A man is picked up by a fishing boat, bullet-riddled and without memory, then races to elude assassins and recover from amnesia.</p> + </td> + <td> + <p>7.9/10</p> + </td> + <td> + <button class="btn btn-info btn-sm"> + <span class="glyphicon glyphicon-hand-right"></span> Lend + </button> + <button class="btn btn-default btn-sm"> + <span class="glyphicon glyphicon-pencil"></span> Edit + </button> + </td> + </tr> + <tr> + <td> + <img src="http://www.eeriedigest.com/wordpress/wp-content/uploads/2011/08/bourne-supremacy.jpg" style="max-width: 200px;" alt="The Bourne Supremacy"> + <p>The Bourne Supremacy</p> + </td> + <td> + <p>When Jason Bourne is framed for a CIA operation gone awry, he is forced to resume his former life as a trained assassin to survive.</p> + </td> + <td> + <p>7.8/10</p> + </td> + <td> + <button class="btn btn-info btn-sm"> + <span class="glyphicon glyphicon-hand-right"></span> Lend + </button> + <button class="btn btn-default btn-sm"> + <span class="glyphicon glyphicon-pencil"></span> Edit + </button> + </td> + </tr> + </tbody> + </table> + </div> {% endblock %} \ No newline at end of file diff --git a/project/templates/library/libraryItem.html b/project/templates/library/libraryItem.html index 2dbe30c..ec380a0 100644 --- a/project/templates/library/libraryItem.html +++ b/project/templates/library/libraryItem.html @@ -1,36 +1,38 @@ {% extends "index.html" %} {% block content %} - <div class="row"> - <div class="col-xs-12 col-sm-3 col-md-2"> - <img data-src="holder.js/100%x200/sky" alt="movie title"> - <button type="button" class="btn btn-default btn-sm"> - <span class="glyphicon glyphicon-pencil"></span> Edit - </button> - <button type="button" class="btn btn-warning btn-sm"> - <span class="glyphicon glyphicon-remove"></span> Remove - </button> - </div> + <div class="col-sm-12"> + <div class="row"> + <div class="col-xs-12 col-sm-3 col-md-2"> + <img data-src="holder.js/100%x200/sky" alt="movie title"> + <button type="button" class="btn btn-default btn-sm"> + <span class="glyphicon glyphicon-pencil"></span> Edit + </button> + <button type="button" class="btn btn-warning btn-sm"> + <span class="glyphicon glyphicon-remove"></span> Remove + </button> + </div> - <div class="col-xs-12 col-sm-3 col-md-2"> - <ul class="list-unstyled"> - <li>Movie Title</li> - <li>Director(s)</li> - <li>Actors (truncated)</li> - <li>Producers</li> - <li>Composer</li> - </ul> - </div> + <div class="col-xs-12 col-sm-3 col-md-2"> + <ul class="list-unstyled"> + <li>Movie Title</li> + <li>Director(s)</li> + <li>Actors (truncated)</li> + <li>Producers</li> + <li>Composer</li> + </ul> + </div> - <div class="col-xs-12 col-sm-6 col-md-8"> - <h2>Summary</h2> - <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse eget metus vitae mi interdum tristique. Integer malesuada quam tincidunt, gravida nisi vehicula, auctor mi. Morbi fermentum, neque quis adipiscing placerat, odio nunc consequat ligula, vel sagittis nisl orci id risus. Aliquam hendrerit, elit a molestie suscipit, eros tortor scelerisque odio, sit amet cursus ligula lorem et turpis. Pellentesque ante metus, suscipit id blandit eget, vehicula quis tortor. Aliquam a pharetra enim. Morbi in purus sit amet nulla egestas consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla diam nulla, iaculis lobortis varius at, auctor malesuada enim. Donec a nisl eget ligula rhoncus fermentum.</p> + <div class="col-xs-12 col-sm-6 col-md-8"> + <h2>Summary</h2> + <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse eget metus vitae mi interdum tristique. Integer malesuada quam tincidunt, gravida nisi vehicula, auctor mi. Morbi fermentum, neque quis adipiscing placerat, odio nunc consequat ligula, vel sagittis nisl orci id risus. Aliquam hendrerit, elit a molestie suscipit, eros tortor scelerisque odio, sit amet cursus ligula lorem et turpis. Pellentesque ante metus, suscipit id blandit eget, vehicula quis tortor. Aliquam a pharetra enim. Morbi in purus sit amet nulla egestas consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla diam nulla, iaculis lobortis varius at, auctor malesuada enim. Donec a nisl eget ligula rhoncus fermentum.</p> + </div> </div> - </div> - <div class="row"> - <div class="col-xs-12 col-sm-6 col-md-12"> - <h3>Movie Reviews</h3> - <p>Coming Soon!</p> + <div class="row"> + <div class="col-xs-12 col-sm-6 col-md-12"> + <h3>Movie Reviews</h3> + <p>Coming Soon!</p> + </div> </div> </div> {% endblock %} \ No newline at end of file diff --git a/project/templates/library/master.html b/project/templates/library/master.html index 4342db8..13e0c4b 100644 --- a/project/templates/library/master.html +++ b/project/templates/library/master.html @@ -1,64 +1,66 @@ {% extends "index.html" %} {% block content %} - <h3>My Libraries</h3> - <table class="table table-striped table-hover"> - <thead> - <tr> - <td>Library</td> - <td>Summary</td> - <td>Movie Count</td> - <td>Options</td> - </tr> - </thead> - <tbody> - <tr> - <td> - <a href="#">Action Movies</a> - </td> - <td> - <p>This is a list of some of my favorite action movies</p> - </td> - <td> - <p>2</p> - </td> - <td> - <button class="btn btn-default btn-sm"> - <span class="glyphicon glyphicon-pencil"></span> Edit - </button> - </td> - </tr> - <tr> - <td> - <a href="#">Comedy</a> - </td> - <td> - <p>This is a list of some of my favorite comedy shows and funny movies</p> - </td> - <td> - <p>3</p> - </td> - <td> - <button class="btn btn-default btn-sm"> - <span class="glyphicon glyphicon-pencil"></span> Edit - </button> - </td> - </tr> - <tr> - <td> - <a href="#">Family</a> - </td> - <td> - <p>Classic movies that the whole family can watch</p> - </td> - <td> - <p>3</p> - </td> - <td> - <button class="btn btn-default btn-sm"> - <span class="glyphicon glyphicon-pencil"></span> Edit - </button> - </td> - </tr> - </tbody> - </table> + <div class="col-sm-12"> + <h3>My Libraries</h3> + <table class="table table-striped table-hover"> + <thead> + <tr> + <td>Library</td> + <td>Summary</td> + <td>Movie Count</td> + <td>Options</td> + </tr> + </thead> + <tbody> + <tr> + <td> + <a href="#">Action Movies</a> + </td> + <td> + <p>This is a list of some of my favorite action movies</p> + </td> + <td> + <p>2</p> + </td> + <td> + <button class="btn btn-default btn-sm"> + <span class="glyphicon glyphicon-pencil"></span> Edit + </button> + </td> + </tr> + <tr> + <td> + <a href="#">Comedy</a> + </td> + <td> + <p>This is a list of some of my favorite comedy shows and funny movies</p> + </td> + <td> + <p>3</p> + </td> + <td> + <button class="btn btn-default btn-sm"> + <span class="glyphicon glyphicon-pencil"></span> Edit + </button> + </td> + </tr> + <tr> + <td> + <a href="#">Family</a> + </td> + <td> + <p>Classic movies that the whole family can watch</p> + </td> + <td> + <p>3</p> + </td> + <td> + <button class="btn btn-default btn-sm"> + <span class="glyphicon glyphicon-pencil"></span> Edit + </button> + </td> + </tr> + </tbody> + </table> + </div> {% endblock %} \ No newline at end of file diff --git a/project/templates/login/master.html b/project/templates/login/master.html index 4217916..0e2db7c 100644 --- a/project/templates/login/master.html +++ b/project/templates/login/master.html @@ -1,55 +1,36 @@ {% extends "index.html" %} {% block content %} - <!-- Login --> - <div class="col-xs-6 col-md-6"> - <div class="col-sm-offset-3 col-sm-12"> - <h3>Login</h3> - </div> - <form class="form-horizontal" role="form"> - <div class="form-group"> - <label for="userEmail" class="col-sm-3 control-label">Email</label> - <div class="col-xs-9 col-md-6"> - <input type="email" class="form-control" id="userEmail" placeholder="Email address"> + <!-- Login --> + <div class="col-sm-12"> + <div class="col-xs-6 col-md-6"> + {% if error %} + <div class="alert alert-danger"> + {{ error }} </div> - </div> - <div class="form-group"> - <label for="userPassword" class="col-sm-3 control-label">Password</label> - <div class="col-xs-9 col-md-6"> - <input type="password" class="form-control" id="userPassword" placeholder="Password"> + {% endif %} + + <div class="col-sm-offset-3 col-sm-12"> + <h3>Login</h3> + </div> + <form class="form-horizontal" role="form" method="post" action="{{ url_for('login') }}"> + <div class="form-group"> + <label for="userEmail" class="col-sm-3 control-label">Email</label> + <div class="col-xs-9 col-md-6"> + <input type="email" class="form-control" id="userEmail" name="email" placeholder="Email address"> + </div> </div> - </div> - <div class="form-group"> - <div class="col-sm-offset-3 col-sm-10"> - <button type="submit" class="btn btn-default">Login</button> + <div class="form-group"> + <label for="userPassword" class="col-sm-3 control-label">Password</label> + <div class="col-xs-9 col-md-6"> + <input type="password" class="form-control" id="userPassword" name="password" placeholder="Password"> + </div> </div> - </div> - </form> - </div> - - <!-- Sign-up --> - <div class="col-xs-6 col-md-6"> - <div class="col-sm-offset-3 col-sm-12"> - <h3>Sign-up</h3> - </div> - <form class="form-horizontal" role="form"> - <div class="form-group"> - <label for="userEmail" class="col-sm-3 control-label">Email</label> - <div class="col-xs-9 col-md-6"> - <input type="email" class="form-control" id="userEmail" placeholder="Email address"> - </div> - </div> - <div class="form-group"> - <label for="userPassword" class="col-sm-3 control-label">Password</label> - <div class="col-xs-9 col-md-6"> - <input type="password" class="form-control" id="userPassword" placeholder="Password"> - </div> - </div> - <div class="form-group"> - <div class="col-sm-offset-3 col-sm-10"> - <button type="submit" class="btn btn-default">Sign up</button> + <div class="form-group"> + <div class="col-sm-offset-3 col-sm-10"> + <button type="submit" class="btn btn-default">Login</button> + </div> </div> - </div> - </form> + </form> + </div> </div> - {% endblock %} \ No newline at end of file diff --git a/project/templates/login/signup.html b/project/templates/login/signup.html new file mode 100644 index 0000000..9ac427f --- /dev/null +++ b/project/templates/login/signup.html @@ -0,0 +1,42 @@ +{% extends "index.html" %} +{% block content %} + <!-- Sign-up --> + <div class="col-sm-12"> + <div class="col-xs-6 col-md-6"> + {% if error %} + <div class="alert alert-danger"> + {{ error }} + </div> + {% endif %} + + <div class="col-sm-offset-3 col-sm-12"> + <h3>Sign-up</h3> + </div> + <form class="form-horizontal" role="form" method="post" action="{{ url_for('signup') }}"> + <div class="form-group"> + <label for="userEmail" class="col-sm-3 control-label">Email</label> + <div class="col-xs-9 col-md-6"> + <input type="email" class="form-control" id="userEmail" name="email" placeholder="Email address"> + </div> + </div> + <div class="form-group"> + <label for="userPassword" class="col-sm-3 control-label">Password</label> + <div class="col-xs-9 col-md-6"> + <input type="password" class="form-control" id="userPassword" name="password" placeholder="Password"> + </div> + </div> + <div class="form-group"> + <label for="userPasswordConfirm" class="col-sm-3 control-label">Confirm Password</label> + <div class="col-xs-9 col-md-6"> + <input type="password" class="form-control" id="userPasswordConfirm" name="passwordConfirm" placeholder="Password"> + </div> + </div> + <div class="form-group"> + <div class="col-sm-offset-3 col-sm-9"> + <button type="submit" class="btn btn-default">Sign up</button> + </div> + </div> + </form> + </div> + </div> +{% endblock %} \ No newline at end of file diff --git a/project/templates/movies/master.html b/project/templates/movies/master.html index 319c3c0..7fe9c28 100644 --- a/project/templates/movies/master.html +++ b/project/templates/movies/master.html @@ -1,57 +1,60 @@ {% extends "index.html" %} {% block content %} - <h3>My Movies</h3> - <table class="table table-striped table-hover"> - <thead> - <tr> - <td>Movie</td> - <td>Summary</td> - <td>Rating</td> - <td>Options</td> - </tr> - </thead> - <tbody> - <tr> - <td> - <!--<img data-src="holder.js/165x200/sky" alt="movie title">--> - <img src="http://1.bp.blogspot.com/__cfySUj2yhk/TKE8n5fJo4I/AAAAAAAAAnY/Vwf39Hilx2Y/s1600/Bourne_Identity.jpg" style="max-width: 200px;" alt="The Bourne Identity"> - <p>The Bourne Identity</p> - </td> - <td> - <p>A man is picked up by a fishing boat, bullet-riddled and without memory, then races to elude assassins and recover from amnesia.</p> - </td> - <td> - <p>7.9/10</p> - </td> - <td> - <button class="btn btn-info btn-sm"> - <span class="glyphicon glyphicon-hand-right"></span> Lend - </button> - <button class="btn btn-default btn-sm"> - <span class="glyphicon glyphicon-pencil"></span> Edit - </button> - </td> - </tr> - <tr> - <td> - <img src="http://www.eeriedigest.com/wordpress/wp-content/uploads/2011/08/bourne-supremacy.jpg" style="max-width: 200px;" alt="The Bourne Supremacy"> - <p>The Bourne Supremacy</p> - </td> - <td> - <p>When Jason Bourne is framed for a CIA operation gone awry, he is forced to resume his former life as a trained assassin to survive.</p> - </td> - <td> - <p>7.8/10</p> - </td> - <td> - <button class="btn btn-info btn-sm"> - <span class="glyphicon glyphicon-hand-right"></span> Lend - </button> - <button class="btn btn-default btn-sm"> - <span class="glyphicon glyphicon-pencil"></span> Edit - </button> - </td> - </tr> - </tbody> - </table> + <div class="col-sm-12"> + <h3>My Movies</h3> + <table class="table table-striped table-hover"> + <thead> + <tr> + <td>Movie</td> + <td>Summary</td> + <td>Rating</td> + <td>Options</td> + </tr> + </thead> + <tbody> + <tr> + <td> + <!--<img data-src="holder.js/165x200/sky" alt="movie title">--> + <img src="http://1.bp.blogspot.com/__cfySUj2yhk/TKE8n5fJo4I/AAAAAAAAAnY/Vwf39Hilx2Y/s1600/Bourne_Identity.jpg" style="max-width: 200px;" alt="The Bourne Identity"> + <p>The Bourne Identity</p> + </td> + <td> + <p>A man is picked up by a fishing boat, bullet-riddled and without memory, then races to elude assassins and recover from amnesia.</p> + </td> + <td> + <p>7.9/10</p> + </td> + <td> + <button class="btn btn-info btn-sm"> + <span class="glyphicon glyphicon-hand-right"></span> Lend + </button> + <button class="btn btn-default btn-sm"> + <span class="glyphicon glyphicon-pencil"></span> Edit + </button> + </td> + </tr> + <tr> + <td> + <img src="http://www.eeriedigest.com/wordpress/wp-content/uploads/2011/08/bourne-supremacy.jpg" style="max-width: 200px;" alt="The Bourne Supremacy"> + <p>The Bourne Supremacy</p> + </td> + <td> + <p>When Jason Bourne is framed for a CIA operation gone awry, he is forced to resume his former life as a trained assassin to survive.</p> + </td> + <td> + <p>7.8/10</p> + </td> + <td> + <button class="btn btn-info btn-sm"> + <span class="glyphicon glyphicon-hand-right"></span> Lend + </button> + <button class="btn btn-default btn-sm"> + <span class="glyphicon glyphicon-pencil"></span> Edit + </button> + </td> + </tr> + </tbody> + </table> + </div> + {% endblock %} \ No newline at end of file diff --git a/project/templates/movies/movie.html b/project/templates/movies/movie.html index 2dbe30c..ec380a0 100644 --- a/project/templates/movies/movie.html +++ b/project/templates/movies/movie.html @@ -1,36 +1,38 @@ {% extends "index.html" %} {% block content %} - <div class="row"> - <div class="col-xs-12 col-sm-3 col-md-2"> - <img data-src="holder.js/100%x200/sky" alt="movie title"> - <button type="button" class="btn btn-default btn-sm"> - <span class="glyphicon glyphicon-pencil"></span> Edit - </button> - <button type="button" class="btn btn-warning btn-sm"> - <span class="glyphicon glyphicon-remove"></span> Remove - </button> - </div> + <div class="col-sm-12"> + <div class="row"> + <div class="col-xs-12 col-sm-3 col-md-2"> + <img data-src="holder.js/100%x200/sky" alt="movie title"> + <button type="button" class="btn btn-default btn-sm"> + <span class="glyphicon glyphicon-pencil"></span> Edit + </button> + <button type="button" class="btn btn-warning btn-sm"> + <span class="glyphicon glyphicon-remove"></span> Remove + </button> + </div> - <div class="col-xs-12 col-sm-3 col-md-2"> - <ul class="list-unstyled"> - <li>Movie Title</li> - <li>Director(s)</li> - <li>Actors (truncated)</li> - <li>Producers</li> - <li>Composer</li> - </ul> - </div> + <div class="col-xs-12 col-sm-3 col-md-2"> + <ul class="list-unstyled"> + <li>Movie Title</li> + <li>Director(s)</li> + <li>Actors (truncated)</li> + <li>Producers</li> + <li>Composer</li> + </ul> + </div> - <div class="col-xs-12 col-sm-6 col-md-8"> - <h2>Summary</h2> - <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse eget metus vitae mi interdum tristique. Integer malesuada quam tincidunt, gravida nisi vehicula, auctor mi. Morbi fermentum, neque quis adipiscing placerat, odio nunc consequat ligula, vel sagittis nisl orci id risus. Aliquam hendrerit, elit a molestie suscipit, eros tortor scelerisque odio, sit amet cursus ligula lorem et turpis. Pellentesque ante metus, suscipit id blandit eget, vehicula quis tortor. Aliquam a pharetra enim. Morbi in purus sit amet nulla egestas consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla diam nulla, iaculis lobortis varius at, auctor malesuada enim. Donec a nisl eget ligula rhoncus fermentum.</p> + <div class="col-xs-12 col-sm-6 col-md-8"> + <h2>Summary</h2> + <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse eget metus vitae mi interdum tristique. Integer malesuada quam tincidunt, gravida nisi vehicula, auctor mi. Morbi fermentum, neque quis adipiscing placerat, odio nunc consequat ligula, vel sagittis nisl orci id risus. Aliquam hendrerit, elit a molestie suscipit, eros tortor scelerisque odio, sit amet cursus ligula lorem et turpis. Pellentesque ante metus, suscipit id blandit eget, vehicula quis tortor. Aliquam a pharetra enim. Morbi in purus sit amet nulla egestas consectetur. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla diam nulla, iaculis lobortis varius at, auctor malesuada enim. Donec a nisl eget ligula rhoncus fermentum.</p> + </div> </div> - </div> - <div class="row"> - <div class="col-xs-12 col-sm-6 col-md-12"> - <h3>Movie Reviews</h3> - <p>Coming Soon!</p> + <div class="row"> + <div class="col-xs-12 col-sm-6 col-md-12"> + <h3>Movie Reviews</h3> + <p>Coming Soon!</p> + </div> </div> </div> {% endblock %} \ No newline at end of file -- GitLab