First code commit

This commit is contained in:
Matt Wright
2012-03-08 16:03:53 -05:00
parent 6054e2fde4
commit f5db44d0a1
16 changed files with 811 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
{%- with messages = get_flashed_messages(with_categories=true) -%}
{% if messages %}
<ul class=flashes>
{% for category, message in messages %}
<li class="{{ category }}">{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{%- endwith %}
+20
View File
@@ -0,0 +1,20 @@
{%- if current_user.is_authenticated() -%}
<p>Hello {{ current_user.email }}</p>
{%- endif %}
<ul>
<li><a href="{{ url_for('index') }}">Index</a></li>
<li><a href="{{ url_for('profile') }}">Profile</a></li>
{% if current_user.has_role('admin') -%}
<li><a href="{{ url_for('admin') }}">Admin</a></li>
{% endif -%}
{% if current_user.has_role('admin') or current_user.has_role('editor') -%}
<li><a href="{{ url_for('admin_or_editor') }}">Admin or Editor</a></li>
{% endif -%}
<li>
{%- if current_user.is_authenticated() -%}
<a href="{{ url_for('auth.logout') }}">Log out</a>
{%- else -%}
<a href="{{ url_for('login') }}">Log in</a>
{%- endif -%}
</li>
</ul>
+3
View File
@@ -0,0 +1,3 @@
{% include "_messages.html" %}
{% include "_nav.html" %}
<p>{{ content }}</p>
+10
View File
@@ -0,0 +1,10 @@
{% include "_messages.html" %}
{% include "_nav.html" %}
<form action="{{ url_for('auth.authenticate') }}" method="POST" name="login_form">
{{ form.hidden_tag() }}
{{ form.username.label }} {{ form.username }}<br/>
{{ form.password.label }} {{ form.password }}<br/>
{{ form.remember.label }} {{ form.remember }}<br/>
{{ form.submit }}
</form>
<p>{{ content }}</p>