Merge pull request #18 from ZeusWPI/james

JAMES
This commit is contained in:
Feliciaan De Palmenaer 2015-03-31 00:06:26 +02:00
commit f4256924a3
7 changed files with 31 additions and 13 deletions

View file

@ -27,7 +27,7 @@ class LocationAdminModel(ModelBaseView):
form_columns = ('name', 'address', 'website')
admin = Admin(app, name='FoodBot', url='/admin', template_mode='bootstrap3')
admin = Admin(app, name='James', url='/admin', template_mode='bootstrap3')
admin.add_view(UserAdminModel(User, db.session))

View file

@ -8,3 +8,18 @@ app.config.from_object('config.Configuration')
Bootstrap(app)
db = SQLAlchemy(app)
class PrefixFix(object):
def __init__(self, app, script_name):
self.app = app
self.script_name = script_name
def __call__(self, environ, start_response):
path = environ.get('SCRIPT_NAME', '') + environ.get('PATH_INFO', '')
environ['SCRIPT_NAME'] = self.script_name
environ['PATH_INFO'] = path[len(self.script_name):]
return self.app(environ, start_response)
if not app.debug:
app.wsgi_app = PrefixFix(app.wsgi_app, '/james')

View file

@ -2,10 +2,10 @@
class Configuration(object):
SQLALCHEMY_DATABASE_URI = 'sqlite:///foodbot.db'
SQLALCHEMY_DATABASE_URI = 'sqlite:///james.db'
DEBUG = True
SECRET_KEY = '<change>'
SLACK_WEBHOOK = '<add url>'
LOGFILE = 'foodbot.log'
LOGFILE = 'james.log'
ZEUS_KEY = ''
ZEUS_SECRET = ''

View file

@ -14,5 +14,8 @@ from forms import *
from utils import *
from views import *
if __name__ == '__main__':
app.run()
app.run(host='0.0.0.0', port=80)

View file

@ -3,5 +3,5 @@
{% block container %}
<h1>About</h1>
<p>This is an About page for FoodBot. Don't I look good? Oh stop, you're making me blush.</p>
<p>This is James' about page. Doesn't he look good? Oh stop, you're making him blush.</p>
{% endblock %}

View file

@ -5,8 +5,8 @@
{% block container %}
<div class="jumbotron">
<h2>Welcome to FoodBot</h2>
<h3>This is the home page for FoodBot</h3>
<h2>Hi, I'm James</h2>
<h3>What would you like to eat, sir?</h3>
</div>
<div class="row">
<div class="col-sm-5">

View file

@ -13,7 +13,7 @@
{% set active_page = active_page|default('index') -%}
{% block title %}
FoodBot - {{ active_page|capitalize }}
James - {{ active_page|capitalize }}
{% endblock %}
{% block styles %}
@ -37,7 +37,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ url_for('home') }}">FOODBOT</a>
<a class="navbar-brand" href="{{ url_for('home') }}">JAMES</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
@ -72,8 +72,8 @@
<hr>
<div class="container">
<div class="pull-right">Made with ❤ by <a href="http://zeus.ugent.be">Zeus WPI</a></div>
<div class="pull-left"><a class="github-button" href="https://github.com/ZeusWPI/FoodBot" data-icon="octicon-star" data-style="mega" data-count-href="/ZeusWPI/FoodBot/stargazers" data-count-api="/repos/ZeusWPI/FoodBot#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star ZeusWPI/FoodBot on GitHub">Star</a></div>
<div class="text-center">© {{ ""|year }}<a href="http://github.com/ZeusWPI/FoodBot"></a></div>
<div class="pull-left"><a class="github-button" href="https://github.com/ZeusWPI/james" data-icon="octicon-star" data-style="mega" data-count-href="/ZeusWPI/James/stargazers" data-count-api="/repos/ZeusWPI/James#stargazers_count" data-count-aria-label="# stargazers on GitHub" aria-label="Star ZeusWPI/James on GitHub">Star</a></div>
<div class="text-center"><a href="http://github.com/ZeusWPI/James">© {{ ""|year }}</a></div>
</div>
</footer>
{%- endblock %}