mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
70 lines
1.6 KiB
Twig
70 lines
1.6 KiB
Twig
<h1>{% trans 'Publications' %}</h1>
|
|
|
|
<div>
|
|
{% block content %}{% endblock %}
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
var $forms = $('form.form_publication');
|
|
|
|
$forms.each(function(i, form){
|
|
var $form = $(form);
|
|
|
|
$form.bind('submit', function(){
|
|
var error = false;
|
|
$('.required_text', form).each(function(i, el){
|
|
if($.trim($(el).val()) === '')
|
|
{
|
|
$(el).addClass('error');
|
|
error = true;
|
|
}
|
|
});
|
|
|
|
if(error === true)
|
|
{
|
|
alert('{% trans 'Vous devez remplir les champs requis' %}');
|
|
return false;
|
|
}
|
|
|
|
var action = $form.attr('action');
|
|
var datas = $form.serializeArray();
|
|
|
|
$('#right-ajax').empty().addClass('loading');
|
|
$.ajax({
|
|
type: 'POST',
|
|
url: action,
|
|
data: datas,
|
|
success: function(data){
|
|
$('#right-ajax').removeClass('loading').empty().html(data);
|
|
}
|
|
});
|
|
|
|
return false;
|
|
});
|
|
});
|
|
|
|
$('#right-ajax a').bind('click', function(){
|
|
var $this = $(this);
|
|
$('#right-ajax').empty().addClass('loading');
|
|
$.ajax({
|
|
type: 'GET',
|
|
url: $this.attr('href'),
|
|
success: function(data){
|
|
$('#right-ajax').removeClass('loading').empty().html(data);
|
|
}
|
|
});
|
|
return false;
|
|
});
|
|
|
|
$('#edit_pub_public').bind('change', function(){
|
|
if($(this).attr('checked') === true)
|
|
$('#edit_pub_base_id').attr('disabled', 'disabled');
|
|
else
|
|
$('#edit_pub_base_id').removeAttr('disabled');
|
|
});
|
|
});
|
|
</script>
|
|
|