Skip to content
Closed
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
6 changes: 5 additions & 1 deletion example/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,30 @@ <h2>Overview</h2>
{% if g.user %}
<p>
Hello {{ g.user.screen_name }}! Wanna tweet something?
</p>
<form action="{{ url_for('tweet') }}" method=post>
<p>
<input type=text name=tweet size=40>
<input type=submit value="Tweet!">
</p>
</form>
{% if tweets %}
<h3>Your Timeline</h3>
<ul>
{% for tweet in tweets %}
<li><a href="http://twitter.com/{{ tweet.user.screen_name
}}">{{ tweet.user.screen_name }}</a>: {{ tweet.text|urlize }}
}}">{{ tweet.user.screen_name }}</a>: {{ tweet.text|urlize }}</li>
{% endfor %}
</ul>
{% endif %}
{% else %}
<p>
Sign in to view your public timeline and to tweet from this
example application.
</p>
<p>
<a href="{{ url_for('login') }}"><img src="{{
url_for('static', filename='sign-in.png') }}" alt="sign in"></a>
</p>
{% endif %}
{% endblock %}
13 changes: 9 additions & 4 deletions example/templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
<!doctype html>
<head>
<title>{% block title %}Welcome{% endblock %} | Flask OAuth Example</title>
<link rel=stylesheet type=text/css href="{{ url_for('static',
filename='style.css') }}">
</head>
<body>
<h1>Flask OAuth Example</h1>
<ul class=navigation>
<li><a href="{{ url_for('index') }}">overview</a>
<li><a href="{{ url_for('index') }}">overview</a></li>
{% if g.user %}
<li><a href="{{ url_for('logout') }}">sign out [{{ g.user.screen_name}}]</a>
<li><a href="{{ url_for('logout') }}">sign out [{{ g.user.screen_name}}]</a></li>
{% else %}
<li><a href="{{ url_for('login') }}">sign in</a>
<li><a href="{{ url_for('login') }}">sign in</a></li>
{% endif %}
</ul>
{% for message in get_flashed_messages() %}
<p class=message>{{ message }}
<p class=message>{{ message }}</p>
{% endfor %}
{% block body %}{% endblock %}
</body>
</html>