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