Added snippet admin and profile editing

This commit is contained in:
Armin Ronacher 2010-05-16 13:51:12 +02:00
parent aa79c72ae0
commit d87cbff134
14 changed files with 228 additions and 40 deletions

View file

@ -0,0 +1,31 @@
{% extends "layout.html" %}
{% block head %}
{{ super() }}
<style type=text/css>
h1 { background-image: url(/static/login.png); }
</style>
{% endblock %}
{% block title %}Change OpenID{% endblock %}
{% block body %}
<h2>Change OpenID</h2>
<form action="" method=post>
<p>
You can the OpenID used to log into this website. Right
now your OpenID identity is
<a href="{{ g.user.openid }}">{{ g.user.openid|displayopenid }}</a>
<p>
OpenID URL:
<input type=text name=openid class=openid size=26>
<input type=hidden name=next value="{{ next }}">
<input type=submit value=Change>
<input type=submit name=cancel value=Cancel>
<p>
Alternatively you can directly link your profile with one
of the common id providers:
<ul>
<li><a href=?provider=aol>AOL</a>
<li><a href=?provider=google>Google</a>
<li><a href=?provider=yahoo>Yahoo</a>
</ul>
</form>
{% endblock %}

View file

@ -11,7 +11,8 @@
<form action="{{ url_for('general.first_login') }}" method=post>
<p>
This is your first login on this website. You are about to sign
in with the following OpenID: <a href="{{ openid }}">{{ openid }}</a>
in with the following OpenID: <a href="{{ openid }}">{{
openid|displayopenid }}</a>
<p>
Before you can use this site we need a name for you. This is what
will be displayed next to all of your public contributions to this

View file

@ -7,7 +7,7 @@
{% endblock %}
{% block title %}Login{% endblock %}
{% block body %}
<form action="{{ url_for('general.login') }}" method=post>
<form action="" method=post>
<p>
For some of the features on this site (such as creating snippets
or adding comments) you have to be signed in. You don't need to
@ -18,5 +18,13 @@
<input type=text name=openid class=openid size=30>
<input type=hidden name=next value="{{ next }}">
<input type=submit value=Login>
<p>
Alternatively you can directly sign in by clicking on one of
the providers here in case you don't know the identity URL:
<ul>
<li><a href=?provider=aol>AOL</a>
<li><a href=?provider=google>Google</a>
<li><a href=?provider=yahoo>Yahoo</a>
</ul>
</form>
{% endblock %}

View file

@ -0,0 +1,27 @@
{% extends "layout.html" %}
{% block head %}
{{ super() }}
<style type=text/css>
h1 { background-image: url(/static/login.png); }
</style>
{% endblock %}
{% block title %}Profile{% endblock %}
{% block body %}
<form action="" method=post>
<p>
Here you can change the profile information used for this
website. Please keep in mind that you can only have one
OpenID identity linked to this account, if you change it
the old one will no longer be able to sign in.
<dl class=formlist>
<dt>Name:
<dd><input type=text name=name value="{{ name }}" size=30>
<dt>OpenID:
<dd>
<span class=disabled>{{ g.user.openid|displayopenid }}</span>
(<a href="{{ url_for('change_openid') }}">change</a>)
</dl>
<p>
<input type=submit value="Update profile">
</form>
{% endblock %}