Revision d0632ab1
b/snf-astakos-app/astakos/im/auth_providers.py | ||
---|---|---|
128 | 128 |
self.icon_medium_url = '%s%s' % (settings.MEDIA_URL, 'im/auth/icons-medium/%s.png' % |
129 | 129 |
self.module.lower()) |
130 | 130 |
|
131 |
|
|
131 | 132 |
def __getattr__(self, key): |
132 | 133 |
if not key.startswith('get_'): |
133 | 134 |
return super(AuthProvider, self).__getattribute__(key) |
b/snf-astakos-app/astakos/im/forms.py | ||
---|---|---|
937 | 937 |
'password': ['old_password', 'new_password1', 'new_password2'] |
938 | 938 |
} |
939 | 939 |
|
940 |
fields = ('email') |
|
940 | 941 |
change_password = forms.BooleanField(initial=False, required=False) |
941 | 942 |
change_email = forms.BooleanField(initial=False, required=False) |
943 |
|
|
944 |
fields_list = [ |
|
945 |
'email', |
|
946 |
'new_email_address', |
|
947 |
'first_name', |
|
948 |
'last_name', |
|
949 |
'auth_token', |
|
950 |
'auth_token_expires', |
|
951 |
'old_password', |
|
952 |
'new_password1', |
|
953 |
'new_password2', |
|
954 |
'change_email', |
|
955 |
'change_password', |
|
956 |
] |
|
942 | 957 |
|
943 | 958 |
def __init__(self, *args, **kwargs): |
944 | 959 |
super(ExtendedProfileForm, self).__init__(*args, **kwargs) |
... | ... | |
950 | 965 |
if EMAILCHANGE_ENABLED: |
951 | 966 |
self.email_change = True |
952 | 967 |
else: |
968 |
self.fields_list.remove('new_email_address') |
|
953 | 969 |
del self.fields['change_email'] |
954 | 970 |
|
955 | 971 |
|
956 | 972 |
self._init_extra_forms() |
957 | 973 |
self.save_extra_forms = [] |
958 | 974 |
self.success_messages = [] |
959 |
|
|
975 |
self.fields.keyOrder = self.fields_list |
|
976 |
|
|
977 |
|
|
960 | 978 |
def _init_extra_form_fields(self): |
961 | 979 |
if self.email_change: |
962 | 980 |
self.fields.update(self.email_change_form.fields) |
b/snf-astakos-app/astakos/im/static/im/css/forms.css | ||
---|---|---|
200 | 200 |
form.submit-inline .form-row.submit { position:absolute; left:578px; top:0; margin:0; } |
201 | 201 |
form.submit-inline .form-row input { margin:0 20px 0 0 ; } |
202 | 202 |
form.signup .back { float:right; margin:15px 70px 0 0 ; height:43px; line-height:43px } |
203 |
|
|
204 |
|
|
205 |
/* styles for complex profile form */ |
|
206 |
form .form-following p span.extra-img { background:url(../images/symbols3.png) 0 -161px; z-index:8; } |
|
207 |
form .form-following p:hover span.extra-img { background-position:0 0px; } |
|
208 |
form .form-following p:hover span.extra-img:hover { background-position:0 -54px; cursor:pointer; } |
|
209 |
form .form-following.open p span.extra-img { background-position: -33px -161px; } |
|
210 |
form .form-following.open p:hover span.extra-img { background-position: -33px 0px; } |
|
211 |
form .form-following.open p:hover span.extra-img:hover { background-position: -33px -54px; cursor:pointer; } |
b/snf-astakos-app/astakos/im/static/im/css/modules.css | ||
---|---|---|
558 | 558 |
.auth_methods ul li a.noaction:hover img { margin-top:auto; } |
559 | 559 |
.auth_methods ul li a.noaction:hover { cursor:default; } |
560 | 560 |
.auth_methods ul li a.canremove:hover img { margin-top:-57px; } |
561 |
|
|
561 |
|
|
562 | 562 |
/* login section */ |
563 | 563 |
.login-section {} |
564 | 564 |
.main-login-method { margin-bottom: 20px;} |
b/snf-astakos-app/astakos/im/static/im/js/common.js | ||
---|---|---|
263 | 263 |
} |
264 | 264 |
}, 100); |
265 | 265 |
|
266 |
|
|
267 |
/* complex form js */ |
|
268 |
|
|
269 |
// Intresting divs |
|
270 |
|
|
271 |
emailDiv = $('#id_email').parents('.form-row'); |
|
272 |
newEmailDiv = $('#id_new_email_address').parents('.form-row'); |
|
273 |
oldPasswordDiv = $('#id_old_password').parents('.form-row'); |
|
274 |
newPassword1Div = $('#id_new_password1').parents('.form-row'); |
|
275 |
newPassword2Div = $('#id_new_password2').parents('.form-row'); |
|
276 |
emailCheck = $('#id_change_email').parents('.form-row'); |
|
277 |
passwordCheck = $('#id_change_password').parents('.form-row'); |
|
278 |
|
|
279 |
if ( newEmailDiv.length>0 ){ |
|
280 |
emailDiv.addClass('form-following'); |
|
281 |
} |
|
282 |
|
|
283 |
oldPasswordDiv.addClass('form-following'); |
|
284 |
|
|
285 |
|
|
286 |
// Intresting img spans |
|
287 |
|
|
288 |
emailDiv.find('span.extra-img').attr('id','email-span'); |
|
289 |
oldPasswordDiv.find('span.extra-img').attr('id','password-span'); |
|
290 |
|
|
291 |
// Default hidden fields |
|
292 |
|
|
293 |
newEmailDiv.hide(); |
|
294 |
newPassword1Div.hide(); |
|
295 |
newPassword2Div.hide(); |
|
296 |
emailCheck.hide(); |
|
297 |
passwordCheck.hide(); |
|
298 |
|
|
299 |
|
|
300 |
|
|
301 |
newEmailDiv.addClass('email-span'); |
|
302 |
newPassword1Div.addClass('password-span'); |
|
303 |
newPassword2Div.addClass('password-span'); |
|
304 |
|
|
305 |
// Email, Password forms |
|
306 |
|
|
307 |
$('.form-following .extra-img').click(function(e){ |
|
308 |
$(this).parents('.form-row').toggleClass('open'); |
|
309 |
id = $(this).attr('id'); |
|
310 |
$('.form-row').each(function() { |
|
311 |
if( $(this).hasClass(id) ) { |
|
312 |
$(this).toggle(); |
|
313 |
} |
|
314 |
}); |
|
315 |
|
|
316 |
if ( !($(this).parents('.form-row').hasClass('open')) ){ |
|
317 |
$('.form-row').each(function() { |
|
318 |
if( $(this).hasClass(id) ) { |
|
319 |
console.info($(this).find('input[type="text"]')); |
|
320 |
$(this).find('input').val(''); |
|
321 |
} |
|
322 |
}); |
|
323 |
} |
|
324 |
}); |
|
325 |
|
|
326 |
|
|
327 |
$('#email-span').click(function(){ |
|
328 |
var $checkbox = $('input#id_change_email:checkbox'); |
|
329 |
$checkbox.attr('checked', !$checkbox.attr('checked')); |
|
330 |
}); |
|
331 |
|
|
332 |
|
|
333 |
$('#password-span').click(function(){ |
|
334 |
var $checkbox = $('input#id_change_password:checkbox'); |
|
335 |
$checkbox.attr('checked', !$checkbox.attr('checked')); |
|
336 |
}); |
|
337 |
|
|
338 |
/* end of complex form js */ |
|
339 |
|
|
266 | 340 |
|
267 | 341 |
|
268 | 342 |
}); |
b/snf-astakos-app/astakos/im/templates/im/profile_auth_methods.html | ||
---|---|---|
1 | 1 |
<div class="auth_methods"> |
2 | 2 |
<h2>LOGIN METHODS</h2> |
3 |
|
|
3 | 4 |
<div class="assigned"> |
4 | 5 |
<h3>ENABLED</h3> |
5 | 6 |
<ul> |
... | ... | |
13 | 14 |
<div class="dialog-wrap"> |
14 | 15 |
|
15 | 16 |
<p>Are you sure you want to remove {{ provider.get_title_display }} from your Authentication methods? </p> |
17 |
|
|
16 | 18 |
<p> |
17 | 19 |
<a href="{% url remove_auth_provider provider.pk %}" class="submit">Yes</a> |
18 | 20 |
<a href="#" class="no submit">No</a> |
19 | 21 |
</p> |
20 | 22 |
</div> |
23 |
|
|
21 | 24 |
|
22 | 25 |
{% else %} |
23 | 26 |
<a href="javascript:void(0);" class="noaction"> |
... | ... | |
27 | 30 |
|
28 | 31 |
|
29 | 32 |
|
33 |
|
|
30 | 34 |
{% endif %} |
31 | 35 |
</li> |
32 | 36 |
{% empty %} |
Also available in: Unified diff