##// END OF EJS Templates
authomatic: do not show social buttons if not enabled
ergo -
Show More
@@ -13,25 +13,31 b''
13 <div class="m-t-1 row">
13 <div class="m-t-1 row">
14 {{ widgets.render_flash_messages(flash_msgs) }}
14 {{ widgets.render_flash_messages(flash_msgs) }}
15 </div>
15 </div>
16
16 {% if social_plugins %}
17 <div class="row">
17 <div class="row">
18
18
19 <div class="col-sm-12 text-center" id="social-form">
19 <div class="col-sm-12 text-center" id="social-form">
20
20
21 <h2>Log in or register using</h2>
21 <h2>Log in or register using</h2>
22
22 {% if social_plugins.get('google') %}
23 <a href="{{ request.route_url('social_auth', provider='google') }}"
23 <a href="{{ request.route_url('social_auth', provider='google') }}"
24 class="btn btn-default social" id="btn-google">
24 class="btn btn-default social" id="btn-google">
25 <span class="fa fa-google-plus-square fa-2x"></span> {{ _('Google') }}
25 <span class="fa fa-google-plus-square fa-2x"></span> {{ _('Google') }}
26 </a>
26 </a>
27 {% endif %}
28 {% if social_plugins.get('twitter') %}
27 <a href="{{ request.route_url('social_auth', provider='twitter') }}"
29 <a href="{{ request.route_url('social_auth', provider='twitter') }}"
28 class="btn btn-default social" id="btn-twitter">
30 class="btn btn-default social" id="btn-twitter">
29 <span class="fa fa-twitter fa-2x"></span> {{ _('Twitter') }}
31 <span class="fa fa-twitter fa-2x"></span> {{ _('Twitter') }}
30 </a>
32 </a>
33 {% endif %}
34 {% if social_plugins.get('bitbucket') %}
31 <a href="{{ request.route_url('social_auth', provider='bitbucket') }}"
35 <a href="{{ request.route_url('social_auth', provider='bitbucket') }}"
32 class="btn btn-default social" id="btn-bitbucket">
36 class="btn btn-default social" id="btn-bitbucket">
33 <span class="fa fa-bitbucket fa-2x"></span> {{ _(' Bitbucket') }}
37 <span class="fa fa-bitbucket fa-2x"></span> {{ _(' Bitbucket') }}
34 </a>
38 </a>
39 {% endif %}
40 {% if social_plugins.get('github') %}
35 <a tooltip-placement="bottom"
41 <a tooltip-placement="bottom"
36 data-uib-tooltip="Why do you ask private repository permissions?
42 data-uib-tooltip="Why do you ask private repository permissions?
37 Unfortunately Github doesn't allow issue tracker integration
43 Unfortunately Github doesn't allow issue tracker integration
@@ -40,14 +46,15 b''
40 class="btn btn-default social" id="btn-github">
46 class="btn btn-default social" id="btn-github">
41 <span class="fa fa-github fa-2x"></span> {{ _('Github') }}
47 <span class="fa fa-github fa-2x"></span> {{ _('Github') }}
42 </a>
48 </a>
49 {% endif %}
43
50
44 </div>
51 </div>
45 </div>
52 </div>
46
47 <div class="row">
48
49 <hr/>
53 <hr/>
50
54
55 {% endif %}
56
57 <div class="row">
51
58
52 <div class="col-sm-5">
59 <div class="col-sm-5">
53 <div id="sign-in-form">
60 <div id="sign-in-form">
@@ -203,9 +203,21 b' def register(request):'
203 headers = security.remember(request, new_user.id)
203 headers = security.remember(request, new_user.id)
204 return HTTPFound(location=request.route_url('/'),
204 return HTTPFound(location=request.route_url('/'),
205 headers=headers)
205 headers=headers)
206 settings = request.registry.settings
207 social_plugins = {}
208 if settings.get('authomatic.pr.twitter.key', ''):
209 social_plugins['twitter'] = True
210 if settings.get('authomatic.pr.google.key', ''):
211 social_plugins['google'] = True
212 if settings.get('authomatic.pr.github.key', ''):
213 social_plugins['github'] = True
214 if settings.get('authomatic.pr.bitbucket.key', ''):
215 social_plugins['bitbucket'] = True
216
206 return {
217 return {
207 "form": form,
218 "form": form,
208 "sign_in_form": sign_in_form
219 "sign_in_form": sign_in_form,
220 "social_plugins": social_plugins
209 }
221 }
210
222
211
223
General Comments 0
You need to be logged in to leave comments. Login now