Added OpenID example

This commit is contained in:
Armin Ronacher 2010-05-04 11:23:01 +02:00
parent 67fc465262
commit bc0c0559e3
9 changed files with 390 additions and 0 deletions

View file

@ -0,0 +1,22 @@
{% extends "layout.html" %}
{% block title %}Create Profile{% endblock %}
{% block body %}
<h2>Create Profile</h2>
<p>
Hey! This is the first time you signed in on this website. In
order to proceed we need a couple of more information from you:
<form action="" method=post>
<dl>
<dt>Name:
<dd><input type=text name=name size=30 value="{{ request.form.name }}">
<dt>E-Mail
<dd><input type=text name=email size=30 value="{{ request.form.email }}">
</dl>
<p>
<input type=submit value="Create profile">
<input type=hidden name=next value="{{ next_url }}">
</form>
<p>
If you don't want to proceed, you can <a href="{{ url_for('logout')
}}">sign out</a> again.
{% endblock %}

View file

@ -0,0 +1,16 @@
{% extends "layout.html" %}
{% block title %}Edit Profile{% endblock %}
{% block body %}
<h2>Edit Profile</h2>
<form action="" method=post>
<dl>
<dt>Name:
<dd><input type=text name=name size=30 value="{{ form.name }}">
<dt>E-Mail
<dd><input type=text name=email size=30 value="{{ form.email }}">
</dl>
<p>
<input type=submit value="Update profile">
<input type=submit name=delete value="Delete">
</form>
{% endblock %}

View file

@ -0,0 +1,10 @@
{% extends "layout.html" %}
{% block body %}
<h2>Overview</h2>
{% if g.user %}
<p>
Hello {{ g.user.name }}!
{% endif %}
<p>
This is just an example page so that something is here.
{% endblock %}

View file

@ -0,0 +1,18 @@
<!doctype html>
<title>{% block title %}Welcome{% endblock %} | Flask OpenID Example</title>
<link rel=stylesheet type=text/css href="{{ url_for('static',
filename='style.css') }}">
<h1>Flask OpenID Example</h1>
<ul class=navigation>
<li><a href="{{ url_for('index') }}">overview</a>
{% if g.user %}
<li><a href="{{ url_for('edit_profile') }}">profile</a>
<li><a href="{{ url_for('logout') }}">sign out [{{ g.user.name }}]</a>
{% else %}
<li><a href="{{ url_for('login') }}">sign in</a>
{% endif %}
</ul>
{% for message in get_flashed_messages() %}
<p class=message>{{ message }}
{% endfor %}
{% block body %}{% endblock %}

View file

@ -0,0 +1,12 @@
{% extends "layout.html" %}
{% block title %}Sign in{% endblock %}
{% block body %}
<h2>Sign in</h2>
<form action="" method=post>
<p>
OpenID:
<input type=text name=openid size=30>
<input type=submit value="Sign in">
<input type=hidden name=next value="{{ next_url }}">
</form>
{% endblock %}