diff options
-rw-r--r-- | templates/chimere/blocks/actions.html | 2 | ||||
-rw-r--r-- | templates/chimere/edit.html | 22 |
2 files changed, 13 insertions, 11 deletions
diff --git a/templates/chimere/blocks/actions.html b/templates/chimere/blocks/actions.html index b98ba89..60649be 100644 --- a/templates/chimere/blocks/actions.html +++ b/templates/chimere/blocks/actions.html @@ -13,7 +13,7 @@ {% trans "News" %} </li> <li id='action-project' class='dyn-page'> - <a href='{% url 'chimere:extra_page' "" "project"%}'>{% trans "The project" %}</a> + <a href='{% url "chimere:extra_page" "" "project"%}'>{% trans "The project" %}</a> </li> </ul> <ul id='action-3' class='action'> diff --git a/templates/chimere/edit.html b/templates/chimere/edit.html index 48f18ef..23df7aa 100644 --- a/templates/chimere/edit.html +++ b/templates/chimere/edit.html @@ -181,29 +181,31 @@ {% endif %} {% endcomment %} + $('#modal-edit button.btn-primary').unbind("click"); $('#modal-edit button.btn-primary').click(function(){ // JS tests because if a file is submited there is no way // to refill the form with (browser security issue) if (typeof tinyMCE !== 'undefined') tinyMCE.triggerSave(); - validation = [{%if route%} - 'id_route'{%else%}'id_point'{% endif %}, - 'id_name', - 'id_categories',{% if event %} - 'id_start_date',{% endif %} + validation = [ + '{% if geom_name == 'marker' %}point{% else %}{{geom_name}}{% endif %}', + 'name', + 'categories',{% if event %} + 'start_date',{% endif %} ]; var validated = true; for (var idx=0; idx<validation.length ;idx++){ var input_id = validation[idx]; - var val = jQuery('#'+input_id).val(); + var selec = '[name=' + input_id + ']'; + var val = jQuery(selec).val(); if (!val || val == '0' || (input_id == 'id_submiter_email' && !isValidEmailAddress(val))){ - jQuery('#'+input_id).parent().addClass('warning'); - jQuery('#'+input_id).parent().addClass('error'); + jQuery(selec).parent().addClass('warning'); + jQuery(selec).parent().addClass('error'); validated = false; } else { - jQuery('#'+input_id).parent().removeClass('warning'); - jQuery('#'+input_id).parent().removeClass('error'); + jQuery(selec).parent().removeClass('warning'); + jQuery(selec).parent().removeClass('error'); } } if (!validated){ |