From 1b3398a0d94376f70fe995b517050ea92b8adcb8 Mon Sep 17 00:00:00 2001 From: Olga Brani Date: Wed, 20 Jun 2012 16:02:14 +0300 Subject: [PATCH] Bug fixes --- snf-astakos-app/astakos/im/forms.py | 7 ++++--- snf-astakos-app/astakos/im/static/im/css/forms.css | 10 ++++++---- snf-astakos-app/astakos/im/static/im/css/max480.css | 3 +++ snf-astakos-app/astakos/im/static/im/css/max768.css | 4 +++- snf-astakos-app/astakos/im/static/im/css/modules.css | 2 +- snf-astakos-app/astakos/im/static/im/js/forms.js | 13 +++++++++++-- snf-astakos-app/astakos/im/templates/im/login_base.html | 8 ++++---- 7 files changed, 32 insertions(+), 15 deletions(-) diff --git a/snf-astakos-app/astakos/im/forms.py b/snf-astakos-app/astakos/im/forms.py index a8fce76..d64fbd2 100644 --- a/snf-astakos-app/astakos/im/forms.py +++ b/snf-astakos-app/astakos/im/forms.py @@ -91,12 +91,13 @@ class LocalUserCreationForm(UserCreationForm): super(LocalUserCreationForm, self).__init__(*args, **kwargs) self.fields.keyOrder = ['email', 'first_name', 'last_name', 'password1', 'password2'] - if get_latest_terms(): - self.fields.keyOrder.append('has_signed_terms') + if RECAPTCHA_ENABLED: self.fields.keyOrder.extend(['recaptcha_challenge_field', 'recaptcha_response_field',]) - + if get_latest_terms(): + self.fields.keyOrder.append('has_signed_terms') + if 'has_signed_terms' in self.fields: # Overriding field label since we need to apply a link # to the terms within the label diff --git a/snf-astakos-app/astakos/im/static/im/css/forms.css b/snf-astakos-app/astakos/im/static/im/css/forms.css index 4e5ea46..835a933 100644 --- a/snf-astakos-app/astakos/im/static/im/css/forms.css +++ b/snf-astakos-app/astakos/im/static/im/css/forms.css @@ -21,7 +21,7 @@ form.login { margin-bottom: 22px; width:340px; } form h2 span { padding-bottom: 3px; } form .form-row { min-height: 30px; position: relative;} form .form-row.submit { margin: 22px 0 ;} -form .form-row .extra-link { color: #808080; text-decoration: none; border: none; margin-top:15px; line-height:98%; display:inline-block; padding-top:15px; float: right; } +form .form-row .extra-link { color: #808080; text-decoration: none; border: none; margin-top:15px; line-height:98%; display:inline-block; padding-top:15px; float: right; position:absolute; right:0; top:0; } form .form-row .extra-link:hover { border-bottom:1px solid #808080;} form .form-row label { font-size: 1.1em; } form.innerlabels label { position: absolute; bottom: 11px; left: 1.5em; color: #808080 ; } @@ -69,7 +69,7 @@ form .with-errors label { color: #e4776f; } .form-errors.all .form-error { position: relative; border-radius: 0; margin-bottom: 1.3em; padding: 0.5em; } div.form-stacked { margin-bottom: 4em; } .checkbox-widget.checked { background-color: #FF0000; background-image: url("../images/checkbox.png"); background-position: 50% 50%; } -.checkbox-widget { border: 1px solid #808080; cursor: pointer; display: block; float: left; height: 25px; margin:5px 20px 0 0 ; width: 25px; } +.content a.checkbox-widget { border: 1px solid #808080; cursor: pointer; display: block; float: left; height: 25px; margin:5px 20px 0 0 ; width: 25px; } form.withlabels .checkbox-widget { margin-top:20px; } form.innerlabels .checkbox-widget + label { position:static; line-height:36px; color:#808080; } form.innerlabels .checkbox-widget + label + a { border-bottom:1px solid #F89A1C; font-size: 1.1em; } @@ -84,8 +84,9 @@ form .with-errors span.info { display:none;} form p { margin-bottom:0;position:relative;} form input[readonly=true] { /*background-color: #ddd;*/ color: #5e5e5e; } #recaptcha_area { margin-top:20px; } -form.innerlabels .with-checkbox .checkbox-widget { margin-top:15px; } +form.innerlabels .with-checkbox .checkbox-widget { } form.innerlabels .with-checkbox .checkbox-label { left:2.5em; top:17px; } +form.withlabels .with-checkbox .checkbox-widget { position:absolute; left:224px; top:0; } form .extra-img { display:block; width:21px; height:21px; overflow:hidden; position:absolute; } form.withlabels .extra-img { left:440px; bottom:12px; } @@ -105,7 +106,7 @@ form .with-hidden { display:none; } /* custom captcha */ -#okeanos_recaptcha { width:331px; border:1px solid #808080; margin:20px 0; position:relative; } +#okeanos_recaptcha { width:329px; border:1px solid #808080; margin:0 0 20px; position:relative; } #okeanos_recaptcha #recaptcha_image { padding:15px 0; } #okeanos_recaptcha label.recaptcha_only_if_image, #okeanos_recaptcha label.recaptcha_only_if_audio{ position:absolute; top:auto; bottom:11px; } @@ -127,6 +128,7 @@ input[type="submit"]:focus { box-shadow: 0 0 0 1px #FFFFFF inset; border:1p form.withlabels span.info { left:222px; } form .extra-img { left:222px; } .form-error { margin-left:0!important; } + } diff --git a/snf-astakos-app/astakos/im/static/im/css/max480.css b/snf-astakos-app/astakos/im/static/im/css/max480.css index 4f50310..a861847 100644 --- a/snf-astakos-app/astakos/im/static/im/css/max480.css +++ b/snf-astakos-app/astakos/im/static/im/css/max480.css @@ -2,3 +2,6 @@ .two-cols-blog .rt { width:auto; padding-right:0; margin-left:0; float:none;} .resources .categories ul li { display:block; float:none;} .container .navigation ul+ul { margin-top:20px} + +/* forms */ +form .form-row .extra-link { float:none; position:static; margin-left:15px;} diff --git a/snf-astakos-app/astakos/im/static/im/css/max768.css b/snf-astakos-app/astakos/im/static/im/css/max768.css index dd54922..e9fc855 100644 --- a/snf-astakos-app/astakos/im/static/im/css/max768.css +++ b/snf-astakos-app/astakos/im/static/im/css/max768.css @@ -4,6 +4,8 @@ .bg-wrap { background-position:-9999px -9999px; } .buttons-list.fixpos { position:static; } .buttons-list .button { margin-left:0; } -form input.submit, form input[type="submit"] { margin:0; } .container .lt-div { float:none; width:auto; } .container ul.options { margin-bottom:30px; } +/* forms */ +form input.submit, form input[type="submit"] { margin:0; } +form .form-row .extra-link { padding-top:0; } \ No newline at end of file diff --git a/snf-astakos-app/astakos/im/static/im/css/modules.css b/snf-astakos-app/astakos/im/static/im/css/modules.css index 47e5243..331c2ca 100644 --- a/snf-astakos-app/astakos/im/static/im/css/modules.css +++ b/snf-astakos-app/astakos/im/static/im/css/modules.css @@ -1,4 +1,4 @@ -body { min-width:32px; overflow-y: scroll;} +body { min-width:320px; overflow-y: scroll;} .wrapper { margin:0 auto; position:relative; width:820px; padding:36px 70px; } .container .wrapper, .footer .wrapper { border: 1px solid #808080; border-top:0 none;} diff --git a/snf-astakos-app/astakos/im/static/im/js/forms.js b/snf-astakos-app/astakos/im/static/im/js/forms.js index 4799691..5ae7cbb 100644 --- a/snf-astakos-app/astakos/im/static/im/js/forms.js +++ b/snf-astakos-app/astakos/im/static/im/js/forms.js @@ -5,7 +5,7 @@ return this.each(function() { // process checkboxes var $this = $(this); - var el = $(''); + var el = $(''); var form = $this.closest(".form-row"); // add class to identify form rows which contain a checkbox @@ -33,9 +33,18 @@ el.click(function() { el.toggleClass("checked"); $this.attr('checked', el.hasClass("checked")); + }); + + el.keypress(function(e){ + + if (e.keyCode == 0 || e.keyCode == 32){ + e.preventDefault(); + el.toggleClass("checked"); + $this.attr('checked', el.hasClass("checked")); + } }) - $this.after(el); + $this.prev('label').before(el); }); diff --git a/snf-astakos-app/astakos/im/templates/im/login_base.html b/snf-astakos-app/astakos/im/templates/im/login_base.html index d3e4bdf..300b9c8 100644 --- a/snf-astakos-app/astakos/im/templates/im/login_base.html +++ b/snf-astakos-app/astakos/im/templates/im/login_base.html @@ -27,10 +27,10 @@ {% include "im/form_render.html" %} {% endwith %} -
- Forgot your password? + {% endif %} @@ -44,7 +44,7 @@ {% endif %}
{% endfor %} - +
{% block body.signup %} {% for o in im_modules %} {% if o != 'local' %} -- 1.7.10.4