Skip to content

Commit f2a6158

Browse files
committed
Update to support current versions of dependencies
Include support for Python 3, Flask-WTF >= 0.9.0, and Foundation 5.1.1. Update version for pypi to 2.0 because of breaking changes. Specific changes: - Update to Foundation 5.1.1 in all relevant template files and static assets - Change imports for Flask-WTF and WTForms per the guide at https://flask-wtf.readthedocs.org/en/latest/upgrade.html#version-0-9-0 - Replace Python 3 incompatible call to `iteritems` with `for key in dict` logic
1 parent 44c2c05 commit f2a6158

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+10227
-14877
lines changed

example/mysite.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33

44
from flask import Flask, render_template
55
from flask.ext.foundation import Foundation
6-
from flask.ext.wtf import Form, TextField, HiddenField, ValidationError,\
7-
Required, TextAreaField
6+
from flask.ext.wtf import Form
7+
from wtforms import TextField, HiddenField, TextAreaField
8+
from wtforms.validators import ValidationError, Required
89

910
app = Flask(__name__)
1011
Foundation(app)
@@ -34,4 +35,4 @@ def contact():
3435
return render_template('contact.html', form=form)
3536

3637
if '__main__' == __name__:
37-
app.run(debug=True)
38+
app.run(debug=True)

example/templates/contact.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
{% block body_content %}
55
<!-- Top Bar -->
66

7-
<nav class="top-bar">
8-
<ul>
7+
<nav class="top-bar" data-topbar>
8+
<ul class="title-area">
99
<!-- Title Area -->
1010
<li class="name">
1111
<h1>
@@ -14,10 +14,10 @@ <h1>
1414
</a>
1515
</h1>
1616
</li>
17-
<li class="toggle-nav"><a href="#"></a></li>
17+
<li class="toggle-topbar menu-icon"><a href="#"></a></li>
1818
</ul>
1919

20-
<section>
20+
<section class="top-bar-section">
2121
<!-- Right Nav Section -->
2222
<ul class="right">
2323
<li class="divider"></li>
@@ -72,18 +72,18 @@ <h1>
7272
<div class="row">
7373

7474
<!-- Contact Details -->
75-
<div class="nine columns">
75+
<div class="large-9 columns">
7676

7777
<h3>Get in Touch!</h3>
7878
<p>We'd love to hear from you. You can either reach out to us as a whole and one of our awesome team members will get back to you, or if you have a specific question reach out to one of our staff. We love getting email all day <em>all day</em>.</p>
7979

80-
<dl class="contained tabs">
80+
<dl class="tabs" data-tab>
8181
<dd class="active"><a href="#contactForm">Contact Our Company</a></dd>
8282
<dd><a href="#contactPeople">Specific Person</a></dd>
8383
</dl>
8484

85-
<ul class="tabs-content contained">
86-
<li id="contactFormTab" class="active">
85+
<ul class="tabs-content">
86+
<li id="contactForm" class="content active">
8787
<form method="post">
8888
{{ form.hidden_tag() }}
8989
{{ wtf.form_errors(form, False) }}
@@ -107,8 +107,8 @@ <h3>The same form rendered using quick_form</h3>
107107
{{ wtf.quick_form(form) }}
108108
</li>
109109

110-
<li id="contactPeopleTab">
111-
<ul class="block-grid five-up">
110+
<li id="contactPeople" class="content">
111+
<ul class="large-block-grid-5">
112112
<li><a href="mailto:mal@serenity.bc.reb"><img src="http://placehold.it/200x200&text=[person]" /><br />Mal Reynolds</a></li>
113113
<li><a href="mailto:zoe@serenity.bc.reb"><img src="http://placehold.it/200x200&text=[person]" /><br />Zoe Washburne</a></li>
114114
<li><a href="mailto:jayne@serenity.bc.reb"><img src="http://placehold.it/200x200&text=[person]" /><br />Jayne Cobb</a></li>
@@ -129,7 +129,7 @@ <h3>The same form rendered using quick_form</h3>
129129

130130
<!-- Sidebar -->
131131

132-
<div class="three columns">
132+
<div class="large-3 columns">
133133

134134
<h5>Map</h5>
135135

@@ -155,14 +155,14 @@ <h5>Map</h5>
155155
<!-- Footer -->
156156

157157
<footer class="row">
158-
<div class="twelve columns">
158+
<div class="large-12 columns">
159159
<hr />
160160
<div class="row">
161-
<div class="six columns">
161+
<div class="large-6 columns">
162162
<p>&copy; Copyright no one at all. Go to town.</p>
163163
</div>
164-
<div class="six columns">
165-
<ul class="link-list right">
164+
<div class="large-6 columns">
165+
<ul class="inline-list right">
166166
<li><a href="#">Link 1</a></li>
167167
<li><a href="#">Link 2</a></li>
168168
<li><a href="#">Link 3</a></li>
@@ -179,7 +179,7 @@ <h5>Map</h5>
179179

180180
<!-- Map Modal -->
181181

182-
<div class="reveal-modal" id="mapModal">
182+
<div class="reveal-modal" id="mapModal" data-reveal>
183183
<h4>Where We Are</h4>
184184
<p><img src="http://placehold.it/800x600" /></p>
185185

@@ -188,4 +188,4 @@ <h4>Where We Are</h4>
188188
</div>
189189

190190
<!-- End Modal -->
191-
{% endblock %}
191+
{% endblock %}

example/templates/index.html

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33
{% block body_content %}
44
<!-- Nav Bar -->
55
<div class="row">
6-
<div class="twelve columns">
7-
<ul class="nav-bar">
8-
<li><a href="#">Link 1</a></li>
9-
<li><a href="#">Link 2</a></li>
10-
<li><a href="#">Link 3</a></li>
11-
<li><a href="#">Link 4</a></li>
12-
</ul>
6+
<div class="large-12 columns">
7+
<div class="contain-to-grid">
8+
<nav class="top-bar" data-topbar>
9+
<section class="top-bar-section">
10+
<ul class="left">
11+
<li><a href="#">Link 1</a></li>
12+
<li><a href="#">Link 2</a></li>
13+
<li><a href="#">Link 3</a></li>
14+
<li><a href="#">Link 4</a></li>
15+
</ul>
16+
</section>
17+
</div>
1318

1419
<h1>Blog <small>This is my blog. It's awesome.</small>
1520
<hr />
@@ -20,17 +25,17 @@ <h1>Blog <small>This is my blog. It's awesome.</small>
2025
<!-- Main Page Content and Sidebar -->
2126
<div class="row">
2227
<!-- Main Blog Content -->
23-
<div class="nine columns" role="content">
28+
<div class="large-9 columns" role="content">
2429
<article>
2530
<h3><a href="#">Blog Post Title</a></h3>
2631
<h6>Written by <a href="#">John Smith</a> on August 12, 2012.</h6>
2732

2833
<div class="row">
29-
<div class="six columns">
34+
<div class="large-6 columns">
3035
<p>Bacon ipsum dolor sit amet nulla ham qui sint exercitation eiusmod commodo, chuck duis velit. Aute in reprehenderit, dolore aliqua non est magna in labore pig pork biltong. Eiusmod swine spare ribs reprehenderit culpa.</p>
3136
<p>Boudin aliqua adipisicing rump corned beef. Nulla corned beef sunt ball tip, qui bresaola enim jowl. Capicola short ribs minim salami nulla nostrud pastrami.</p>
3237
</div>
33-
<div class="six columns">
38+
<div class="large-6 columns">
3439
<img src="http://placehold.it/400x240&text=[img]" />
3540
</div>
3641
</div>
@@ -47,11 +52,11 @@ <h3><a href="#">Blog Post Title</a></h3>
4752
<h6>Written by <a href="#">John Smith</a> on August 12, 2012.</h6>
4853

4954
<div class="row">
50-
<div class="six columns">
55+
<div class="large-6 columns">
5156
<p>Bacon ipsum dolor sit amet nulla ham qui sint exercitation eiusmod commodo, chuck duis velit. Aute in reprehenderit, dolore aliqua non est magna in labore pig pork biltong. Eiusmod swine spare ribs reprehenderit culpa.</p>
5257
<p>Boudin aliqua adipisicing rump corned beef. Nulla corned beef sunt ball tip, qui bresaola enim jowl. Capicola short ribs minim salami nulla nostrud pastrami.</p>
5358
</div>
54-
<div class="six columns">
59+
<div class="large-6 columns">
5560
<img src="http://placehold.it/400x240&text=[img]" />
5661
</div>
5762
</div>
@@ -64,7 +69,7 @@ <h6>Written by <a href="#">John Smith</a> on August 12, 2012.</h6>
6469
<!-- End Main Content -->
6570

6671
<!-- Sidebar -->
67-
<aside class="three columns">
72+
<aside class="large-3 columns">
6873
<h5>Categories</h5>
6974
<ul class="side-nav">
7075
<li><a href="#">News</a></li>
@@ -86,14 +91,14 @@ <h5>Featured</h5>
8691

8792
<!-- Footer -->
8893
<footer class="row">
89-
<div class="twelve columns">
94+
<div class="large-12 columns">
9095
<hr />
9196
<div class="row">
92-
<div class="six columns">
97+
<div class="large-6 columns">
9398
<p>&copy; Copyright no one at all. Go to town.</p>
9499
</div>
95-
<div class="six columns">
96-
<ul class="link-list right">
100+
<div class="large-6 columns">
101+
<ul class="inline-list right">
97102
<li><a href="#">Link 1</a></li>
98103
<li><a href="#">Link 2</a></li>
99104
<li><a href="#">Link 3</a></li>
@@ -104,4 +109,4 @@ <h5>Featured</h5>
104109
</div>
105110
</footer>
106111
<!-- End Footer -->
107-
{% endblock %}
112+
{% endblock %}

flask_foundation/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ def init_app(self, app):
3333
app.register_blueprint(self.blueprint, static_folder='static')
3434

3535
app.jinja_env.filters['foundation_is_hidden_field'] =\
36-
is_hidden_field_filter
36+
is_hidden_field_filter

0 commit comments

Comments
 (0)