forked from orbit-oss/flask
Added OpenID example
This commit is contained in:
parent
67fc465262
commit
bc0c0559e3
9 changed files with 390 additions and 0 deletions
22
examples/openidexample/templates/create_profile.html
Normal file
22
examples/openidexample/templates/create_profile.html
Normal 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 %}
|
||||
16
examples/openidexample/templates/edit_profile.html
Normal file
16
examples/openidexample/templates/edit_profile.html
Normal 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 %}
|
||||
10
examples/openidexample/templates/index.html
Normal file
10
examples/openidexample/templates/index.html
Normal 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 %}
|
||||
18
examples/openidexample/templates/layout.html
Normal file
18
examples/openidexample/templates/layout.html
Normal 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 %}
|
||||
12
examples/openidexample/templates/login.html
Normal file
12
examples/openidexample/templates/login.html
Normal 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 %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue