Go directly to launchpad, do not pass go.

This commit is contained in:
Joshua McKenty 2013-07-03 18:30:08 -07:00
parent e5fb95f26f
commit 5a36a00c1f
4 changed files with 26 additions and 15 deletions

View File

@ -21,6 +21,8 @@ p.error {
background: #EBCACA;
}
.navigation li { display: inline;}
input {
font-family: 'Georgia', serif;
font-size: 16px;

View File

@ -1,8 +1,6 @@
{% extends "layout.html" %}
{% block title %}Welcome{% endblock %}
{% block body %}
<div class="container">
<div class="grid">
<div class="unit span-grid">
<h1>What is Refstack?</h1>
</div>
@ -26,6 +24,4 @@
<div class="unit span-grid">
For detailed specification, see <a href="https://etherpad.openstack.org/RefStackBlueprint">https://etherpad.openstack.org/RefStackBlueprint</a>
</div>
</div>
</div>
{% endblock %}

View File

@ -1,10 +1,19 @@
<!doctype html>
<head>
<title>{% block title %}Welcome{% endblock %} | RefStack</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('static',
filename='style.css') }}">
filename='refstack.css') }}">
<link rel="stylesheet" type="text/css" href="/static/toast.css">
<h1>RefStack with OpenID login</h1>
<ul class=navigation>
</head>
<body>
<div class="container">
<div class="grid">
<div class="unit one-of-two"> </div>
<div class="unit one-of-two">
<ul class="navigation">
<li><a href="{{ url_for('index') }}">overview</a>
{% if g.user %}
<li><a href="{{ url_for('edit_profile') }}">profile</a>
@ -13,7 +22,15 @@
<li><a href="{{ url_for('login') }}">sign in</a>
{% endif %}
</ul>
</div>
{% for message in get_flashed_messages() %}
<p class=message>{{ message }}
{% endfor %}
{% block body %}{% endblock %}
</div>
</div>
</body></html>

View File

@ -7,7 +7,7 @@ import os
import random
import sqlite3
import sys
from flask import Flask, flash, request, redirect, url_for, render_template, g, session
from flask import Flask, abort, flash, request, redirect, url_for, render_template, g, session
from flask_openid import OpenID
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.admin import Admin, BaseView, expose, AdminIndexView
@ -123,13 +123,9 @@ def login():
# if we are already logged in, go back to were we came from
if g.user is not None:
return redirect(oid.get_next_url())
if request.method == 'POST':
openid = request.form.get('openid')
if openid:
return oid.try_login(openid, ask_for=['email', 'fullname',
'nickname'])
return render_template('login.html', next=oid.get_next_url(),
error=oid.fetch_error())
return oid.try_login("https://login.launchpad.net/", ask_for=['email', 'nickname'])
# return render_template('login.html', next=oid.get_next_url(),
# error=oid.fetch_error())
@oid.after_login