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

Two 'select' : active / available

parent 87608adf
......@@ -152,7 +152,7 @@
*/
$("#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>");
$('#setAndRunModalBody').wfform({
workflowClass: workflow["class"],
......@@ -178,7 +178,7 @@
$("#run_workflow").click(function(){ $('#setAndRunModalBody').wfform('run'); });
$("#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>");
$('#statusModalBody').wfstatus({
workflowID: workflow["id"]
......
......@@ -134,7 +134,7 @@
' {{/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-body').wfform({
workflowClass: workflow["class"],
......@@ -148,7 +148,7 @@
$('#current-header').html("<h1>Actives workflows <small>to monitor</small></h1>");
$('#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-body').wfstatus({
workflowID: workflow["id"]
......
......@@ -72,7 +72,7 @@
$.tmpl($this.options.template, {workflows: data}).appendTo($this.$element);
$("[id^=activewf_btn_]").click(function(){
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(){
$this.reload();
......
......@@ -67,7 +67,7 @@
$.tmpl($this.options.template, {workflows: data, filters: $this.options.filters}).appendTo($this.$element);
$("[id^=availablewf_btn_]").click(function(){
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)
});
$('.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
var excludereq = new Array();
......@@ -384,7 +402,7 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options)
' {{if group != "default" && group.indexOf("exclude-") != 0 && index == 0}}',
' <legend>${param.group}</legend>',
' {{/if}}',
' <label class="control-label">${param.display_name}</label>',
' <label class="control-label">${param.display_name} - ${param.action}</label>',
' <div class="controls">',
// if it's a multiple type
' {{if param.type == "MultipleParameters"}}',
......@@ -402,7 +420,17 @@ jQuery.validator.addMethod("exclude_required", function(value, element, options)
' {{/each}}',
' </blockquote>',
' {{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)}}',
' {{/if}}',
' <span class="help-block">${param.help}</span>',
' {{/if}}',
' </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