Commit 54a4362c authored by colmoneill's avatar colmoneill

Temporary finish of markdown document parser & beginning of

work on implementation of Flask-Security:

* moved markdown images into a folder inside the static root
of the theme, until we work out if we won't use flask frozen
instead
* adds a featured_image: key to the md for test
* does template adaptations to check if key is used
* copied templates of the flask-security login system to the
template folder and began some mods
parent 78b85423
title: bras robotique
published: 2010-12-24
featured_image: content_img/test.jpg
featured_image: page_images/test.jpg
......
......@@ -19,8 +19,16 @@
<div class="tutoWrapper">
<H3>LEARN</H3>
{% for article in articles %}
<img src="{{article.featured_image}}"
<li><a href="/learn/{{article.path}}">{{article.title}}</a></li>
<li>
{% if article.featured_image %}
<div class="thumbnail">
<img class="document_thumbnail_img" src="../static/{{article.featured_image}}">
</div>
{% else %}
<div class="thumbnail no-img"></div>
{% endif %}
<a href="/learn/{{article.path}}">{{article.title}}</a>
{% endfor %}
</li>
</div>
{% endblock %}
{% macro render_field_with_errors(field) %}
<p>
{{ field.label }} {{ field(**kwargs)|safe }}
{% if field.errors %}
<ul>
{% for error in field.errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
</p>
{% endmacro %}
{% macro render_field(field) %}
<p>{{ field(**kwargs)|safe }}</p>
{% endmacro %}
{% if security.registerable or security.recoverable or security.confirmable %}
<li><a href="{{ url_for_security('login') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}">{{ _('Login') }}</a></li>
{% if security.registerable %}
<li><a href="{{ url_for_security('register') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}">{{ _('Register') }}</a><br/></li>
{% endif %}
{% if security.recoverable %}
<li><a href="{{ url_for_security('forgot_password') }}">{{ _('Forgot password') }}</a><br/></li>
{% endif %}
{% if security.confirmable %}
<li><a href="{{ url_for_security('send_confirmation') }}">{{ _('Confirm account') }}</a></li>
{% endif %}
{% endif %}
{%- 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 %}
{% extends "base.html" %}
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Change password') }}</h1>
<form action="{{ url_for_security('change_password') }}" method="POST" name="change_password_form">
{{ change_password_form.hidden_tag() }}
{{ render_field_with_errors(change_password_form.password) }}
{{ render_field_with_errors(change_password_form.new_password) }}
{{ render_field_with_errors(change_password_form.new_password_confirm) }}
{{ render_field(change_password_form.submit) }}
</form>
{% endblock %}
<p>{{ _('Your password has been changed.') }}</p>
{% if security.recoverable %}
<p>{{ _('If you did not change your password,') }} <a href="{{ url_for_security('forgot_password', _external=True) }}">{{ _('click here to reset it') }}</a>.</p>
{% endif %}
{{ _('Your password has been changed') }}
{% if security.recoverable %}
{{ _('If you did not change your password, click the link below to reset it.') }}
{{ url_for_security('forgot_password', _external=True) }}
{% endif %}
<p>{{ _('Please confirm your email through the link below:') }}</p>
<p><a href="{{ confirmation_link }}">{{ _('Confirm my account') }}</a></p>
{{ _('Please confirm your email through the link below:') }}
{{ confirmation_link }}
<p>{{ _('Welcome %(email)s!', email=user.email) }}</p>
<p>{{ _('You can log into your account through the link below:') }}</p>
<p><a href="{{ login_link }}">{{ _('Login now') }}</a></p>
{{ _('Welcome %(email)s!', email=user.email) }}
{{ _('You can log into your account through the link below:') }}
{{ login_link }}
<p><a href="{{ reset_link }}">{{ _('Click here to reset your password') }}</a></p>
{{ _('Click the link below to reset your password:') }}
{{ reset_link }}
<p>{{ _('Your password has been reset') }}</p>
{{ _('Your password has been reset') }}
<p>{{ _('Welcome %(email)s!', email=user.email) }}</p>
{% if security.confirmable %}
<p>{{ _('You can confirm your email through the link below:') }}</p>
<p><a href="{{ confirmation_link }}">{{ _('Confirm my account') }}</a></p>
{% endif %}
{{ _('Welcome %(email)s!', email=user.email) }}
{% if security.confirmable %}
{{ _('You can confirm your email through the link below:') }}
{{ confirmation_link }}
{% endif %}
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Send password reset instructions') }}</h1>
<form action="{{ url_for_security('forgot_password') }}" method="POST" name="forgot_password_form">
{{ forgot_password_form.hidden_tag() }}
{{ render_field_with_errors(forgot_password_form.email) }}
{{ render_field(forgot_password_form.submit) }}
</form>
{% endblock %}
{% extends "base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Login') }}</h1>
<form action="{{ url_for_security('login') }}" method="POST" name="login_user_form">
{{ login_user_form.hidden_tag() }}
{{ render_field_with_errors(login_user_form.email) }}
{{ render_field_with_errors(login_user_form.password) }}
{{ render_field_with_errors(login_user_form.remember) }}
{{ render_field(login_user_form.submit) }}
</form>
{# {% include "security/_menu.html" %}#}
{% endblock %}
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Register') }}</h1>
<form action="{{ url_for_security('register') }}" method="POST" name="register_user_form">
{{ register_user_form.hidden_tag() }}
{{ render_field_with_errors(register_user_form.email) }}
{{ render_field_with_errors(register_user_form.password) }}
{% if register_user_form.password_confirm %}
{{ render_field_with_errors(register_user_form.password_confirm) }}
{% endif %}
{{ render_field(register_user_form.submit) }}
</form>
{% include "security/_menu.html" %}
{% endblock %}
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Reset password') }}</h1>
<form action="{{ url_for_security('reset_password', token=reset_password_token) }}" method="POST" name="reset_password_form">
{{ reset_password_form.hidden_tag() }}
{{ render_field_with_errors(reset_password_form.password) }}
{{ render_field_with_errors(reset_password_form.password_confirm) }}
{{ render_field(reset_password_form.submit) }}
</form>
{% include "security/_menu.html" %}
{% endblock %}
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Resend confirmation instructions') }}</h1>
<form action="{{ url_for_security('send_confirmation') }}" method="POST" name="send_confirmation_form">
{{ send_confirmation_form.hidden_tag() }}
{{ render_field_with_errors(send_confirmation_form.email) }}
{{ render_field(send_confirmation_form.submit) }}
</form>
{% include "security/_menu.html" %}
{% endblock %}
{% extends "security/base.html" %}
{% from "security/_macros.html" import render_field_with_errors, render_field %}
{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Login') }}</h1>
<form action="{{ url_for_security('login') }}" method="POST" name="send_login_form">
{{ send_login_form.hidden_tag() }}
{{ render_field_with_errors(send_login_form.email) }}
{{ render_field(send_login_form.submit) }}
</form>
{% include "security/_menu.html" %}
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment