From bdb8818e04d752eb5d570d9d495e1a7932c31181 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Mon, 5 May 2014 08:38:30 +0200 Subject: Added a link to the home to let the user request form an account. --- conf.py | 2 ++ conf/conf.cfg-sample | 1 + messages.pot | 10 +++++++++- pyaggr3g470r/templates/login.html | 3 +++ pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo | Bin 9187 -> 9296 bytes pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po | 12 ++++++++++-- pyaggr3g470r/views.py | 2 +- 7 files changed, 26 insertions(+), 4 deletions(-) diff --git a/conf.py b/conf.py index 74aa834b..a590c75a 100644 --- a/conf.py +++ b/conf.py @@ -34,6 +34,7 @@ if not ON_HEROKU: config.read("./conf/conf.cfg") PLATFORM_URL = config.get('misc', 'platform_url') + ADMIN_PLATFORM_EMAIL = config.get('misc', 'admin_platform_email') WHOOSH_ENABLED = True @@ -60,6 +61,7 @@ if not ON_HEROKU: else: PLATFORM_URL = os.environ.get('PLATFORM_URL', 'https://pyaggr3g470r.herokuapp.com/') + ADMIN_PLATFORM_EMAIL = os.environ.get('ADMIN_PLATFORM_EMAIL', '') SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL'] diff --git a/conf/conf.cfg-sample b/conf/conf.cfg-sample index 5af7d0af..1dafebcb 100644 --- a/conf/conf.cfg-sample +++ b/conf/conf.cfg-sample @@ -1,5 +1,6 @@ [misc] platform_url = https://pyaggr3g470r.herokuapp.com/ +admin_platform_email = [database] uri = postgres://cedric:password@127.0.0.1:5432/pyAggr3g470r [feedparser] diff --git a/messages.pot b/messages.pot index 49058e79..d7565947 100644 --- a/messages.pot +++ b/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2014-05-04 22:11+0200\n" +"POT-Creation-Date: 2014-05-05 08:36+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -462,6 +462,14 @@ msgstr "" msgid "Your Password" msgstr "" +#: pyaggr3g470r/templates/login.html:30 +msgid "Account creation" +msgstr "" + +#: pyaggr3g470r/templates/login.html:30 +msgid "Request an account." +msgstr "" + #: pyaggr3g470r/templates/management.html:5 msgid "Your subscriptions" msgstr "" diff --git a/pyaggr3g470r/templates/login.html b/pyaggr3g470r/templates/login.html index 4f3b6c87..689b259f 100644 --- a/pyaggr3g470r/templates/login.html +++ b/pyaggr3g470r/templates/login.html @@ -26,5 +26,8 @@ {{ form.submit(class_="btn") }} + {% if email != '' %} +

{{ _('Request an account.') }}

+ {% endif %} {% endblock %} \ No newline at end of file diff --git a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo index 0bba8ddc..788fca40 100644 Binary files a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo and b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.mo differ diff --git a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po index 54d12282..51e12053 100644 --- a/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po +++ b/pyaggr3g470r/translations/fr/LC_MESSAGES/messages.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2014-05-04 22:11+0200\n" -"PO-Revision-Date: 2014-05-04 22:11+0100\n" +"POT-Creation-Date: 2014-05-05 08:36+0200\n" +"PO-Revision-Date: 2014-05-05 08:37+0100\n" "Last-Translator: Cédric Bonhomme \n" "Language-Team: fr \n" "Language: fr\n" @@ -469,6 +469,14 @@ msgstr "Votre email" msgid "Your Password" msgstr "Votre mot de passe" +#: pyaggr3g470r/templates/login.html:30 +msgid "Account creation" +msgstr "Ouverture de compte" + +#: pyaggr3g470r/templates/login.html:30 +msgid "Request an account." +msgstr "Demander un compte." + #: pyaggr3g470r/templates/management.html:5 msgid "Your subscriptions" msgstr "Vos abonnements" diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index d91e209f..ac89f0b8 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -142,7 +142,7 @@ def login(): identity_changed.send(current_app._get_current_object(), identity=Identity(user.id)) flash(gettext("Logged in successfully."), 'success') return redirect(url_for('home')) - return render_template('login.html', form=form) + return render_template('login.html', form=form, email=conf.ADMIN_PLATFORM_EMAIL) @app.route('/logout/') @login_required -- cgit