From 47d46223aae7485f72d2bf503a8def116b682034 Mon Sep 17 00:00:00 2001 From: Feliciaan De Palmenaer Date: Fri, 5 Jun 2015 11:29:14 +0200 Subject: [PATCH 1/3] Added print.css and updated requirements, GA --- app/static/css/print.css | 15 +++++++++++++++ app/templates/layout.html | 5 ++++- app/templates/order.html | 15 ++++++++------- requirements.txt | 19 +++++++++---------- 4 files changed, 36 insertions(+), 18 deletions(-) create mode 100644 app/static/css/print.css diff --git a/app/static/css/print.css b/app/static/css/print.css new file mode 100644 index 0000000..945bb21 --- /dev/null +++ b/app/static/css/print.css @@ -0,0 +1,15 @@ +@media print { + nav, form, footer, .btn, #form, #debts { + display: none; + } + #items { + display: flex; + } + #items-list { + order: 2; + } + #items-ordered { + order: 1; + margin-right: 50px; + } +} \ No newline at end of file diff --git a/app/templates/layout.html b/app/templates/layout.html index c30c12f..c35e6a5 100644 --- a/app/templates/layout.html +++ b/app/templates/layout.html @@ -1,5 +1,6 @@ {% extends "bootstrap/base.html" %} {% import "bootstrap/utils.html" as utils %} +{% import "bootstrap/google.html" as google %} {% set navbar = [ ('home', 'Home'), @@ -18,11 +19,13 @@ {% block styles %} {{ super() }} - + + {% endblock %} {% block scripts %} {{ super() }} + {{ google.uanalytics('UA-25444917-9') }} {% endblock %} diff --git a/app/templates/order.html b/app/templates/order.html index 0d9821c..3c98cfe 100644 --- a/app/templates/order.html +++ b/app/templates/order.html @@ -7,8 +7,8 @@ {% block container %}
-
-

Order {{ order.id }} +
+

Order {{ order.id }} {% if courier_or_admin -%} Close
Edit @@ -26,7 +26,7 @@ total price: {{ total_price|euro }} {% if courier_or_admin %}- remaining debts: {{ debts|euro }}{% endif %}

{% if form -%} -
+

Order:

{{ form.csrf_token }} @@ -49,8 +49,8 @@
{%- endif %}
-
-
+
+

Items

@@ -69,7 +69,7 @@
-
+

Ordered products:

{% for key, value in order.group_by_product().items() -%} {{ key }} - {{ value }}
@@ -77,7 +77,7 @@
-
+

Debts

@@ -102,6 +102,7 @@ {{ super() }} + {% endblock %} {% block scripts %} {{ super() }} diff --git a/requirements.txt b/requirements.txt index 060e0c7..29c7cb8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,18 +1,17 @@ -certifi==14.5.14 Flask==0.10.1 -Flask-Admin==1.0.9 -Flask-Bootstrap==3.3.2.1 +Flask-Admin==1.1.0 +Flask-Bootstrap==3.3.4.1 Flask-Login==0.2.11 -Flask-OAuthlib==0.8.0 +Flask-OAuthlib==0.9.1 Flask-SQLAlchemy==2.0 -Flask-WTF==0.10.3 +Flask-WTF==0.11 Flask-Migrate==1.4.0 itsdangerous==0.24 -Jinja2==2.7.2 +Jinja2==2.7.3 MarkupSafe==0.23 oauthlib==0.7.2 PyMySQL==0.6.6 -requests==2.4.0 -SQLAlchemy==0.9.8 -Werkzeug==0.9.6 -WTForms==2.0 +requests==2.7.0 +SQLAlchemy==1.0.4 +Werkzeug==0.10.4 +WTForms==2.0.2 From feb1bb0b698aff9dca17ffaff8a10882c10c9122 Mon Sep 17 00:00:00 2001 From: Feliciaan De Palmenaer Date: Fri, 5 Jun 2015 11:34:39 +0200 Subject: [PATCH 2/3] Add link to form --- app/templates/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/home.html b/app/templates/home.html index 1e035bd..d5826a8 100644 --- a/app/templates/home.html +++ b/app/templates/home.html @@ -20,7 +20,7 @@ {% else %}

No orders available.

{% if not current_user.is_anonymous() %} - To create an order, fill in the form on the right. + To create an order, fill in the form here. {% else %} Login to create an order, or ask someone else. {% endif %} From e50e97b4282d4b3116d2f46537da24a9e411a329 Mon Sep 17 00:00:00 2001 From: Feliciaan De Palmenaer Date: Fri, 5 Jun 2015 11:39:34 +0200 Subject: [PATCH 3/3] Add initial profile --- app/templates/layout.html | 2 +- app/templates/profile.html | 6 ++++++ app/views/__init__.py | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 app/templates/profile.html diff --git a/app/templates/layout.html b/app/templates/layout.html index c35e6a5..3baedf4 100644 --- a/app/templates/layout.html +++ b/app/templates/layout.html @@ -54,7 +54,7 @@ {% if current_user.is_anonymous() %}
  • Login
  • {% else %} -
  • {{ current_user.username }}
  • +
  • {{ current_user.username }}
  • Logout
  • {% endif %} diff --git a/app/templates/profile.html b/app/templates/profile.html new file mode 100644 index 0000000..09a5891 --- /dev/null +++ b/app/templates/profile.html @@ -0,0 +1,6 @@ +{% extends "layout.html" -%} +{% set active_page = "profile" -%} + +{% block container %} +

    {{ current_user.username }}

    +{% endblock %} diff --git a/app/views/__init__.py b/app/views/__init__.py index 0a668fd..911b392 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -26,6 +26,11 @@ def about(): def stats(): return render_template('stats.html') +@app.route('/profile/') +@login_required +def profile(): + return render_template('profile.html') + if app.debug: # add route information @app.route('/routes')