Use of new Dialog.js

This commit is contained in:
Romain Neutron
2012-02-03 15:46:16 +01:00
parent 8211396f14
commit 38dbf4b4b9
4 changed files with 32 additions and 25 deletions

View File

@@ -1,21 +1,26 @@
<form method="POST" action="/prod/baskets/">
<label for="add_sel">{% trans 'Ajouter ma selection courrante' %}</label>
<input type="checkbox" id="bask_create_sel" name="lst" value=""/>
<label>{% trans 'Nom du nouveau panier' %}</label>
<input name="name" value="" type="text"/>
<label>{% trans 'paniers::description du nouveau panier' %}</label>
<textarea name="description"></textarea>
<button>{% trans 'boutton::valider' %}</button>
<input type="checkbox" name="lst" value=""/>
<label for="add_sel">{% trans 'Ajouter ma selection courrante' %}</label>
<script type="text/javascript">
$(document).ready(function(){
$('#bask_create_sel').val(p4.Results.Selection.serialize());
$('#DIALOG form').bind('submit', function(event){
var $dialog = p4.Dialog.getDialog();
$('input[name="lst"]', $dialog).val(p4.Results.Selection.serialize());
var buttons = $dialog.dialog('option', 'buttons');
buttons[language.create] = function(){$('form', $dialog).trigger('submit')};
$dialog.dialog('option', 'buttons', buttons);
$('form', $dialog).bind('submit', function(event){
//$this.SetLoader(true);
@@ -32,7 +37,7 @@
success: function(data){
p4.WorkZone.refresh(data.basket.id);
$('#DIALOG').dialog('close').empty();
p4.Dialog.Close();
return;
},

View File

@@ -1,14 +1,5 @@
<form method="POST" action="/prod/story/">
<label for="add_sel">{% trans 'Ajouter ma selection courrante' %}</label>
<input type="checkbox" id="story_create_sel" name="lst" value=""/>
<label>{% trans 'Story name' %}</label>
<input name="name" value="" type="text"/>
<label>{% trans 'Story description' %}</label>
<textarea name="description"></textarea>
<label>{% trans 'Collection' %}</label>
<select name="base_id">
{% for collection in user.ACL().get_granted_base(['canaddrecord']) %}
@@ -16,15 +7,26 @@
{% endfor %}
</select>
<button>{% trans 'boutton::valider' %}</button>
<label>{% trans 'Story name' %}</label>
<input name="name" value="" type="text"/>
<label>{% trans 'Story description' %}</label>
<textarea name="description"></textarea>
<label for="add_sel">{% trans 'Ajouter ma selection courrante' %}</label>
<input type="checkbox" name="lst" value=""/>
<script type="text/javascript">
$(document).ready(function(){
$('#story_create_sel').val(p4.Results.Selection.serialize());
var $dialog = p4.Dialog.getDialog();
$('#DIALOG form').bind('submit', function(event){
$('input[name="lst"]', $dialog).val(p4.Results.Selection.serialize());
//$this.SetLoader(true);
var buttons = $dialog.dialog('option', 'buttons');
buttons[language.create] = function(){$('form', $dialog).trigger('submit')};
$dialog.dialog('option', 'buttons', buttons);
$('form', $dialog).bind('submit', function(event){
var $form = $(this);
@@ -39,7 +41,7 @@
success: function(data){
p4.WorkZone.refresh(data.basket.id);
$('#DIALOG').dialog('close').empty();
p4.Dialog.Close();
return;
},

View File

@@ -53,7 +53,7 @@
</div>
<div title="" class="context-menu-item">
<div class="context-menu-item-inner">
<a class="dialog" title="{% trans 'action::renommer' %}" href="/prod/baskets/{{basket.getId()}}/update/">
<a class="dialog small-dialog" title="{% trans 'action::renommer' %}" href="/prod/baskets/{{basket.getId()}}/update/">
{% trans 'action::renommer' %}
</a>
</div>

View File

@@ -525,7 +525,7 @@
<ul style="list-style-type:none;margin:0;padding:0">
<li class="context-menu-item">
<div class="context-menu-item-inner"@>
<a title="{% trans 'action:: nouveau panier' %}" class="dialog" href="/prod/baskets/create/">
<a title="{% trans 'action:: nouveau panier' %}" class="dialog small-dialog" href="/prod/baskets/create/">
<img style="cursor:pointer;" src="/skins/icons/mtadd_0.gif" title="{% trans 'action:: nouveau panier' %}" />
{% trans 'action:: nouveau panier' %}
</a>
@@ -536,7 +536,7 @@
</a>
</div>
<div class="context-menu-item-inner"@>
<a title="{% trans 'action:: nouveau reportage' %}" class="dialog" href="/prod/story/create/">
<a title="{% trans 'action:: nouveau reportage' %}" class="dialog small-dialog" href="/prod/story/create/">
<img style="cursor:pointer;" src="/skins/icons/mtadd_0.gif" title="{% trans 'action:: nouveau reportage' %}" />
{% trans 'action:: nouveau reportage' %}
</a>