Revision 531fca05

b/snf-astakos-app/astakos/im/auth_providers.py
85 85
    remote_logout_url = None
86 86
    logout_from_provider_text = None
87 87
    icon_url = None
88
    icon_medium_url = None
88 89

  
89 90
    def get_message(self, msg, **kwargs):
90 91
        params = kwargs
......
122 123
        if not self.icon_url:
123 124
            self.icon_url = '%s%s' % (settings.MEDIA_URL, 'im/auth/icons/%s.png' %
124 125
                                       self.get_title_display.lower())
126
            
127
        if not self.icon_medium_url:
128
            self.icon_medium_url = '%s%s' % (settings.MEDIA_URL, 'im/auth/icons-medium/%s.png' %
129
                                       self.module.lower())    
125 130

  
126 131
    def __getattr__(self, key):
127 132
        if not key.startswith('get_'):
b/snf-astakos-app/astakos/im/models.py
676 676
        providers = []
677 677
        for provider in self.auth_providers.active(**filters):
678 678
            if auth_providers.get_provider(provider.module).is_available_for_login():
679
                providers.append(provider)
679
                providers.append(auth_providers.get_provider(provider.module))
680 680
        return providers
681 681

  
682 682
    @property
b/snf-astakos-app/astakos/im/static/im/css/modules.css
528 528
.content .how-it-works .link-33					{ bottom:275px; right:14px; }
529 529
.content .how-it-works .link-42					{ bottom:12px; left:251px; }
530 530

  
531
/*
531 532
.auth_methods									{ margin-top:2em; padding-bottom:1em; }
532 533
.auth_methods ul								{ margin:1em 0; padding:0; list-style:none outside none; }
533 534
.auth_methods ul li 							{ margin:0 0 1em 0; padding:0; list-style:none outside none; font-size:1.154em; }
......
541 542
.auth_methods .dialog-wrap						{ display:inline; position:relative; }
542 543
.auth_methods .dialog							{ background:#fff; border:1px dashed #ccc; position:absolute; bottom:30px; left:0; padding:15px; width:220px; display:none;}
543 544
.auth_methods .dialog .submit					{ min-width:30px; padding:5px 22px; } 
545
*/
544 546
.right-align									{ text-align:right; }			
545 547

  
548
.auth_methods h3								{ float:left; width:224px; font-size:1.308em;}
549
.auth_methods ul								{ overflow:hidden; }
550
.auth_methods ul li								{ list-style:none outside none; padding:0; margin:0 0 5px 0; }
551
.auth_methods ul li a							{ display:inline-block; height:50px; overflow:hidden; vertical-align:middle; }
552
.auth_methods ul li a:hover img					{ margin-top:-55px; }
553
.auth_methods ul li span						{ display:none;  color:#55B577; padding-left:70px; background:url(../images/line-green.jpg) repeat-x left center; margin-left:-4px;}
554
.auth_methods ul li span em						{ font-style:normal; background:#fff; padding-left:5px;}
555
.auth_methods ul li a:hover + span				{ display:inline; }
556
.auth_methods .dialog-wrap						{ color:red; display:none; }
557
.auth_methods .dialog-wrap .submit				{ min-width:10px; text-transform:uppercase; margin-right:10px; }
558
.auth_methods ul li a.noaction:hover img		{ margin-top:auto; }
559
.auth_methods ul li a.noaction:hover			{ cursor:default; }
560
.auth_methods ul li a.canremove:hover img		{ margin-top:-57px; }
546 561

  
547 562
/* login section */
548 563
.login-section {}
b/snf-astakos-app/astakos/im/static/im/js/common.js
241 241
    
242 242
    
243 243
    
244
     $('.auth_methods').find('li>a').click(function(e){
245
     	e.preventDefault();
246
     	$(this).siblings('.wrap').toggle('slow');
247
     	$(this).toggleClass('up');
248
     });
249
     
250
     $('.auth_methods a.red').click(function(e){
251
     	e.preventDefault();
252
     	$(this).siblings('.dialog').show();
253
     })
254
     
244
    $('.auth_methods .canremove').click( function(e) {
245
    	e.preventDefault(e);
246
    	$(this).addClass('remove');
247
    	$(this).siblings('.dialog-wrap').slideDown('slow');
248
    })  
249
    
250
    $('.auth_methods .no').click( function(e) {
251
    	e.preventDefault(e);
252
    	$(this).parents('.dialog-wrap').siblings('.canremove').removeClass('remove');
253
    	$(this).parents('.dialog-wrap').slideUp('slow');
254
    })  
255 255
      
256
     $('.auth_methods .dialog .no').click( function(e){	 
257
     	e.preventDefault();
258
     	console.log($(this));
259
     	$(this).parents('.dialog').hide();
260
     })
261 256
    
262 257
    setTimeout(function() {
263 258
      if ($('input#id_username').val()){ 
b/snf-astakos-app/astakos/im/templates/im/profile_auth_methods.html
30 30
        {% endfor %}
31 31
        
32 32
    </ul>
33
    <ul class="notassigned">
34
        <li>
35
            <a href="#">+ Add new login method</a>
36
            
37
            <div class="wrap">
38
                {% for provider in user_available_providers %}
39
                <p><a href="{{ provider.add_url }}?force_login=1">
40
                  {{ provider.get_title_display }}</a><br />
41
                <span class="description">
42
                  {{ provider.get_add_prompt_display }}
43
                </span>
44
                  </p>
45
                {% empty %}
46
                No available providers 
47
                {% endfor %}	
48
            </div>
49
            
50
        </li>
51
    </ul>
33
    <div class="assigned">
34
        <h3>ENABLED</h3>
35
        <ul>
36
        	{% for provider in user_providers %}
37
        	<li>
38
        		{% if provider.can_remove %}
39
        				<a href="#" class="canremove">
40
		                  <img src="{{ provider.get_icon_medium_url_display }}" alt="{{ provider.get_title_display }}" />
41
		                </a>
42
                      	<div class="dialog-wrap">
43
                        	 
44
                          	<p>Are you sure you want to remove  {{ provider.get_title_display }} from your Authentication methods? </p>
45
							<p>
46
								<a href="{% url remove_auth_provider provider.pk %}" class="submit">Yes</a>
47
								<a href="#" class="no submit">No</a>
48
							</p>
49
                        </div>	
50
                      
51
                  {% else %}
52
                  	<a href="javascript:void(0);" class="noaction">
53
		                  <img src="{{ provider.get_icon_medium_url_display }}" alt="{{ provider.get_title_display }}" />
54
		                </a>
55
                      	 
56
                      
57
                         
58
                  {% endif %}
59
        	</li>
60
        	{% empty %}
61
        		No available providers 
62
        	{% endfor %}
63
        </ul>
64
    </div>
65
    <div class="notassigned">
66
        <h3>AVAILABLE</h3>
67
        <ul>
68
        	{% for provider in user_available_providers %}
69
        	<li>
70
        		<a href="{{ provider.add_url }}?force_login=1">
71
                  <img src="{{ provider.get_icon_medium_url_display }}" alt="{{ provider.get_title_display }}" /></a>
72
                <span><em>{{ provider.get_add_prompt_display }}</em></span>
73
        	</li>
74
        	{% empty %}
75
        		No available providers 
76
        	{% endfor %}
77
        </ul>
78
    </div>
52 79
    
53 80
</div>
54 81

  

Also available in: Unified diff