Commit 60d8d731 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

allow to filter the list of available workflows

parent ad43ce2d
......@@ -64,7 +64,7 @@
workflow_by_class[data[i]["class"]] = data[i];
}
$this.$element.html("");
$.tmpl($this.options.template, {workflows: data}).appendTo($this.$element);
$.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]);
......@@ -99,12 +99,16 @@
'</tr>',
'</thead>',
'{{each(index, workflow) workflows}}',
'<tr>',
'<td><a id="availablewf_btn_${workflow.class}" href="#">${workflow.name}</a></td>',
'<td>${workflow.help}</td>',
'</tr>',
// if this workflow shouldnt be displayed
' {{if filters.indexOf(workflow.class) == -1 }}',
' <tr>',
' <td><a id="availablewf_btn_${workflow.class}" href="#">${workflow.name}</a></td>',
' <td>${workflow.help}</td>',
' </tr>',
' {{/if}}',
'{{/each}}',
'</dl>'].join('\n')
'</dl>'].join('\n'),
filters: {}
}
$.fn.availablewf.Constructor = AvailableWF
......
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