Browse Source

Addressed issue #1134

pull/1138/head
Jeffrey D 11 years ago
parent
commit
3c48bf8935
  1. 2
      examples/blueprintexample/simple_page/templates/pages/layout.html
  2. 8
      examples/flaskr/templates/layout.html
  3. 10
      examples/flaskr/templates/login.html
  4. 10
      examples/flaskr/templates/show_entries.html
  5. 10
      examples/jqueryexample/templates/index.html
  6. 4
      examples/jqueryexample/templates/layout.html
  7. 12
      examples/minitwit/templates/layout.html
  8. 10
      examples/minitwit/templates/login.html
  9. 14
      examples/minitwit/templates/register.html
  10. 16
      examples/minitwit/templates/timeline.html
  11. 8
      examples/persona/templates/layout.html

2
examples/blueprintexample/simple_page/templates/pages/layout.html

@ -1,6 +1,6 @@
<!doctype html> <!doctype html>
<title>Simple Page Blueprint</title> <title>Simple Page Blueprint</title>
<div class=page> <div class="page">
<h1>This is blueprint example</h1> <h1>This is blueprint example</h1>
<p> <p>
A simple page blueprint is registered under / and /pages A simple page blueprint is registered under / and /pages

8
examples/flaskr/templates/layout.html

@ -1,9 +1,9 @@
<!doctype html> <!doctype html>
<title>Flaskr</title> <title>Flaskr</title>
<link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}"> <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}">
<div class=page> <div class="page">
<h1>Flaskr</h1> <h1>Flaskr</h1>
<div class=metanav> <div class="metanav">
{% if not session.logged_in %} {% if not session.logged_in %}
<a href="{{ url_for('login') }}">log in</a> <a href="{{ url_for('login') }}">log in</a>
{% else %} {% else %}
@ -11,7 +11,7 @@
{% endif %} {% endif %}
</div> </div>
{% for message in get_flashed_messages() %} {% for message in get_flashed_messages() %}
<div class=flash>{{ message }}</div> <div class="flash">{{ message }}</div>
{% endfor %} {% endfor %}
{% block body %}{% endblock %} {% block body %}{% endblock %}
</div> </div>

10
examples/flaskr/templates/login.html

@ -1,14 +1,14 @@
{% extends "layout.html" %} {% extends "layout.html" %}
{% block body %} {% block body %}
<h2>Login</h2> <h2>Login</h2>
{% if error %}<p class=error><strong>Error:</strong> {{ error }}{% endif %} {% if error %}<p class="error"><strong>Error:</strong> {{ error }}{% endif %}
<form action="{{ url_for('login') }}" method=post> <form action="{{ url_for('login') }}" method="post">
<dl> <dl>
<dt>Username: <dt>Username:
<dd><input type=text name=username> <dd><input type="text" name="username">
<dt>Password: <dt>Password:
<dd><input type=password name=password> <dd><input type="password" name="password">
<dd><input type=submit value=Login> <dd><input type="submit" value="Login">
</dl> </dl>
</form> </form>
{% endblock %} {% endblock %}

10
examples/flaskr/templates/show_entries.html

@ -1,17 +1,17 @@
{% extends "layout.html" %} {% extends "layout.html" %}
{% block body %} {% block body %}
{% if session.logged_in %} {% if session.logged_in %}
<form action="{{ url_for('add_entry') }}" method=post class=add-entry> <form action="{{ url_for('add_entry') }}" method="post" class="add-entry">
<dl> <dl>
<dt>Title: <dt>Title:
<dd><input type=text size=30 name=title> <dd><input type="text" size="30" name="title">
<dt>Text: <dt>Text:
<dd><textarea name=text rows=5 cols=40></textarea> <dd><textarea name="text" rows="5" cols="40"></textarea>
<dd><input type=submit value=Share> <dd><input type="submit" value="Share">
</dl> </dl>
</form> </form>
{% endif %} {% endif %}
<ul class=entries> <ul class="entries">
{% for entry in entries %} {% for entry in entries %}
<li><h2>{{ entry.title }}</h2>{{ entry.text|safe }} <li><h2>{{ entry.title }}</h2>{{ entry.text|safe }}
{% else %} {% else %}

10
examples/jqueryexample/templates/index.html

@ -1,6 +1,6 @@
{% extends "layout.html" %} {% extends "layout.html" %}
{% block body %} {% block body %}
<script type=text/javascript> <script type="text/javascript">
$(function() { $(function() {
var submit_form = function(e) { var submit_form = function(e) {
$.getJSON($SCRIPT_ROOT + '/_add_numbers', { $.getJSON($SCRIPT_ROOT + '/_add_numbers', {
@ -26,8 +26,8 @@
</script> </script>
<h1>jQuery Example</h1> <h1>jQuery Example</h1>
<p> <p>
<input type=text size=5 name=a> + <input type="text" size="5" name="a"> +
<input type=text size=5 name=b> = <input type="text" size="5" name="b"> =
<span id=result>?</span> <span id="result">?</span>
<p><a href=# id=calculate>calculate server side</a> <p><a href=# id="calculate">calculate server side</a>
{% endblock %} {% endblock %}

4
examples/jqueryexample/templates/layout.html

@ -1,8 +1,8 @@
<!doctype html> <!doctype html>
<title>jQuery Example</title> <title>jQuery Example</title>
<script type=text/javascript <script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type=text/javascript> <script type="text/javascript">
var $SCRIPT_ROOT = {{ request.script_root|tojson|safe }}; var $SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
</script> </script>
{% block body %}{% endblock %} {% block body %}{% endblock %}

12
examples/minitwit/templates/layout.html

@ -1,9 +1,9 @@
<!doctype html> <!doctype html>
<title>{% block title %}Welcome{% endblock %} | MiniTwit</title> <title>{% block title %}Welcome{% endblock %} | MiniTwit</title>
<link rel=stylesheet type=text/css href="{{ url_for('static', filename='style.css') }}"> <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css') }}">
<div class=page> <div class="page">
<h1>MiniTwit</h1> <h1>MiniTwit</h1>
<div class=navigation> <div class="navigation">
{% if g.user %} {% if g.user %}
<a href="{{ url_for('timeline') }}">my timeline</a> | <a href="{{ url_for('timeline') }}">my timeline</a> |
<a href="{{ url_for('public_timeline') }}">public timeline</a> | <a href="{{ url_for('public_timeline') }}">public timeline</a> |
@ -16,17 +16,17 @@
</div> </div>
{% with flashes = get_flashed_messages() %} {% with flashes = get_flashed_messages() %}
{% if flashes %} {% if flashes %}
<ul class=flashes> <ul class="flashes">
{% for message in flashes %} {% for message in flashes %}
<li>{{ message }} <li>{{ message }}
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
{% endwith %} {% endwith %}
<div class=body> <div class="body">
{% block body %}{% endblock %} {% block body %}{% endblock %}
</div> </div>
<div class=footer> <div class="footer">
MiniTwit &mdash; A Flask Application MiniTwit &mdash; A Flask Application
</div> </div>
</div> </div>

10
examples/minitwit/templates/login.html

@ -2,15 +2,15 @@
{% block title %}Sign In{% endblock %} {% block title %}Sign In{% endblock %}
{% block body %} {% block body %}
<h2>Sign In</h2> <h2>Sign In</h2>
{% if error %}<div class=error><strong>Error:</strong> {{ error }}</div>{% endif %} {% if error %}<div class="error"><strong>Error:</strong> {{ error }}</div>{% endif %}
<form action="" method=post> <form action="" method="post">
<dl> <dl>
<dt>Username: <dt>Username:
<dd><input type=text name=username size=30 value="{{ request.form.username }}"> <dd><input type="text" name="username" size="30" value="{{ request.form.username }}">
<dt>Password: <dt>Password:
<dd><input type=password name=password size=30> <dd><input type="password" name="password" size="30">
</dl> </dl>
<div class=actions><input type=submit value="Sign In"></div> <div class="actions"><input type="submit" value="Sign In"></div>
</form> </form>
{% endblock %} {% endblock %}

14
examples/minitwit/templates/register.html

@ -2,18 +2,18 @@
{% block title %}Sign Up{% endblock %} {% block title %}Sign Up{% endblock %}
{% block body %} {% block body %}
<h2>Sign Up</h2> <h2>Sign Up</h2>
{% if error %}<div class=error><strong>Error:</strong> {{ error }}</div>{% endif %} {% if error %}<div class="error"><strong>Error:</strong> {{ error }}</div>{% endif %}
<form action="" method=post> <form action="" method="post">
<dl> <dl>
<dt>Username: <dt>Username:
<dd><input type=text name=username size=30 value="{{ request.form.username }}"> <dd><input type="text" name="username" size="30" value="{{ request.form.username }}">
<dt>E-Mail: <dt>E-Mail:
<dd><input type=text name=email size=30 value="{{ request.form.email }}"> <dd><input type="text" name="email" size="30" value="{{ request.form.email }}">
<dt>Password: <dt>Password:
<dd><input type=password name=password size=30> <dd><input type="password" name="password" size="30">
<dt>Password <small>(repeat)</small>: <dt>Password <small>(repeat)</small>:
<dd><input type=password name=password2 size=30> <dd><input type="password" name="password2" size="30">
</dl> </dl>
<div class=actions><input type=submit value="Sign Up"></div> <div class="actions"><input type="submit" value="Sign Up"></div>
</form> </form>
{% endblock %} {% endblock %}

16
examples/minitwit/templates/timeline.html

@ -12,30 +12,30 @@
<h2>{{ self.title() }}</h2> <h2>{{ self.title() }}</h2>
{% if g.user %} {% if g.user %}
{% if request.endpoint == 'user_timeline' %} {% if request.endpoint == 'user_timeline' %}
<div class=followstatus> <div class="followstatus">
{% if g.user.user_id == profile_user.user_id %} {% if g.user.user_id == profile_user.user_id %}
This is you! This is you!
{% elif followed %} {% elif followed %}
You are currently following this user. You are currently following this user.
<a class=unfollow href="{{ url_for('unfollow_user', username=profile_user.username) <a class="unfollow" href="{{ url_for('unfollow_user', username=profile_user.username)
}}">Unfollow user</a>. }}">Unfollow user</a>.
{% else %} {% else %}
You are not yet following this user. You are not yet following this user.
<a class=follow href="{{ url_for('follow_user', username=profile_user.username) <a class="follow" href="{{ url_for('follow_user', username=profile_user.username)
}}">Follow user</a>. }}">Follow user</a>.
{% endif %} {% endif %}
</div> </div>
{% elif request.endpoint == 'timeline' %} {% elif request.endpoint == 'timeline' %}
<div class=twitbox> <div class="twitbox">
<h3>What's on your mind {{ g.user.username }}?</h3> <h3>What's on your mind {{ g.user.username }}?</h3>
<form action="{{ url_for('add_message') }}" method=post> <form action="{{ url_for('add_message') }}" method="post">
<p><input type=text name=text size=60><!-- <p><input type="text" name="text" size="60"><!--
--><input type=submit value="Share"> --><input type="submit" value="Share">
</form> </form>
</div> </div>
{% endif %} {% endif %}
{% endif %} {% endif %}
<ul class=messages> <ul class="messages">
{% for message in messages %} {% for message in messages %}
<li><img src="{{ message.email|gravatar(size=48) }}"><p> <li><img src="{{ message.email|gravatar(size=48) }}"><p>
<strong><a href="{{ url_for('user_timeline', username=message.username) <strong><a href="{{ url_for('user_timeline', username=message.username)

8
examples/persona/templates/layout.html

@ -12,15 +12,15 @@
var $CURRENT_USER = {{ g.user|tojson }}; var $CURRENT_USER = {{ g.user|tojson }};
</script> </script>
<script src="{{ url_for('static', filename='persona.js') }}"></script> <script src="{{ url_for('static', filename='persona.js') }}"></script>
<link rel=stylesheet href="{{ url_for('static', filename='style.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<header> <header>
<h1>Mozilla Persona Example</h1> <h1>Mozilla Persona Example</h1>
<div class=authbar> <div class="authbar">
{% if g.user %} {% if g.user %}
Signed in as <em>{{ g.user }}</em> Signed in as <em>{{ g.user }}</em>
(<a href="#" class=signout>Sign out</a>) (<a href="#" class="signout">Sign out</a>)
{% else %} {% else %}
Not signed in. <a href="#" class=signin>Sign in</a> Not signed in. <a href="#" class="signin">Sign in</a>
{% endif %} {% endif %}
</div> </div>
</header> </header>

Loading…
Cancel
Save