Commit 444482c2 authored by Philippe Bardou's avatar Philippe Bardou
Browse files

Two 'select' : active / available

parent 87608adf
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
*/ */
$("#available-workflows-list").availablewf(); $("#available-workflows-list").availablewf();
$("#available-workflows-list").on('select', function(event, workflow) { $("#available-workflows-list").on('select.available', function(event, workflow) {
$('#setAndRunModalLabel').html(workflow["name"] + " <small>" + workflow["help"] + "</small>"); $('#setAndRunModalLabel').html(workflow["name"] + " <small>" + workflow["help"] + "</small>");
$('#setAndRunModalBody').wfform({ $('#setAndRunModalBody').wfform({
workflowClass: workflow["class"], workflowClass: workflow["class"],
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
$("#run_workflow").click(function(){ $('#setAndRunModalBody').wfform('run'); }); $("#run_workflow").click(function(){ $('#setAndRunModalBody').wfform('run'); });
$("#active-workflows-list").activewf(); $("#active-workflows-list").activewf();
$("#active-workflows-list").on("select", function(event, workflow) { $("#active-workflows-list").on("select.active", function(event, workflow) {
$('#statusModalLabel').html(workflow["name"] + " <small>" + workflow["id"] + "</small>"); $('#statusModalLabel').html(workflow["name"] + " <small>" + workflow["id"] + "</small>");
$('#statusModalBody').wfstatus({ $('#statusModalBody').wfstatus({
workflowID: workflow["id"] workflowID: workflow["id"]
......
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
' {{/each}}'].join('\n') ' {{/each}}'].join('\n')
}); });
$("#ul-available").on('select', function(event, workflow) { $("#ul-available").on('select.available', function(event, workflow) {
$('#current-header').html("<h1>" + workflow["name"] + " <small>" + workflow["help"] + "</small>"); $('#current-header').html("<h1>" + workflow["name"] + " <small>" + workflow["help"] + "</small>");
$('#current-body').wfform({ $('#current-body').wfform({
workflowClass: workflow["class"], workflowClass: workflow["class"],
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
$('#current-header').html("<h1>Actives workflows <small>to monitor</small></h1>"); $('#current-header').html("<h1>Actives workflows <small>to monitor</small></h1>");
$('#current-body').activewf('reload'); $('#current-body').activewf('reload');
}); });
$("#current-body").on('select', function(event, workflow) { $("#current-body").on('select.active', function(event, workflow) {
$('#current-header').html("<h1>" + workflow["name"] + " <small>" + workflow["id"] + "</small></h1>"); $('#current-header').html("<h1>" + workflow["name"] + " <small>" + workflow["id"] + "</small></h1>");
$('#current-body').wfstatus({ $('#current-body').wfstatus({
workflowID: workflow["id"] workflowID: workflow["id"]
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
$.tmpl($this.options.template, {workflows: data}).appendTo($this.$element); $.tmpl($this.options.template, {workflows: data}).appendTo($this.$element);
$("[id^=activewf_btn_]").click(function(){ $("[id^=activewf_btn_]").click(function(){
var workflow_id = $(this).attr("id").split("activewf_btn_")[1]; var workflow_id = $(this).attr("id").split("activewf_btn_")[1];
$this.$element.trigger('select', workflow_by_id[workflow_id]); $this.$element.trigger('select.active', workflow_by_id[workflow_id]);
}); });
$("#activewf_refresh_btn").click(function(){ $("#activewf_refresh_btn").click(function(){
$this.reload(); $this.reload();
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
$.tmpl($this.options.template, {workflows: data, filters: $this.options.filters}).appendTo($this.$element); $.tmpl($this.options.template, {workflows: data, filters: $this.options.filters}).appendTo($this.$element);
$("[id^=availablewf_btn_]").click(function(){ $("[id^=availablewf_btn_]").click(function(){
var workflow_class = $(this).attr("id").split("availablewf_btn_")[1]; var workflow_class = $(this).attr("id").split("availablewf_btn_")[1];
$this.$element.trigger('select', workflow_by_class[workflow_class]); $this.$element.trigger('select.available', workflow_by_class[workflow_class]);
}); });
} }
}); });
......
...@@ -228,6 +228,24 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options) ...@@ -228,6 +228,24 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options)
}); });
$('.date').datepicker().on('changeDate', function(ev){ $('.date').datepicker('hide');} ); $('.date').datepicker().on('changeDate', function(ev){ $('.date').datepicker('hide');} );
$('.iadd').click(function(){
var localid = $(this).prev().attr('id');
var nb = 1;
var arr = localid.split('_');
if(arr.lenght == 2){
nb = arr[1];
}
var clone = $('#'+localid).clone().attr('id', localid + "_" + nb);
console.log(clone);
$('#'+localid).fadeOut();
$('<input id="' + localid + '_' + nb + '" name="' + localid + '" value="' + $('#'+localid).val() + '" type="text">').insertBefore('#'+localid);
});
$('.idel').click(function() {
alert("remove");
});
// for exclude-required first check if there is no exclusion group with a required option // for exclude-required first check if there is no exclusion group with a required option
var excludereq = new Array(); var excludereq = new Array();
...@@ -384,26 +402,36 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options) ...@@ -384,26 +402,36 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options)
' {{if group != "default" && group.indexOf("exclude-") != 0 && index == 0}}', ' {{if group != "default" && group.indexOf("exclude-") != 0 && index == 0}}',
' <legend>${param.group}</legend>', ' <legend>${param.group}</legend>',
' {{/if}}', ' {{/if}}',
' <label class="control-label">${param.display_name}</label>', ' <label class="control-label">${param.display_name} - ${param.action}</label>',
' <div class="controls">', ' <div class="controls">',
// if it's a multiple type // if it's a multiple type
' {{if param.type == "MultipleParameters"}}', ' {{if param.type == "MultipleParameters"}}',
' <blockquote>', ' <blockquote>',
' {{each(spindex, sub_param) param.sub_parameters}}', ' {{each(spindex, sub_param) param.sub_parameters}}',
' {{if sub_param.type == "bool"}}', ' {{if sub_param.type == "bool"}}',
' {{html getParameterDisplay(sub_param, parameterTemplate, "input-medium", sub_param.display_name)}}', ' {{html getParameterDisplay(sub_param, parameterTemplate, "input-medium", sub_param.display_name)}}',
' {{else}}', ' {{else}}',
' <div class="input-prepend">', ' <div class="input-prepend">',
' <span class="add-on">${sub_param.display_name}</span>', ' <span class="add-on">${sub_param.display_name}</span>',
' {{html getParameterDisplay(sub_param, parameterTemplate, "input-medium")}}', ' {{html getParameterDisplay(sub_param, parameterTemplate, "input-medium")}}',
' </div>', ' </div>',
' {{/if}}', ' {{/if}}',
' <span class="help-block">${sub_param.help}</span> <br />', ' <span class="help-block">${sub_param.help}</span> <br />',
' {{/each}}', ' {{/each}}',
' </blockquote>', ' </blockquote>',
' {{else}}', ' {{else}}',
' {{if param.action == "append"}}',
' <div>',
' <button class="btn iprev" style="display:none" type="button"><i class="icon-chevron-left"></i></button>',
' {{html getParameterDisplay(param, parameterTemplate, "input-large")}}',
' <button class="btn iadd" type="button" pname="${param.name}"><i class="icon-plus-sign"></i></button>',
' <button class="btn idel" style="display:none" type="button"><i class="icon-minus-sign"></i></button>',
' <button class="btn inext" style="display:none" type="button"><i class="icon-chevron-right"></i></button>',
' </div>',
' {{else}}',
' {{html getParameterDisplay(param, parameterTemplate)}}', ' {{html getParameterDisplay(param, parameterTemplate)}}',
' <span class="help-block">${param.help}</span>', ' {{/if}}',
' <span class="help-block">${param.help}</span>',
' {{/if}}', ' {{/if}}',
' </div>', ' </div>',
' </div>', ' </div>',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment