Revision cbc7a32c snf-astakos-app/astakos/im/auth_providers.py

b/snf-astakos-app/astakos/im/auth_providers.py
46 46
from astakos.im import settings as astakos_settings
47 47
from astakos.im import messages as astakos_messages
48 48

  
49
from synnefo_branding import utils as branding_utils
50

  
49 51
import logging
50 52

  
51 53
logger = logging.getLogger(__name__)
......
99 101
        ('add_prompt', 'Allows you to login using {title}'),
100 102
        ('login_extra', ''),
101 103
        ('username', '{username}'),
102
        ('disabled_for_create', '{title} is not available for signup.'),
104
        ('disabled_for_create', 'It seems this is the first time you\'re '
105
                                'trying to access {service_name}. '
106
                                'Unfortunately, we are not accepting new '
107
                                'users at this point.'),
103 108
        ('switch_success', 'Account changed successfully.'),
104 109
        ('cannot_login', '{title} is not available for login. '
105 110
                         'Please use one of your other available methods '
......
286 291
                    self.provider_details['info'] = \
287 292
                        json.loads(self.provider_details['info'])
288 293
                for key, val in self.provider_details['info'].iteritems():
289
                   params['provider_info_%s' % key.lower()] = val
294
                    params['provider_info_%s' % key.lower()] = val
290 295

  
291 296
        # resolve username, handle unexisting defined username key
292 297
        if self.user and self.username_key in params:
......
294 299
        else:
295 300
            params['username'] = self.identifier
296 301

  
302
        branding_params = dict(map(lambda k: (k[0].lower(), k[1]),
303
            branding_utils.get_branding_dict().iteritems()))
304
        params.update(branding_params)
305

  
297 306
        if not self.message_tpls_compiled:
298 307
            for key, message_tpl in self.message_tpls.iteritems():
299 308
                msg = self.messages.get(key, self.message_tpls.get(key))
......
440 449
            })
441 450
        if self.identifier and self._instance:
442 451
            urls.update({
443
                'switch': reverse(self.login_view) + '?switch_from=%d' % \
444
                    self._instance.pk,
452
                'switch': reverse(self.login_view) + '?switch_from=%d' %
453
                self._instance.pk,
445 454
                'remove': reverse('remove_auth_provider',
446 455
                                  kwargs={'pk': self._instance.pk})
447 456
            })
......
597 606
        'title': _('Academic'),
598 607
        'login_description': _('If you are a student, professor or researcher'
599 608
                               ' you can login using your academic account.'),
609
        'add_prompt': _('Allows you to login using your Academic '
610
                        'account'),
600 611
        'method_details': 'Account: {username}',
601
        'logout_extra': _('Please close all browser windows to complete '
602
                          'logout from your Academic account, too.')
612
        'logout_success_extra': _('You may still be logged in at your Academic'
613
                                  ' account though. Consider logging out '
614
                                  'from there too by closing all browser '
615
                                  'windows')
603 616
    }
604 617

  
605 618

  

Also available in: Unified diff