Commit 054f3635 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

astakos: Conditionally autoexpand classic signup form

if classic signup ('local') appears first in IM_MODULES setting
parent 94c8abbf
......@@ -64,6 +64,8 @@ class AuthProviderBase(type):
if type_id:
include = True
if type_id in astakos_settings.IM_MODULES:
if astakos_settings.IM_MODULES.index(type_id) == 0:
dct['is_primary'] = True
dct['module_enabled'] = True
newcls = super(AuthProviderBase, cls).__new__(cls, name, bases, dct)
......@@ -80,6 +82,7 @@ class AuthProvider(object):
module = None
module_enabled = False
is_primary = False
message_tpls = OrderedDict((
('title', '{module_title}'),
......
......@@ -63,7 +63,7 @@ BILLING_FIELDS = getattr(settings, 'ASTAKOS_BILLING_FIELDS', ['is_active'])
# Queue for billing.
# Example: 'rabbitmq://guest:guest@localhost:5672/astakos'
QUEUE_CONNECTION = getattr(settings, 'ASTAKOS_QUEUE_CONNECTION', None)
QUEUE_CONNECTION = getattr(settings, 'ASTAKOS_QUEUE_CONNECTION', None)
# Set where the user should be redirected after logout
LOGOUT_NEXT = getattr(settings, 'ASTAKOS_LOGOUT_NEXT', '')
......
......@@ -20,10 +20,10 @@
</div>
</form>
</div>
{% if auth_providers|length == 1 %}
{% if auth_providers|length == 1 or provider_obj.is_primary %}
<style>
.two-cols .rt > p { display: none }
.form-stacked { display: block !important }
a.submit.standalone { display: none !important }
a.submit.standalone.{{ provider_obj.module }}-provider { display: none !important }
</style>
{% endif %}
......@@ -17,7 +17,7 @@
</h2>
<div class="main-login-method">
{% with 1 as is_master %}
{% include master_auth_provider.get_login_template %}
{% include master_auth_provider.get_login_template %}
{% endwith %}
</div>
<div class="extralogin">
......
......@@ -25,7 +25,7 @@
{% for provider_obj in auth_providers %}
{% if provider_obj.get_create_policy %}
{% if provider_obj.module == 'local' %}
<a href="#" class="submit standalone" id="signup-classic">CLASSIC</a>
<a href="#" class="submit standalone {{ provider_obj.module }}-provider" id="signup-classic">CLASSIC</a>
{% if "local" in im_modules %}
{% include "im/auth/signup_form.html" %}
{% endif %}
......
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