Skip to content

Commit

Permalink
Merge pull request #22 from Lemmah/develop
Browse files Browse the repository at this point in the history
Final Changes - First Iteration
  • Loading branch information
Lemmah authored Jul 26, 2017
2 parents 6762083 + b9060b6 commit d94b74a
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[report]
omit=
*/python?.?/*
*site-packages/*
*site-packages/nose/*
*__init__*
*tests/*
*views*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
appEnv
*.pyc
*cache*
.coverage
coverage.xml
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/Lemmah/BucketList.svg?branch=master)](https://travis-ci.org/Lemmah/BucketList) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/bff633e4448a45fb89162788a3841246)](https://www.codacy.com/app/Lemmah/BucketList?utm_source=github.com&utm_medium=referral&utm_content=Lemmah/BucketList&utm_campaign=Badge_Grade) [![Coverage Status](https://coveralls.io/repos/github/Lemmah/BucketList/badge.svg)](https://coveralls.io/github/Lemmah/BucketList) [![Code Climate](https://codeclimate.com/github/Lemmah/BucketList/badges/gpa.svg)](https://codeclimate.com/github/Lemmah/BucketList/) [![Issue Count](https://codeclimate.com/github/Lemmah/BucketList/badges/issue_count.svg)](https://codeclimate.com/github/Lemmah/BucketList/) [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/lemmah/)
[![Build Status](https://travis-ci.org/Lemmah/BucketList.svg?branch=master)](https://travis-ci.org/Lemmah/BucketList) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/bff633e4448a45fb89162788a3841246)](https://www.codacy.com/app/Lemmah/BucketList?utm_source=github.com&utm_medium=referral&utm_content=Lemmah/BucketList&utm_campaign=Badge_Grade) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/bff633e4448a45fb89162788a3841246)](https://www.codacy.com/app/Lemmah/BucketList?utm_source=github.com&utm_medium=referral&utm_content=Lemmah/BucketList&utm_campaign=Badge_Coverage) [![Code Climate](https://codeclimate.com/github/Lemmah/BucketList/badges/gpa.svg)](https://codeclimate.com/github/Lemmah/BucketList/) [![Issue Count](https://codeclimate.com/github/Lemmah/BucketList/badges/issue_count.svg)](https://codeclimate.com/github/Lemmah/BucketList/) [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/lemmah/)

# BucketList

Expand Down Expand Up @@ -56,7 +56,7 @@ This app is ready for Heroku. You can deploy your copy of this app by:
`heroku create <your_url_name>` (where <your_url_name> is what you want to call your app)
`git push heroku master`
..and boom, you're done! You can chat me on gitter in case of any problems.(gitter link is on badge above)

If you have never worked with Heroku, you can learn how to [Deploy Python Applications on Heroku](https://devcenter.heroku.com/articles/getting-started-with-python#introduction)
## Built With

* [Python Flask](https://www.fullstackpython.com/flask.html) - The web framework used
Expand Down
41 changes: 41 additions & 0 deletions app/templates/error_page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{% extends "base_layout.html" %}
{% block title %}Dream Buckets | Home {% endblock %}
{% block nav_menu_items %}
<ul id="nav-mobile" class="left hide-on-med-and-down">
</ul>
<ul id="nav-mobile" class="right hide-on-med-and-down">
</ul>
<ul class="side-nav" id="mobile-demo">
</ul>
{% endblock %}
{% block body %}
<div class="container">
<div class="row">
<div class="col s12">
<div class="card grey lighten-4">
<div class="card-content">
<span class="card-title center">Error! Something's not right.</span>
<p>Here are some house keeping rules that can help you enjoy your stay:</p>
<ul class="collection">
<li class="collection-item avatar">
<span class="title">Empty fields</span>
<p>Do not submit empty fields on any form<br>
This means:
<ul class="collection">
<li class="collection-item">Don't register without a name.</li>
<li class="collection-item">Don't create nameless bucketlists.</li>
<li class="collection-item">Don't attempt to register without a password.</li>
</ul>
</p>
</li>
</ul>
<p> We sincerely appologize for the inconvenince caused. We'll get around with some JS soon and make sure we remind you when you forget. Meanwhile, you can login again don't submit empty forms. </p>
</div>
<div class="card-action">
<a href="/">Login</a>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
2 changes: 1 addition & 1 deletion app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ <h5 class="center">Motivation</h5>
<form class="col s12" method="post" action="/register/">
<div class="input-field col s12">
<i class="material-icons prefix">account_circle</i>
<input id="icon_prefix" type="text" class="validate" name="username" required>
<input id="icon_prefix" type="text" name="username" class="validate" required="" aria-required="true">
<label for="icon_prefix">Your Name(s)</label>
</div>
<div class="input-field col s12">
Expand Down
10 changes: 10 additions & 0 deletions app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,13 @@ def remove_bucketlist_item(bucketlist_name, item_name):
flash("Your session has expired.")
return redirect("/")

# Catch empty fields
@app.route('/error_page')
def empty_fields():
''' Throw an error if a user has empty fields '''
return render_template('/error_page.html')

# Edge case: checkout for empty fields
def empty(field):
''' Return true if field is empty '''
empty_string = field.strip()
4 changes: 3 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# configurations for my app

import uuid

# Enable Flask's debugging features. Should be False in production
DEBUG = True
SESSION_TYPE = 'filesystem'
SECRET_KEY = 'super secret key'
SECRET_KEY = str(uuid.uuid4())

0 comments on commit d94b74a

Please sign in to comment.