mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 21:43:18 +00:00
69 lines
2.1 KiB
Twig
69 lines
2.1 KiB
Twig
<form method="POST" action="/prod/story/">
|
|
|
|
<label>{% trans 'Collection' %}</label>
|
|
<select name="base_id">
|
|
{% for collection in app['authentication'].getUser().ACL().get_granted_base(['canaddrecord']) %}
|
|
<option value="{{ collection.get_base_id() }}">{{ collection.get_databox().get_viewname() }} / {{ collection.get_name() }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
|
|
<label>{% trans 'Story name' %}</label>
|
|
<input name="name" value="" type="text"/>
|
|
|
|
<label for="new_story_add_sel" class="checkbox">
|
|
<input type="checkbox" name="lst" value="" id="new_story_add_sel"/>
|
|
{% trans 'Ajouter ma selection courrante' %}
|
|
</label>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
var $dialog = p4.Dialog.get(1);
|
|
var $dialogBox = $dialog.getDomElement();
|
|
|
|
$('input[name="lst"]', $dialogBox).val(p4.Results.Selection.serialize());
|
|
|
|
var buttons = $dialog.getOption('buttons');
|
|
|
|
buttons[language.create] = function(){
|
|
$('form', $dialogBox).trigger('submit')
|
|
};
|
|
|
|
$dialog.setOption('buttons', buttons);
|
|
|
|
$('form', $dialogBox).bind('submit', function(event){
|
|
|
|
var $form = $(this);
|
|
var dialog = $dialogBox.closest('.ui-dialog');
|
|
var buttonPanel = dialog.find('.ui-dialog-buttonpane');
|
|
|
|
$.ajax({
|
|
type: $form.attr('method'),
|
|
url: $form.attr('action'),
|
|
data: $form.serializeArray(),
|
|
dataType: 'json',
|
|
beforeSend:function(){
|
|
$(":button:contains('" + language.create + "')", buttonPanel)
|
|
.attr("disabled", true).addClass("ui-state-disabled");
|
|
},
|
|
success: function(data){
|
|
|
|
p4.WorkZone.refresh(data.WorkZone, '', true, 'story');
|
|
p4.Dialog.Close(1);
|
|
|
|
return;
|
|
},
|
|
error: function(){
|
|
$(":button:contains('" + language.create + "')", buttonPanel)
|
|
.attr("disabled", false).removeClass("ui-state-disabled");
|
|
},
|
|
timeout: function(){
|
|
|
|
}
|
|
});
|
|
|
|
return false;
|
|
});
|
|
});
|
|
</script>
|
|
</form>
|