Commit 515d7416 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Additional auth providers messages

parent 145ca246
......@@ -73,6 +73,7 @@ class AuthProvider(object):
module_active = False
module_enabled = False
one_per_user = False
login_prompt = _('Login using')
def get_message(self, msg, **kwargs):
params = kwargs
......@@ -94,7 +95,7 @@ class AuthProvider(object):
settings_attr = self.get_setting(attr.upper())
if not settings_attr:
return getattr(self, attr)
return settings_attr
return _(settings_attr)
else:
return super(AuthProvider, self).__getattr__(key)
......@@ -130,6 +131,8 @@ class LocalAuthProvider(AuthProvider):
description = _('Create a local password for your account')
create_prompt = _('Create an account')
add_prompt = _('Create a local password for your account')
login_prompt = _('if you already have a username and password')
signup_prompt = _('New to ~Okeanos ?')
@property
......@@ -171,6 +174,9 @@ class ShibbolethAuthProvider(AuthProvider):
'%(affiliation)s affiliation) is connected with your '
' account.')
user_title = _('Academic credentials (%(identifier)s)')
primary_login_prompt = _('If you are a student/researcher/faculty you can'
' login using your university-credentials in'
' the following page')
@property
def add_url(self):
......
<form action="{% url astakos.im.target.local.login %}" method="post"class="login innerlabels">{% csrf_token %}
<p>
{{ provider.get_primary_login_prompt_display }}
</p>
{% with login_form as form %}
{% include "im/form_render.html" %}
{% endwith %}
......
<form action="{% url astakos.im.target.local.login %}#other-login-methods" method="post"
class="login-form login innerlabels">{% csrf_token %}
<p>if you already have a username and password</p>
<p>
{{ provider.get_login_prompt_display }}
</p>
<Br />
<div class="login-form" style="display:block">
{% with login_form as form %}
......
<br />
New to okeanos ?
{{ provider.get_signup_prompt_display }}
<a href="{% url astakos.im.views.signup %}{% ifnotequal code "" %}?code={{ code|urlencode }}{% endifnotequal %}">
{{ provider.get_create_prompt_display }}
</a>
......
<p>
If you are a student/researcher/faculty you can login using your university
credentials in the following page
{{ master_auth_provider.get_primary_login_prompt_display }}
</p>
<br />
<a class="button" href="/im/login/shibboleth">ACADEMIC LOGIN</a>
LOGIN or SIGNUP using
<br />
{{ provider.get_login_prompt }}
<a href="/im/login/shibboleth?{% ifnotequal next "" %}&next={{ next|urlencode }}{% endifnotequal %}{% ifnotequal code ""%}{% if next != "" %}&{% else %}?{% endif %}code={{ code }}{% endifnotequal %}"
alt="{{ provider.get_title_display }}">{{ provider.get_title_display }}</a>
<br />LOGIN or SIGNUP using
<br />{{ provider.get_login_prompt_display }}
<a href="/im/login/twitter?{% ifnotequal next "" %}&next={{ next|urlencode }}{% endifnotequal %}{% ifnotequal code ""%}{% if next != "" %}&{% else %}?{% endif %}code={{ code }}{% endifnotequal %}"
alt="{{ provider.get_title_display }}">{{ provider.get_title_display }}</a>
......@@ -22,7 +22,6 @@
{% for provider in auth_providers %}
{% if not provider == master_auth_provider %}
{% include provider.login_prompt_template %}
<br />
{% endif %}
{% endfor %}
<div class="bottom">
......
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