From 2f56820516cbb51150a20c4026a8856a4d915eea Mon Sep 17 00:00:00 2001 From: "Austen C. Myers-Flachson" Date: Wed, 29 Dec 2021 18:33:42 -0700 Subject: [PATCH 1/3] app initialization --- Code/Austen/incomplete/flask-01/app.py | 0 .../incomplete/flask-01/static/signature.css | 43 +++++++++++++++++++ .../incomplete/flask-01/templates/base.html | 0 .../incomplete/flask-01/templates/index.html | 0 4 files changed, 43 insertions(+) create mode 100644 Code/Austen/incomplete/flask-01/app.py create mode 100644 Code/Austen/incomplete/flask-01/static/signature.css create mode 100644 Code/Austen/incomplete/flask-01/templates/base.html create mode 100644 Code/Austen/incomplete/flask-01/templates/index.html diff --git a/Code/Austen/incomplete/flask-01/app.py b/Code/Austen/incomplete/flask-01/app.py new file mode 100644 index 00000000..e69de29b diff --git a/Code/Austen/incomplete/flask-01/static/signature.css b/Code/Austen/incomplete/flask-01/static/signature.css new file mode 100644 index 00000000..36b4c715 --- /dev/null +++ b/Code/Austen/incomplete/flask-01/static/signature.css @@ -0,0 +1,43 @@ +/* minor css reset */ +body { + vertical-align: baseline; + border: 0 none; + outline: 0; + padding: 0; + margin: 0; +} +ul>li { + list-style: none; +} + +/* flexbox */ +.flex { + display: flex; +} +.flex-col { + display: flex; + flex-direction: column; +} +.flex-row { + display: flex; + flex-direction: row; +} +/* positions */ +.fixed { + position: fixed; +} +.absolute { + position: absolute; +} +.relative { + position: relative; +} +/* shapes */ +.circle { + border-radius: 50%; +} +/* colors */ +.black-white { + color: white; + background-color: black; +} diff --git a/Code/Austen/incomplete/flask-01/templates/base.html b/Code/Austen/incomplete/flask-01/templates/base.html new file mode 100644 index 00000000..e69de29b diff --git a/Code/Austen/incomplete/flask-01/templates/index.html b/Code/Austen/incomplete/flask-01/templates/index.html new file mode 100644 index 00000000..e69de29b From 5b308b1c4b5533ab630a476da3a0d3a0c8ff8c5a Mon Sep 17 00:00:00 2001 From: "Austen C. Myers-Flachson" Date: Wed, 29 Dec 2021 21:34:22 -0700 Subject: [PATCH 2/3] it sucks but it works --- Code/Austen/incomplete/flask-01/app.py | 34 +++++++++++ .../incomplete/flask-01/static/signature.css | 60 ++++++++++++------- .../incomplete/flask-01/templates/base.html | 13 ++++ .../incomplete/flask-01/templates/index.html | 35 +++++++++++ .../incomplete/flask-01/templates/order.html | 13 ++++ 5 files changed, 135 insertions(+), 20 deletions(-) create mode 100644 Code/Austen/incomplete/flask-01/templates/order.html diff --git a/Code/Austen/incomplete/flask-01/app.py b/Code/Austen/incomplete/flask-01/app.py index e69de29b..fb6f187f 100644 --- a/Code/Austen/incomplete/flask-01/app.py +++ b/Code/Austen/incomplete/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/incomplete/flask-01/static/signature.css b/Code/Austen/incomplete/flask-01/static/signature.css index 36b4c715..76ddff68 100644 --- a/Code/Austen/incomplete/flask-01/static/signature.css +++ b/Code/Austen/incomplete/flask-01/static/signature.css @@ -1,3 +1,9 @@ +:root { + --font: consolas; + --font-color: white; + --bg-color: black; +} + /* minor css reset */ body { vertical-align: baseline; @@ -10,34 +16,48 @@ ul>li { list-style: none; } -/* flexbox */ -.flex { - display: flex; +/* page styles */ +body { + font-family: var(--font); } -.flex-col { - display: flex; - flex-direction: column; +button { + background-color: darkgrey; } -.flex-row { +section { display: flex; - flex-direction: row; -} -/* positions */ -.fixed { - position: fixed; + justify-content: center; + margin: 1rem; } -.absolute { - position: absolute; +ul { + margin: 1rem; + padding: 2rem; } -.relative { - position: relative; +ul>li { + margin-right: 2rem; + font-size: 20px; } -/* shapes */ -.circle { - border-radius: 50%; +b { + font-size: 18px; } -/* colors */ .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/incomplete/flask-01/templates/base.html b/Code/Austen/incomplete/flask-01/templates/base.html index e69de29b..19c09403 100644 --- a/Code/Austen/incomplete/flask-01/templates/base.html +++ b/Code/Austen/incomplete/flask-01/templates/base.html @@ -0,0 +1,13 @@ + + + + + + + Not a Taco + + + +
{% block content %} {% endblock %}
+ + diff --git a/Code/Austen/incomplete/flask-01/templates/index.html b/Code/Austen/incomplete/flask-01/templates/index.html index e69de29b..5416e56a 100644 --- a/Code/Austen/incomplete/flask-01/templates/index.html +++ b/Code/Austen/incomplete/flask-01/templates/index.html @@ -0,0 +1,35 @@ +{% extends 'base.html' %} {% block content %} +
+

Not a Taco

+

the Burrito Shop

+
+
+
+
+ +
+ {% for group in groups %} +
{{group.title()}} +

+ {% for choice in group_options[group]['choices'] %} + + {% endfor %} +
+ {% endfor %} +
+ +
+
+ +
+
+
+ +{% endblock %} diff --git a/Code/Austen/incomplete/flask-01/templates/order.html b/Code/Austen/incomplete/flask-01/templates/order.html new file mode 100644 index 00000000..401847bc --- /dev/null +++ b/Code/Austen/incomplete/flask-01/templates/order.html @@ -0,0 +1,13 @@ +{% extends 'base.html' %} {% block content %} +

Your Taco Order

+ +
+
    + {% for key in order.keys() %} +
  • {{key.title()}}: {{order[key]}}
  • +
    + {% endfor %} +
+ +
+{% endblock %} From 9514f56fbc14b9114dee42f149fe0c4642429a27 Mon Sep 17 00:00:00 2001 From: "Austen C. Myers-Flachson" Date: Thu, 30 Dec 2021 17:31:34 -0700 Subject: [PATCH 3/3] move from working directory --- Code/Austen/{incomplete => }/flask-01/app.py | 0 Code/Austen/{incomplete => }/flask-01/static/signature.css | 0 Code/Austen/{incomplete => }/flask-01/templates/base.html | 0 Code/Austen/{incomplete => }/flask-01/templates/index.html | 0 Code/Austen/{incomplete => }/flask-01/templates/order.html | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename Code/Austen/{incomplete => }/flask-01/app.py (100%) rename Code/Austen/{incomplete => }/flask-01/static/signature.css (100%) rename Code/Austen/{incomplete => }/flask-01/templates/base.html (100%) rename Code/Austen/{incomplete => }/flask-01/templates/index.html (100%) rename Code/Austen/{incomplete => }/flask-01/templates/order.html (100%) diff --git a/Code/Austen/incomplete/flask-01/app.py b/Code/Austen/flask-01/app.py similarity index 100% rename from Code/Austen/incomplete/flask-01/app.py rename to Code/Austen/flask-01/app.py diff --git a/Code/Austen/incomplete/flask-01/static/signature.css b/Code/Austen/flask-01/static/signature.css similarity index 100% rename from Code/Austen/incomplete/flask-01/static/signature.css rename to Code/Austen/flask-01/static/signature.css diff --git a/Code/Austen/incomplete/flask-01/templates/base.html b/Code/Austen/flask-01/templates/base.html similarity index 100% rename from Code/Austen/incomplete/flask-01/templates/base.html rename to Code/Austen/flask-01/templates/base.html diff --git a/Code/Austen/incomplete/flask-01/templates/index.html b/Code/Austen/flask-01/templates/index.html similarity index 100% rename from Code/Austen/incomplete/flask-01/templates/index.html rename to Code/Austen/flask-01/templates/index.html diff --git a/Code/Austen/incomplete/flask-01/templates/order.html b/Code/Austen/flask-01/templates/order.html similarity index 100% rename from Code/Austen/incomplete/flask-01/templates/order.html rename to Code/Austen/flask-01/templates/order.html