Merge branch '3.7'

This commit is contained in:
Romain Neutron
2012-12-17 15:30:05 +01:00
25 changed files with 269 additions and 161 deletions

View File

@@ -17,6 +17,7 @@
<option value="1" {% if title == '1' %}selected="selected"{% endif %}>{% trans 'Tous' %}</option>
<option value="0" {% if title == '0' %}selected="selected"{% endif %}>{% trans 'Aucun' %}</option>
<option value="fr" {% if title == 'fr' %}selected="selected"{% endif %}>{% trans 'Francais' %}</option>
<option value="nl" {% if title == 'nl' %}selected="selected"{% endif %}>{% trans 'Dutch' %}</option>
<option value="de" {% if title == 'de' %}selected="selected"{% endif %}>{% trans 'Allemand' %}</option>
<option value="en" {% if title == 'en' %}selected="selected"{% endif %}>{% trans 'Anglais' %}</option>
<option value="ar" {% if title == 'ar' %}selected="selected"{% endif %}>{% trans 'Arabe' %}</option>
@@ -253,44 +254,46 @@
}
});
var current_field_label = $('#current_field_label');
$("#field_chooser").autocomplete({
source: "/admin/description/metadatas/search/",
minLength: 2,
select: function( event, ui ) {
$('#current_field_label').val(ui.item.value);
current_field_label.val(ui.item.value);
}
});
var buttons = {};
var dialog = $('#field_changer');
buttons['{% trans 'boutton::annuler' %}'] = function(){
$('#field_changer').dialog('close');
dialog.dialog('close');
};
$('#tag_remover').bind('click', function(){
$('#current_field_label').val('');
current_field_label.val('');
});
buttons['{% trans 'boutton::valider' %}'] = function(){
var field_id = $('input[name="field_id"]', dialog).val();
$('#field_changer').dialog('close');
$('#display_value_'+field_id).empty().append($('#current_field_label').val());
$('input[name="src_'+field_id+'"]', container).val($('#current_field_label').val());
$('#display_value_'+field_id).empty().append(current_field_label.val());
$('input[name="src_'+field_id+'"]', container).val(current_field_label.val());
$('input[name="src_'+field_id+'"]', container).trigger('change');
$('.metafield_'+field_id, container).removeAttr('disabled');
dialog.dialog('close');
};
$('#field_changer').dialog({
dialog.dialog({
modal:true,
buttons : buttons,
draggable:false,
draggable:true,
resizable:false
}).dialog('close');
$('a.field_change', container).bind('click', function(){
$('#field_chooser').val('');
var field_id = $('input',this).val();
$('#current_field_label').val( $('input[name="src_'+field_id+'"]', container).val());
current_field_label.val( $('input[name="src_'+field_id+'"]', container).val());
$('input[name="field_id"]', dialog).val(field_id);
dialog.dialog().dialog('open');