Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
054f3635
Commit
054f3635
authored
May 22, 2013
by
Kostas Papadimitriou
Browse files
astakos: Conditionally autoexpand classic signup form
if classic signup ('local') appears first in IM_MODULES setting
parent
94c8abbf
Changes
5
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/auth_providers.py
View file @
054f3635
...
...
@@ -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}'
),
...
...
snf-astakos-app/astakos/im/settings.py
View file @
054f3635
...
...
@@ -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'
,
''
)
...
...
snf-astakos-app/astakos/im/templates/im/auth/signup_form.html
View file @
054f3635
...
...
@@ -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 %}
snf-astakos-app/astakos/im/templates/im/login_base.html
View file @
054f3635
...
...
@@ -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"
>
...
...
snf-astakos-app/astakos/im/templates/im/signup.html
View file @
054f3635
...
...
@@ -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 %}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment