Permalink
Browse files

small fixes from bwinton comments

  • Loading branch information...
1 parent 0576657 commit c63ff3fc0e3f540aaab1d841ecfdd648ce705aae @sergiocharpineljr sergiocharpineljr committed Aug 14, 2012
Showing with 6 additions and 9 deletions.
  1. +2 −2 ispdb/config/templatetags/custom_filters.py
  2. +4 −7 ispdb/templates/config/enter_config.html
@@ -7,7 +7,7 @@
@register.filter
def data_verbose(boundField, attr_name="value"):
"""
- Returns field's data or it's verbose version
+ Returns field's data or its verbose version
for a field with choices defined.
Usage::
@@ -25,7 +25,7 @@ def data_verbose(boundField, attr_name="value"):
@register.filter
def data_verbose_field(boundField, attr_name="value"):
"""
- Returns field's data or it's verbose version
+ Returns field's data or its verbose version
for a field with choices defined.
Usage::
@@ -23,10 +23,7 @@
// add functions
function addRow(prefix, template_selector, appendto_selector) {
var template = jQuery.format($(template_selector).html());
- var i = $("#id_"+prefix+"-TOTAL_FORMS").val();
- if (i === undefined){
- i = 0;
- }
+ var i = $("#id_"+prefix+"-TOTAL_FORMS").val() | 0;
$(template(i++, prefix)).appendTo(appendto_selector);
$("#id_"+prefix+"-TOTAL_FORMS").val(i);
}
@@ -52,7 +49,7 @@
check.val("False");
$('#id_'+prefix+'-name').removeAttr("readonly");
$(this).text("Remove");
- }else{
+ } else {
check.val("True");
$('#id_'+prefix+'-name').attr("readonly", "readonly");
$(this).text("Undo");
@@ -66,7 +63,7 @@
$('#id_'+prefix+'-description').removeAttr("disabled");
$('#id_'+prefix+'-language').removeAttr("disabled");
$(this).text("Remove");
- }else{
+ } else {
check.val("True");
$('#id_'+prefix+'-description').attr("disabled", "disabled");
$('#id_'+prefix+'-language').attr("disabled", "disabled");
@@ -81,7 +78,7 @@
$('#id_'+prefix+'-url').removeAttr("readonly");
$(this).closest('tr').next().find('div').show();
$(this).text("Remove");
- }else{
+ } else {
check.val("True");
$('#id_'+prefix+'-url').attr("readonly", "readonly");
$(this).closest('tr').next().find('div').hide();

0 comments on commit c63ff3f

Please sign in to comment.