forked from orbit-oss/flask
Added Persona example
This commit is contained in:
parent
e17024e85a
commit
5f648a8eb8
6 changed files with 198 additions and 0 deletions
27
examples/persona/templates/layout.html
Normal file
27
examples/persona/templates/layout.html
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<!doctype html>
|
||||
<title>{% block title %}{% endblock %} | My Blog</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||
<script src="{{ config.PERSONA_JS }}"></script>
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
|
||||
<script>
|
||||
/* the url root is useful for doing HTTP requests */
|
||||
var $URL_ROOT = {{ request.url_root|tojson }};
|
||||
|
||||
/* we store the current user here so that the persona
|
||||
javascript support knows about the current user */
|
||||
var $CURRENT_USER = {{ g.user|tojson }};
|
||||
</script>
|
||||
<script src="{{ url_for('static', filename='persona.js') }}"></script>
|
||||
<link rel=stylesheet href="{{ url_for('static', filename='style.css') }}">
|
||||
<header>
|
||||
<h1>Mozilla Persona Example</h1>
|
||||
<div class=authbar>
|
||||
{% if g.user %}
|
||||
Signed in as <em>{{ g.user }}</em>
|
||||
(<a href="#" class=signout>Sign out</a>)
|
||||
{% else %}
|
||||
Not signed in. <a href="#" class=signin>Sign in</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
{% block body %}{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue