plugin.hazelnut: removed resource specific code
- var ELEMENT_KEY = 'resource_hrn';
var debug=false;
debug=true
var debug=false;
debug=true
// UNUSED ? //
// UNUSED ? // }, // update_plugin
// UNUSED ? //
// UNUSED ? // }, // update_plugin
- checkbox: function (plugin_uuid, header, field) //, selected_str, disabled_str)
+ checkbox: function (key, value)
- if (header === null)
- header = '';
// Prefix id with plugin_uuid
result += "<input";
result += " class='hazelnut-checkbox'";
// Prefix id with plugin_uuid
result += "<input";
result += " class='hazelnut-checkbox'";
- result += " id='" + this.id('checkbox', this.id_from_key(this.key, unfold.get_value(header))) + "'";
- //hazelnut-checkbox-" + plugin_uuid + "-" + unfold.get_value(header).replace(/\\/g, '') + "'";
- result += " name='" + unfold.get_value(field) + "'";
+ result += " id='" + this.id('checkbox', this.id_from_key(key, value)) + "'";
+ result += " name='" + key + "'";
result += " type='checkbox'";
result += " type='checkbox'";
- //result += selected_str;
- //result += disabled_str;
result += " autocomplete='off'";
result += " autocomplete='off'";
- result += " value='" + unfold.get_value(header) + "'";
+ result += " value='" + value + "'";
result += "></input>";
return result;
}, // checkbox
result += "></input>";
return result;
}, // checkbox
if (this.options.checkboxes)
// Use a key instead of hostname (hard coded...)
// XXX remove the empty checked attribute
if (this.options.checkboxes)
// Use a key instead of hostname (hard coded...)
// XXX remove the empty checked attribute
- line.push(this.checkbox(this.options.plugin_uuid, record[ELEMENT_KEY], record['type']));
+ line.push(this.checkbox(this.key, record[this.key]));
// XXX Is adding an array of lines more efficient ?
this.table.fnAddData(line);
// XXX Is adding an array of lines more efficient ?
this.table.fnAddData(line);
resource_md = metadata.details_by_object('resource')
resource_fields = [column['name'] for column in resource_md['column']]
resource_md = metadata.details_by_object('resource')
resource_fields = [column['name'] for column in resource_md['column']]
+ user_md = metadata.details_by_object('user')
+ user_fields = ['user_hrn'] # [column['name'] for column in user_md['column']]
+
# TODO The query to run is embedded in the URL
main_query = Query.get('slice').filter_by('slice_hrn', '=', slicename)
main_query.select(
# TODO The query to run is embedded in the URL
main_query = Query.get('slice').filter_by('slice_hrn', '=', slicename)
main_query.select(
)
query_resource_all = Query.get('resource').select(resource_fields)
)
query_resource_all = Query.get('resource').select(resource_fields)
+ query_user_all = Query.get('user').select(user_fields)
aq = AnalyzedQuery(main_query, metadata=metadata)
page.enqueue_query(main_query, analyzed_query=aq)
page.enqueue_query(query_resource_all)
aq = AnalyzedQuery(main_query, metadata=metadata)
page.enqueue_query(main_query, analyzed_query=aq)
page.enqueue_query(query_resource_all)
+ page.enqueue_query(query_user_all)
# Prepare the display according to all metadata
# (some parts will be pending, others can be triggered by users).
# Prepare the display according to all metadata
# (some parts will be pending, others can be triggered by users).
togglable = False,
# this is the query at the core of the slice list
query = sq_user,
togglable = False,
# this is the query at the core of the slice list
query = sq_user,
+ query_all = query_user_all,
checkboxes = True,
datatables_options = {
# for now we turn off sorting on the checkboxes columns this way
checkboxes = True,
datatables_options = {
# for now we turn off sorting on the checkboxes columns this way