diff --git a/Code/Austen/flask-01/app.py b/Code/Austen/flask-01/app.py new file mode 100644 index 00000000..fb6f187f --- /dev/null +++ b/Code/Austen/flask-01/app.py @@ -0,0 +1,34 @@ +from flask import Flask, request +from flask import render_template as render + +app = Flask(__name__) + +@app.route('/', methods=['GET', 'POST']) +def index(): + groups = ['tortilla', 'meat', 'rice', 'beans', 'cheese', 'sour cream'] + group_options = { + 'tortilla': { + 'choices': ['flour', 'corn', 'wheat', 'spinach'] + }, + 'meat': { + 'choices': ['beef', 'chicken', 'pork', 'none'] + }, + 'rice': { + 'choices': ['white', 'brown'] + }, + 'beans': { + 'choices': ['black', 'pinto'] + }, + 'cheese': { + 'choices': ['si', 'no'] + }, + 'sour cream': { + 'choices': ['si', 'no'] + } + + } + if request.method == 'POST': + order = request.form + return render('order.html', order=order) + + return render('index.html', groups=groups, group_options=group_options) diff --git a/Code/Austen/flask-01/static/signature.css b/Code/Austen/flask-01/static/signature.css new file mode 100644 index 00000000..76ddff68 --- /dev/null +++ b/Code/Austen/flask-01/static/signature.css @@ -0,0 +1,63 @@ +:root { + --font: consolas; + --font-color: white; + --bg-color: black; +} + +/* minor css reset */ +body { + vertical-align: baseline; + border: 0 none; + outline: 0; + padding: 0; + margin: 0; +} +ul>li { + list-style: none; +} + +/* page styles */ +body { + font-family: var(--font); +} +button { + background-color: darkgrey; +} +section { + display: flex; + justify-content: center; + margin: 1rem; +} +ul { + margin: 1rem; + padding: 2rem; +} +ul>li { + margin-right: 2rem; + font-size: 20px; +} +b { + font-size: 18px; +} +.black-white { + color: white; + background-color: black; +} +.center { + text-align: center; +} +.border { + border: 2px solid var(--font-color); +} +.container { + min-width: 50%; + text-align: center; + margin: 1rem; +} +.form-section { + margin-top: 1rem; +} +.option { + border-bottom: .5px dashed var(--font-color); + margin: 1rem; +} diff --git a/Code/Austen/flask-01/templates/base.html b/Code/Austen/flask-01/templates/base.html new file mode 100644 index 00000000..19c09403 --- /dev/null +++ b/Code/Austen/flask-01/templates/base.html @@ -0,0 +1,13 @@ + + +
+ + + +