Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions flaskhello.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
# import html
# import multiprocessing

from flask_mobility import Mobility
from flask import Flask, render_template, Markup, request
from flask_caching import Cache
from wtforms import Form, BooleanField, FormField, FieldList, StringField, IntegerField, validators, SelectField

http = urllib3.PoolManager()

g_app = Flask(__name__)
Mobility(g_app)
application = g_app

# from flask_table import Table, Col
Expand Down Expand Up @@ -179,12 +177,8 @@ def index():

page_order_s = str(page_order)

suffix = ""
if request.MOBILE:
suffix = ":MOBILE"

if page_order_s == g_standard_order_s:
full_page = g_c.Get(page_order_s + suffix)
full_page = g_c.Get(page_order_s)
if full_page is not None:
return full_page

Expand Down Expand Up @@ -263,7 +257,7 @@ def index():
page = render_template('page.html', columns = result)

if page_order_s == g_standard_order_s:
g_c.Put(page_order_s + suffix, page, timeout = EXPIRE_MINUTES)
g_c.Put(page_order_s, page, timeout = EXPIRE_MINUTES)
return page

class ROStringField(StringField):
Expand Down
26 changes: 13 additions & 13 deletions templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@
margin-bottom: .4em;
}

{% if not request.MOBILE %}
/* Create three equal columns that floats next to each other */
.column {
float: left;
width: 33.33%;
padding: 10px;
@media screen and (min-width: 769px) {
/* Create three equal columns that floats next to each other */
.column {
float: left;
width: 33.33%;
padding: 10px;
}

.row:after {
content: "";
display: table;
clear: both;
}
}

.row:after {
content: "";
display: table;
clear: both;
}
{% endif %}

</style>

Expand Down