From: Loic Baron Date: Fri, 3 Oct 2014 11:49:13 +0000 (+0200) Subject: Plugin VTAM by Frederic Francois (Univ Bristol) integrated into slice view X-Git-Tag: myslice-1.2~1^2~19^2~1 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=4d9ce959481f9821b4406948a6eabf1426537e93 Plugin VTAM by Frederic Francois (Univ Bristol) integrated into slice view --- diff --git a/plugins/univbrisvtam/__init__.py b/plugins/univbrisvtam/__init__.py new file mode 100644 index 00000000..bc2bf9e6 --- /dev/null +++ b/plugins/univbrisvtam/__init__.py @@ -0,0 +1,80 @@ +from unfold.plugin import Plugin + +class UnivbrisVtam (Plugin): + def __init__ (self, query=None, query_all=None, sync_query=None, + checkboxes=False, columns=None, + init_key=None, + datatables_options={}, **settings): + Plugin.__init__ (self, **settings) + self.query = query + self.query_uuid = query.query_uuid if query else None + # Until we have a proper way to access queries in Python + self.query_all = query_all + self.query_all_uuid = query_all.query_uuid if query_all else None + self.sync_query_uuid = sync_query.query_uuid if sync_query else None + self.checkboxes = checkboxes + # XXX We need to have some hidden columns until we properly handle dynamic queries + if columns is not None: + self.columns=columns + self.hidden_columns = [] + elif self.query: + self.columns = list (['Testbed', 'Virtualization Server', 'VM name', 'Delete']) + #replace production + #self.columns = self.query.fields + if query_all: + #replace production + self.hidden_columns = [] + # We need a list because sets are not JSON-serializable + #self.hidden_columns = #list(self.query_all.fields - self.query.fields) + else: + self.hidden_columns = [] + else: + self.columns = [] + self.hidden_columns = [] + + self.columns = list (['Testbed', 'Virtualization Server', 'VM name', 'Delete']) + self.init_key=init_key + self.datatables_options=datatables_options + # if checkboxes were required, we tell datatables about this column's type + # so that sorting can take place on a selected-first basis (or -last of course) + # this relies on the template exposing the checkboxes 'th' with class 'checkbox' + if self.checkboxes: + # we use aoColumnDefs rather than aoColumns -- ignore user-provided aoColumns + if 'aoColumns' in self.datatables_options: + print 'WARNING: querytable uses aoColumnDefs, your aoColumns spec. is discarded' + del self.datatables_options['aoColumns'] + # set aoColumnDefs in datatables_options - might already have stuff in there + aoColumnDefs = self.datatables_options.setdefault ('aoColumnDefs',[]) + # here 'checkbox' is the class that we give to the dom elem + # dom-checkbox is a sorting type that we define in querytable.js + aoColumnDefs.append ( {'aTargets': ['checkbox'], 'sSortDataType': 'dom-checkbox' } ) + + def template_file (self): + return "univbrisvtamplugin.html" + + def template_env (self, request): + env={} + env.update(self.__dict__) + env['columns']=self.columns + return env + + def requirements (self): + reqs = { + 'js_files' : [ "js/spin-presets.js", "js/spin.min.js", "js/jquery.spin.js", + "js/dataTables.js", "js/dataTables.bootstrap.js", "js/with-datatables.js", "js/jquery.jeditable.js", + "js/manifold.js", "js/manifold-query.js", + "js/unfold-helper.js", + "js/univbrisvtam.js", + ] , + 'css_files': [ "css/dataTables.bootstrap.css", + "css/dataTables.full_numbers.css", + "css/univbrisvtam.css", + ], + } + return reqs + + def json_settings_list (self): + return ['plugin_uuid', 'domid', + 'query_uuid', 'query_all_uuid', 'sync_query_uuid', + 'checkboxes', 'datatables_options', + 'hidden_columns', 'init_key',] diff --git a/plugins/univbrisvtam/static/css/univbrisvtam.css b/plugins/univbrisvtam/static/css/univbrisvtam.css new file mode 100644 index 00000000..04424afd --- /dev/null +++ b/plugins/univbrisvtam/static/css/univbrisvtam.css @@ -0,0 +1,84 @@ + +/* the bottom of the datatable needs more space */ +div.UnivbrisVtam-spacer { padding: 8px 4px 15px 4px; } + +div.UnivbrisVtam table.dataTable th { + font: bold 12px/22px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; + color: #4f6b72; + border-right: 1px solid #C1DAD7; + border-bottom: 1px solid #C1DAD7; + border-top: 1px solid #C1DAD7; + letter-spacing: 1px; + text-transform: uppercase; + text-align: left; + padding: 8px 12px 4px 20px; + vertical-align:middle; +/* background: #CAE8EA url(../img/tablesort-header.jpg) no-repeat; */ +} + +div.UnivbrisVtam table.dataTable th.checkbox { + padding-left: 14px; +} + +div.UnivbrisVtam table.dataTable td, div.UnivbrisVtam table.dataTable textarea, div.UnivbrisVtam table.dataTable input [type="text"] { + font: bold 12px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; + color: #660099; + border-right: 1px solid #C1DAD7; + border-bottom: 1px solid #C1DAD7; +} +div.UnivbrisVtam table.dataTable td { + padding: 4px 8px 4px 8px; + /* this applies on even rows only, odd ones have a setting in bootstrap of rbg 249.249.249 */ + background-color: #f4f4f4; + color: #660099; +} +div.UnivbrisVtam table.dataTable td a { + font-weight:normal; +} +/* these come from bootstrap */ +div.UnivbrisVtam div.dataTables_info { + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; +} + +/* one could think or using repeat-x here but that's not working because of the arrows + * we might need to make these wider some day + * and/or to add background-color: #caebea + * which would look less conspicuous in case of overflow +*/ + +div.UnivbrisVtam table.dataTable thead .sorting { background: url('../img/tablesort-header-sortable.png') no-repeat; } +div.UnivbrisVtam table.dataTable thead .sorting_asc { background: url('../img/tablesort-header-up.png') no-repeat; } +div.UnivbrisVtam table.dataTable thead .sorting_desc { background: url('../img/tablesort-header-down.png') no-repeat; } +/* this icons set does not have that exact equivalent - using an approximation for now */ +div.UnivbrisVtam table.dataTable thead .sorting_asc_disabled { background: url('../img/tablesort-header.png') repeat-x; } +div.UnivbrisVtam table.dataTable thead .sorting_desc_disabled { background: url('../img/tablesort-header.png') repeat-x; } + +/* the footers are not active */ +div.UnivbrisVtam table.dataTable tfoot { + background: url('../img/tablesort-header.png') repeat-x; + background-color: #caebea; +} +/* and when sorting is turned off it's useful to set this on header too */ +div.UnivbrisVtam table.dataTable thead { + background: url('../img/tablesort-header.png') repeat-x; + background-color: #caebea; +} + +div.UnivbrisVtam table.tbbuttons{ + background-color:#A9E2F3; +} + + +div.UnivbrisVtam table.tbbuttons td{ + padding-top: 7px; + /*padding-left: 7px*/ + /*padding-left: 7px*/ + padding-bottom: 7px; + background-color:#A9E2F3; +} + +div.UnivbrisVtam table.tbbuttons tr{ + background-color:#A9E2F3; +} + + diff --git a/plugins/univbrisvtam/static/img/README b/plugins/univbrisvtam/static/img/README new file mode 100644 index 00000000..5df2d69b --- /dev/null +++ b/plugins/univbrisvtam/static/img/README @@ -0,0 +1,2 @@ +these styling elements come from plekit with a simple transition to png +they're currently not all used in myslice diff --git a/plugins/univbrisvtam/static/img/tablesort-bullet1.png b/plugins/univbrisvtam/static/img/tablesort-bullet1.png new file mode 100644 index 00000000..4304f360 Binary files /dev/null and b/plugins/univbrisvtam/static/img/tablesort-bullet1.png differ diff --git a/plugins/univbrisvtam/static/img/tablesort-bullet2.png b/plugins/univbrisvtam/static/img/tablesort-bullet2.png new file mode 100644 index 00000000..4f181e19 Binary files /dev/null and b/plugins/univbrisvtam/static/img/tablesort-bullet2.png differ diff --git a/plugins/univbrisvtam/static/img/tablesort-col-alt.png b/plugins/univbrisvtam/static/img/tablesort-col-alt.png new file mode 100644 index 00000000..8179f830 Binary files /dev/null and b/plugins/univbrisvtam/static/img/tablesort-col-alt.png differ diff --git a/plugins/univbrisvtam/static/img/tablesort-gradient.png b/plugins/univbrisvtam/static/img/tablesort-gradient.png new file mode 100644 index 00000000..26558a49 Binary files /dev/null and b/plugins/univbrisvtam/static/img/tablesort-gradient.png differ diff --git a/plugins/univbrisvtam/static/img/tablesort-header-down.png b/plugins/univbrisvtam/static/img/tablesort-header-down.png new file mode 100644 index 00000000..c8ed6576 Binary files /dev/null and b/plugins/univbrisvtam/static/img/tablesort-header-down.png differ diff --git a/plugins/univbrisvtam/static/img/tablesort-header-sortable.png b/plugins/univbrisvtam/static/img/tablesort-header-sortable.png new file mode 100644 index 00000000..0c169040 Binary files /dev/null and b/plugins/univbrisvtam/static/img/tablesort-header-sortable.png differ diff --git a/plugins/univbrisvtam/static/img/tablesort-header-up.png b/plugins/univbrisvtam/static/img/tablesort-header-up.png new file mode 100644 index 00000000..d12fe2a5 Binary files /dev/null and b/plugins/univbrisvtam/static/img/tablesort-header-up.png differ diff --git a/plugins/univbrisvtam/static/img/tablesort-header.png b/plugins/univbrisvtam/static/img/tablesort-header.png new file mode 100644 index 00000000..cff526f9 Binary files /dev/null and b/plugins/univbrisvtam/static/img/tablesort-header.png differ diff --git a/plugins/univbrisvtam/static/img/tablesort-td-alt.png b/plugins/univbrisvtam/static/img/tablesort-td-alt.png new file mode 100644 index 00000000..ef5ab358 Binary files /dev/null and b/plugins/univbrisvtam/static/img/tablesort-td-alt.png differ diff --git a/plugins/univbrisvtam/static/img/toggle-hidden.png b/plugins/univbrisvtam/static/img/toggle-hidden.png new file mode 100755 index 00000000..023f22a8 Binary files /dev/null and b/plugins/univbrisvtam/static/img/toggle-hidden.png differ diff --git a/plugins/univbrisvtam/static/img/toggle-visible.png b/plugins/univbrisvtam/static/img/toggle-visible.png new file mode 100755 index 00000000..baf6c286 Binary files /dev/null and b/plugins/univbrisvtam/static/img/toggle-visible.png differ diff --git a/plugins/univbrisvtam/static/js/univbrisvtam.js b/plugins/univbrisvtam/static/js/univbrisvtam.js new file mode 100644 index 00000000..13bea949 --- /dev/null +++ b/plugins/univbrisvtam/static/js/univbrisvtam.js @@ -0,0 +1,663 @@ +/** + * Description: display a query result in a datatables-powered + * Copyright (c) 2012-2013 UPMC Sorbonne Universite - INRIA + * License: GPLv3 + */ + +(function($){ + + var debug=false; + debug=true + + pk_flowspace_index=0; + opt_flowspace_index=0; + pk_mode=0; + fvf_add=1; + fvf_nrow=0; + + + var UnivbrisVtam = Plugin.extend({ + + + init: function(options, element) { + this.classname="univbrisvtam"; + this._super(options, element); + + this.elmt().on('show', this, this.on_show); + this.elmt().on('shown.bs.tab', this, this.on_show); + this.elmt().on('resize', this, this.on_resize); + + // We need to remember the active filter for datatables filtering + this.filters = Array(); + + // an internal buffer for records that are 'in' and thus need to be checked + this.buffered_records_to_check = []; + // an internal buffer for keeping lines and display them in one call to fnAddData + this.buffered_lines = []; + + var keys = manifold.metadata.get_key(this.object); + this.canonical_key = (keys && keys.length == 1) ? keys[0] : undefined; + this.init_key = this.options.init_key; + // have init_key default to canonical_key + this.init_key = this.init_key || this.canonical_key; + // sanity check + if ( ! this.init_key ) messages.warning ("UnivbrisVtam : cannot find init_key"); + if ( ! this.canonical_key ) messages.warning ("UnivbrisVtam : cannot find canonical_key"); + if (debug) messages.debug("UnivbrisVtam: canonical_key="+this.canonical_key+" init_key="+this.init_key); + + /* GUI setup and event binding */ + this.initialize_table(); + + }, + + /* PLUGIN EVENTS */ + + on_show: function(e) { + if (debug) messages.debug("UnivbrisVtam.on_show"); + var self = e.data; + self.table.fnAdjustColumnSizing(); + }, + + on_resize: function(e) { + if (debug) messages.debug("UnivbrisVtam.on_resize"); + var self = e.data; + self.table.fnAdjustColumnSizing(); + }, + + /* GUI EVENTS */ + + /* GUI MANIPULATION */ + + initialize_table: function() + { + + + /* Transforms the table into DataTable, and keep a pointer to it */ + var self = this; + //alert(self.options); + var actual_options = { + // Customize the position of Datatables elements (length,filter,button,...) + // we use a fluid row on top and another on the bottom, making sure we take 12 grid elt's each time + //sDom: "<'row'<'col-xs-5'l><'col-xs-1'r><'col-xs-6'f>>t<'row'<'col-xs-5'i><'col-xs-7'p>>", + sDom: "<'row'<'col-xs-5'l><'col-xs-5'r><'col-xs-1'r><'col-xs-6'f>>t<'row'<'col-xs-5'i><'col-xs-7'p>><'buttons'>", + //sDom: "<'row'<'col-xs-9'r>t<'buttons'>", + // XXX as of sept. 2013, I cannot locate a bootstrap3-friendly mode for now + // hopefully this would come with dataTables v1.10 ? + // in any case, search for 'sPaginationType' all over the code for more comments + sPaginationType: 'bootstrap', + // Handle the null values & the error : Datatables warning Requested unknown parameter + // http://datatables.net/forums/discussion/5331/datatables-warning-...-requested-unknown-parameter/p2 + aoColumnDefs: [{sDefaultContent: '',aTargets: [ '_all' ]}], + // WARNING: this one causes tables in a 'tabs' that are not exposed at the time this is run to show up empty + // sScrollX: '100%', /* Horizontal scrolling */ + bProcessing: true, /* Loading */ + fnDrawCallback: function() { self._querytable_draw_callback.call(self);} + //fnFooterCallback: function() {self._UnivbrisVtam_footer_callback.call(self,nFoot, aData, iStart, iEnd, aiDisplay)};} + // XXX use $.proxy here ! + }; + // the intention here is that options.datatables_options as coming from the python object take precedence + // xxx DISABLED by jordan: was causing errors in datatables.js + // xxx turned back on by Thierry - this is the code that takes python-provided options into account + // check your datatables_options tag instead + // however, we have to accumulate in aoColumnDefs from here (above) + // and from the python wrapper (checkboxes management, plus any user-provided aoColumnDefs) + if ( 'aoColumnDefs' in this.options.datatables_options) { + actual_options['aoColumnDefs']=this.options.datatables_options['aoColumnDefs'].concat(actual_options['aoColumnDefs']); + delete this.options.datatables_options['aoColumnDefs']; + } + $.extend(actual_options, this.options.datatables_options ); + + + this.table = $("#univbris_vtam__table").dataTable(actual_options); + + + + //alert(this.table.$("name")); + + /* Setup the SelectAll button in the dataTable header */ + /* xxx not sure this is still working */ + var oSelectAll = $('#datatableSelectAll-'+ this.options.plugin_uuid); + oSelectAll.html("Select All"); + oSelectAll.button(); + oSelectAll.css('font-size','11px'); + oSelectAll.css('float','right'); + oSelectAll.css('margin-right','15px'); + oSelectAll.css('margin-bottom','5px'); + oSelectAll.unbind('click'); + oSelectAll.click(this._selectAll); + + /* Add a filtering function to the current table + * Note: we use closure to get access to the 'options' + */ + $.fn.dataTableExt.afnFiltering.push(function( oSettings, aData, iDataIndex ) { + /* No filtering if the table does not match */ + if (oSettings.nTable.id != self.options.plugin_uuid + '__table') + return true; + return self._querytable_filter.call(self, oSettings, aData, iDataIndex); + }); + + /* Processing hidden_columns */ + $.each(this.options.hidden_columns, function(i, field) { + //manifold.raise_event(self.options.query_all_uuid, FIELD_REMOVED, field); + //alert (field); + self.hide_column(field); + //self.hide_column(field); + }); + + + this._querytable_draw_callback(); + + }, // initialize_table + + + fnCreateVms:function(e){ + console.log("building json to send to backend"); + + var testbeds=[]; + + + try{ + var rows = $("#univbris_vtam__table").dataTable().fnGetNodes(); + if (rows.length<=0){ + throw("no vm specified"); + } + else{ + for(var i=0;i 0) ? tabIndex[0] : -1; + }, // getColIndex + + + + + new_record: function(record) + { + + }, + + clear_table: function() + { + this.table.fnClearTable(); + }, + + redraw_table: function() + { + this.table.fnDraw(); + }, + + show_column: function(field) + { + var oSettings = this.table.fnSettings(); + var cols = oSettings.aoColumns; + var index = this.getColIndex(field,cols); + if (index != -1) + this.table.fnSetColumnVis(index, true); + }, + + hide_column: function(field) + { + var oSettings = this.table.fnSettings(); + var cols = oSettings.aoColumns; + var index = this.getColIndex(field,cols); + //index=-1; + //alert(field + ": index: " + index ); + if (index != -1) + //alert(field + ": hidden with index: " + index ); + this.table.fnSetColumnVis(index, false); + }, + + // this is used at init-time, at which point only init_key can make sense + // (because the argument record, if it comes from query, might not have canonical_key set + set_checkbox_from_record: function (record, checked) { + if (checked === undefined) checked = true; + var init_id = record[this.init_key]; + if (debug) messages.debug("UnivbrisVtam.set_checkbox_from_record, init_id="+init_id); + // using table.$ to search inside elements that are not visible + var element = this.table.$('[init_id="'+init_id+'"]'); + element.attr('checked',checked); + }, + + // id relates to canonical_key + set_checkbox_from_data: function (id, checked) { + if (checked === undefined) checked = true; + if (debug) messages.debug("UnivbrisVtam.set_checkbox_from_data, id="+id); + // using table.$ to search inside elements that are not visible + var element = this.table.$("[id='"+id+"']"); + element.attr('checked',checked); + }, + + /*************************** QUERY HANDLER ****************************/ + + on_filter_added: function(filter) + { + this.filters.push(filter); + this.redraw_table(); + }, + + on_filter_removed: function(filter) + { + // Remove corresponding filters + this.filters = $.grep(this.filters, function(x) { + return x != filter; + }); + this.redraw_table(); + }, + + on_filter_clear: function() + { + // XXX + this.redraw_table(); + }, + + on_field_added: function(field) + { + this.show_column(field); + }, + + on_field_removed: function(field) + { + this.hide_column(field); + }, + + on_field_clear: function() + { + alert('UnivbrisVtam::clear_fields() not implemented'); + }, + + /* XXX TODO: make this generic a plugin has to subscribe to a set of Queries to avoid duplicated code ! */ + /*************************** ALL QUERY HANDLER ****************************/ + + on_all_filter_added: function(filter) + { + // XXX + this.redraw_table(); + }, + + on_all_filter_removed: function(filter) + { + // XXX + this.redraw_table(); + }, + + on_all_filter_clear: function() + { + // XXX + this.redraw_table(); + }, + + on_all_field_added: function(field) + { + this.show_column(field); + }, + + on_all_field_removed: function(field) + { + this.hide_column(field); + }, + + on_all_field_clear: function() + { + alert('UnivbrisVtam::clear_fields() not implemented'); + }, + + + /*************************** RECORD HANDLER ***************************/ + + on_new_record: function(record) + { + }, + + on_clear_records: function() + { + }, + + // Could be the default in parent + on_query_in_progress: function() + { + this.spin(); + }, + + on_query_done: function() + { + this.received_query = true; + // unspin once we have received both + if (this.received_all_query && this.received_query) this.unspin(); + }, + + on_field_state_changed: function(data) + { + switch(data.request) { + case FIELD_REQUEST_ADD: + case FIELD_REQUEST_ADD_RESET: + this.set_checkbox_from_data(data.value, true); + break; + case FIELD_REQUEST_REMOVE: + case FIELD_REQUEST_REMOVE_RESET: + this.set_checkbox_from_data(data.value, false); + break; + default: + break; + } + }, + + /* XXX TODO: make this generic a plugin has to subscribe to a set of Queries to avoid duplicated code ! */ + // all + on_all_field_state_changed: function(data) + { + switch(data.request) { + case FIELD_REQUEST_ADD: + case FIELD_REQUEST_ADD_RESET: + this.set_checkboxfrom_data(data.value, true); + break; + case FIELD_REQUEST_REMOVE: + case FIELD_REQUEST_REMOVE_RESET: + this.set_checkbox_from_data(data.value, false); + break; + default: + break; + } + }, + + on_all_new_record: function(record) + { + this.new_record(record); + }, + + on_all_clear_records: function() + { + this.clear_table(); + + }, + + on_all_query_in_progress: function() + { + // XXX parent + this.spin(); + }, // on_all_query_in_progress + + on_all_query_done: function() + { + if (debug) messages.debug("1-shot initializing dataTables content with " + this.buffered_lines.length + " lines"); + + + //this.table.fnAddData (this.buffered_lines); + this.buffered_lines=[]; + + var self = this; + // if we've already received the slice query, we have not been able to set + // checkboxes on the fly at that time (dom not yet created) + $.each(this.buffered_records_to_check, function(i, record) { + if (debug) messages.debug ("querytable delayed turning on checkbox " + i + " record= " + record); + self.set_checkbox_from_record(record, true); + }); + this.buffered_records_to_check = []; + + this.received_all_query = true; + // unspin once we have received both + if (this.received_all_query && this.received_query) this.unspin(); + + }, // on_all_query_done + + /************************** PRIVATE METHODS ***************************/ + + /** + * @brief QueryTable filtering function + */ + _querytable_filter: function(oSettings, aData, iDataIndex) + { + var ret = true; + $.each (this.filters, function(index, filter) { + /* XXX How to manage checkbox ? */ + var key = filter[0]; + var op = filter[1]; + var value = filter[2]; + + /* Determine index of key in the table columns */ + var col = $.map(oSettings.aoColumns, function(x, i) {if (x.sTitle == key) return i;})[0]; + + /* Unknown key: no filtering */ + if (typeof(col) == 'undefined') + return; + + col_value=unfold.get_value(aData[col]); + /* Test whether current filter is compatible with the column */ + if (op == '=' || op == '==') { + if ( col_value != value || col_value==null || col_value=="" || col_value=="n/a") + ret = false; + }else if (op == '!=') { + if ( col_value == value || col_value==null || col_value=="" || col_value=="n/a") + ret = false; + } else if(op=='<') { + if ( parseFloat(col_value) >= value || col_value==null || col_value=="" || col_value=="n/a") + ret = false; + } else if(op=='>') { + if ( parseFloat(col_value) <= value || col_value==null || col_value=="" || col_value=="n/a") + ret = false; + } else if(op=='<=' || op=='≤') { + if ( parseFloat(col_value) > value || col_value==null || col_value=="" || col_value=="n/a") + ret = false; + } else if(op=='>=' || op=='≥') { + if ( parseFloat(col_value) < value || col_value==null || col_value=="" || col_value=="n/a") + ret = false; + }else{ + // How to break out of a loop ? + alert("filter not supported"); + return false; + } + + }); + return ret; + }, + + _querytable_draw_callback: function() + { + /* + * Handle clicks on checkboxes: reassociate checkbox click every time + * the table is redrawn + */ + this.elts('querytable-checkbox').unbind('click').click(this, this._check_click); + $("#add_vm").unbind('click').click(this, this.fnAddVm); + $("#submit_vms").unbind('click').click(this, this.fnCreateVms); + $('#univbris_vtam__table .delete').unbind('click').click(this, this.fnDelete); + /*var edits=this.elts.all.find('.edit'); + edits.each(function(){ + this.unbind('click').click(this,this.fnEdit); + } + */ + if (!this.table) + return; + + /* Remove pagination if we show only a few results */ + var wrapper = this.table; //.parent().parent().parent(); + var rowsPerPage = this.table.fnSettings()._iDisplayLength; + var rowsToShow = this.table.fnSettings().fnRecordsDisplay(); + var minRowsPerPage = this.table.fnSettings().aLengthMenu[0]; + + if ( rowsToShow <= rowsPerPage || rowsPerPage == -1 ) { + $('.querytable_paginate', wrapper).css('visibility', 'hidden'); + } else { + $('.querytable_paginate', wrapper).css('visibility', 'visible'); + } + + if ( rowsToShow <= minRowsPerPage ) { + $('.querytable_length', wrapper).css('visibility', 'hidden'); + } else { + $('.querytable_length', wrapper).css('visibility', 'visible'); + } + + + + + }, + + + + _check_click: function(e) + { + e.stopPropagation(); + + var self = e.data; + var id=this.id; + + // this.id = key of object to be added... what about multiple keys ? + if (debug) messages.debug("querytable._check_click key="+this.canonical_key+"->"+id+" checked="+this.checked); + //manifold.raise_event(self.options.query_uuid, this.checked?SET_ADD:SET_REMOVED, id); + //return false; // prevent checkbox to be checked, waiting response from manifold plugin api + + }, + + _selectAll: function() + { + // requires jQuery id + var uuid=this.id.split("-"); + var oTable=$("#querytable-"+uuid[1]).dataTable(); + // Function available in QueryTable 1.9.x + // Filter : displayed data only + var filterData = oTable._('tr', {"filter":"applied"}); + /* TODO: WARNING if too many nodes selected, use filters to reduce nuber of nodes */ + if(filterData.length<=100){ + $.each(filterData, function(index, obj) { + var last=$(obj).last(); + var key_value=unfold.get_value(last[0]); + if(typeof($(last[0]).attr('checked'))=="undefined"){ + $.publish('selected', 'add/'+key_value); + } + }); + } + }, + + }); + + + + $.plugin('UnivbrisVtam', UnivbrisVtam); + + /* define the 'dom-checkbox' type for sorting in datatables + http://datatables.net/examples/plug-ins/dom_sort.html + using trial and error I found that the actual column number + was in fact given as a third argument, and not second + as the various online resources had it - go figure */ + $.fn.dataTableExt.afnSortData['dom-checkbox'] = function ( oSettings, _, iColumn ) { + return $.map( oSettings.oApi._fnGetTrNodes(oSettings), function (tr, i) { + return result=$('td:eq('+iColumn+') input', tr).prop('checked') ? '1' : '0'; + } ); + } + + + +})(jQuery); + + + diff --git a/plugins/univbrisvtam/templates/univbrisvtamplugin.html b/plugins/univbrisvtam/templates/univbrisvtamplugin.html new file mode 100644 index 00000000..bcd7787a --- /dev/null +++ b/plugins/univbrisvtam/templates/univbrisvtamplugin.html @@ -0,0 +1,29 @@ +
+
+
+ + + {% for column in columns %} {% endfor %} + {% for column in hidden_columns %} {% endfor %} + + + + + + + {% for column in columns %} {% endfor %} + {% for column in hidden_columns %} {% endfor %} + + +
{{ column }}{{ column }}
{{ column }}{{ column }}
+ + + + + + + + +
+ + diff --git a/plugins/univbrisvtamform/__init__.py b/plugins/univbrisvtamform/__init__.py new file mode 100644 index 00000000..5f6c0d22 --- /dev/null +++ b/plugins/univbrisvtamform/__init__.py @@ -0,0 +1,43 @@ +from unfold.plugin import Plugin + +class UnivbrisVtamForm (Plugin): + + def __init__ (self, query=None, query_all=None, + checkboxes=False, columns=None, + init_key=None, + datatables_options={}, **settings): + Plugin.__init__(self, **settings) + self.query = query + self.query.uuid = query.query_uuid if query else None + self.query_all = query_all + self.query_all_uuid = query_all.query_uuid if query_all else None + + + def template_file (self): + return "univbrisvtamform.html" + + def template_env (self, request): + env={} + env.update(self.__dict__) + return env + + def requirements (self): + reqs = { + 'js_files' : [ "js/spin-presets.js", "js/spin.min.js", "js/jquery.spin.js", + "js/dataTables.js", "js/dataTables.bootstrap.js", "js/with-datatables.js", + "js/manifold.js", "js/manifold-query.js", + "js/unfold-helper.js", + "js/univbrisvtamform.js", + ] , + 'css_files': [ "css/dataTables.bootstrap.css", + "css/dataTables.full_numbers.css", + "css/univbrisvtamform.css", + ], + } + return reqs + + def json_settings_list (self): + return ['plugin_uuid', 'domid', + 'query_uuid', 'query_all_uuid', + 'checkboxes', 'datatables_options', + 'hidden_columns', 'init_key',] diff --git a/plugins/univbrisvtamform/static/css/univbrisvtamform.css b/plugins/univbrisvtamform/static/css/univbrisvtamform.css new file mode 100644 index 00000000..cd227cf4 --- /dev/null +++ b/plugins/univbrisvtamform/static/css/univbrisvtamform.css @@ -0,0 +1,65 @@ + +/* the bottom of the datatable needs more space */ +div.univbrisvtamform-spacer { padding: 8px 4px 15px 4px; } + +div.UnivbrisVtamForm table.dataTable th { + font: bold 12px/22px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; + color: #4f6b72; + border-right: 1px solid #C1DAD7; + border-bottom: 1px solid #C1DAD7; + border-top: 1px solid #C1DAD7; + letter-spacing: 1px; + text-transform: uppercase; + text-align: left; + padding: 8px 12px 4px 20px; + vertical-align:middle; +/* background: #CAE8EA url(../img/tablesort-header.jpg) no-repeat; */ +} + +div.UnivbrisVtamForm table.dataTable th.checkbox { + padding-left: 14px; +} + +div.UnivbrisVtamForm table.dataTable td, div.UnivbrisVtamForm table.dataTable textarea, div.UnivbrisVtamForm table.dataTable input [type="text"] { + font: bold 12px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif; + color: #660099; + border-right: 1px solid #C1DAD7; + border-bottom: 1px solid #C1DAD7; +} +div.UnivbrisVtamForm table.dataTable td { + padding: 4px 8px 4px 8px; + /* this applies on even rows only, odd ones have a setting in bootstrap of rbg 249.249.249 */ + background-color: #f4f4f4; + color: #660099; +} +div.UnivbrisVtamForm table.dataTable td a { + font-weight:normal; +} +/* these come from bootstrap */ +div.UnivbrisVtamForm div.dataTables_info { + font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; +} + +/* one could think or using repeat-x here but that's not working because of the arrows + * we might need to make these wider some day + * and/or to add background-color: #caebea + * which would look less conspicuous in case of overflow +*/ + +div.UnivbrisVtamForm table.dataTable thead .sorting { background: url('../img/tablesort-header-sortable.png') no-repeat; } +div.UnivbrisVtamForm table.dataTable thead .sorting_asc { background: url('../img/tablesort-header-up.png') no-repeat; } +div.UnivbrisVtamForm table.dataTable thead .sorting_desc { background: url('../img/tablesort-header-down.png') no-repeat; } +/* this icons set does not have that exact equivalent - using an approximation for now */ +div.UnivbrisVtamForm table.dataTable thead .sorting_asc_disabled { background: url('../img/tablesort-header.png') repeat-x; } +div.UnivbrisVtamForm table.dataTable thead .sorting_desc_disabled { background: url('../img/tablesort-header.png') repeat-x; } + +/* the footers are not active */ +div.UnivbrisVtamForm table.dataTable tfoot { + background: url('../img/tablesort-header.png') repeat-x; + background-color: #caebea; +} +/* and when sorting is turned off it's useful to set this on header too */ +div.UnivbrisVtamForm table.dataTable thead { + background: url('../img/tablesort-header.png') repeat-x; + background-color: #caebea; +} diff --git a/plugins/univbrisvtamform/static/img/README b/plugins/univbrisvtamform/static/img/README new file mode 100644 index 00000000..5df2d69b --- /dev/null +++ b/plugins/univbrisvtamform/static/img/README @@ -0,0 +1,2 @@ +these styling elements come from plekit with a simple transition to png +they're currently not all used in myslice diff --git a/plugins/univbrisvtamform/static/img/tablesort-bullet1.png b/plugins/univbrisvtamform/static/img/tablesort-bullet1.png new file mode 100644 index 00000000..4304f360 Binary files /dev/null and b/plugins/univbrisvtamform/static/img/tablesort-bullet1.png differ diff --git a/plugins/univbrisvtamform/static/img/tablesort-bullet2.png b/plugins/univbrisvtamform/static/img/tablesort-bullet2.png new file mode 100644 index 00000000..4f181e19 Binary files /dev/null and b/plugins/univbrisvtamform/static/img/tablesort-bullet2.png differ diff --git a/plugins/univbrisvtamform/static/img/tablesort-col-alt.png b/plugins/univbrisvtamform/static/img/tablesort-col-alt.png new file mode 100644 index 00000000..8179f830 Binary files /dev/null and b/plugins/univbrisvtamform/static/img/tablesort-col-alt.png differ diff --git a/plugins/univbrisvtamform/static/img/tablesort-gradient.png b/plugins/univbrisvtamform/static/img/tablesort-gradient.png new file mode 100644 index 00000000..26558a49 Binary files /dev/null and b/plugins/univbrisvtamform/static/img/tablesort-gradient.png differ diff --git a/plugins/univbrisvtamform/static/img/tablesort-header-down.png b/plugins/univbrisvtamform/static/img/tablesort-header-down.png new file mode 100644 index 00000000..c8ed6576 Binary files /dev/null and b/plugins/univbrisvtamform/static/img/tablesort-header-down.png differ diff --git a/plugins/univbrisvtamform/static/img/tablesort-header-sortable.png b/plugins/univbrisvtamform/static/img/tablesort-header-sortable.png new file mode 100644 index 00000000..0c169040 Binary files /dev/null and b/plugins/univbrisvtamform/static/img/tablesort-header-sortable.png differ diff --git a/plugins/univbrisvtamform/static/img/tablesort-header-up.png b/plugins/univbrisvtamform/static/img/tablesort-header-up.png new file mode 100644 index 00000000..d12fe2a5 Binary files /dev/null and b/plugins/univbrisvtamform/static/img/tablesort-header-up.png differ diff --git a/plugins/univbrisvtamform/static/img/tablesort-header.png b/plugins/univbrisvtamform/static/img/tablesort-header.png new file mode 100644 index 00000000..cff526f9 Binary files /dev/null and b/plugins/univbrisvtamform/static/img/tablesort-header.png differ diff --git a/plugins/univbrisvtamform/static/img/tablesort-td-alt.png b/plugins/univbrisvtamform/static/img/tablesort-td-alt.png new file mode 100644 index 00000000..ef5ab358 Binary files /dev/null and b/plugins/univbrisvtamform/static/img/tablesort-td-alt.png differ diff --git a/plugins/univbrisvtamform/static/img/toggle-hidden.png b/plugins/univbrisvtamform/static/img/toggle-hidden.png new file mode 100755 index 00000000..023f22a8 Binary files /dev/null and b/plugins/univbrisvtamform/static/img/toggle-hidden.png differ diff --git a/plugins/univbrisvtamform/static/img/toggle-visible.png b/plugins/univbrisvtamform/static/img/toggle-visible.png new file mode 100755 index 00000000..baf6c286 Binary files /dev/null and b/plugins/univbrisvtamform/static/img/toggle-visible.png differ diff --git a/plugins/univbrisvtamform/static/js/univbrisvtamform.js b/plugins/univbrisvtamform/static/js/univbrisvtamform.js new file mode 100644 index 00000000..88d3ce74 --- /dev/null +++ b/plugins/univbrisvtamform/static/js/univbrisvtamform.js @@ -0,0 +1,321 @@ +/** + * Description: display a query result in a datatables-powered + * Copyright (c) 2012-2013 UPMC Sorbonne Universite - INRIA + * License: GPLv3 + */ + +(function($){ + + vt_servers_list=[]; + testbeds_list=[]; + + var UnivbrisVtamForm = Plugin.extend({ + + init: function(options, element) { + //console.log("hello...................."); + this._super(options, element); + this.filters = Array(); + + // an internal buffer for records that are 'in' and thus need to be checked + this.buffered_records_to_check = []; + // an internal buffer for keeping lines and display them in one call to fnAddData + this.buffered_lines = []; + + + + + //var keys = manifold.metadata.get_key(this.object); + //this.canonical_key = (keys && keys.length == 1) ? keys[0] : undefined; + // + //this.init_key = this.options.init_key; + // have init_key default to canonical_key + //this.init_key = this.init_key || this.canonical_key; + // sanity check + //if ( ! this.init_key ) messages.warning ("UnivbrisVtamForm : cannot find init_key"); + //if ( ! this.canonical_key ) messages.warning ("UnivbrisVtamForm : cannot find canonical_key"); + //if (debug) messages.debug("UnivbrisVtamForm: canonical_key="+this.canonical_key+" init_key="+this.init_key); + + /* Setup query and record handlers */ + this.listen_query(options.query_uuid); + // this.listen_query(options.query_all_uuid, 'all'); + + /* GUI setup and event binding */ + + + $('').appendTo('#vtam_form_buttons'); + $("#cancelvtamform").unbind('click').click(this, this.fnCancelVtamForm); + + $('').appendTo('#vtam_form_buttons'); + $("#addvtamform").unbind('click').click(this, this.fnAddVtamForm); + + jQuery("#univbris_vtam_form").hide(); + + $('#uob_testbed_name').on("change", this.testbedChanged); + + //this.on_new_record("urn:publicid:IDN+i2cat:vtam+node+Rodoreda"); + //this.on_new_record("urn:publicid:IDN+bristol:vtam+node+March"); + //this.on_new_record("urn:publicid:IDN+brazil:vtam+node+Verdaguer"); + //this.on_query_done(); + + // console.log("after"); + }, + + testbedChanged: function(e){ + console.log($('#uob_testbed_name option:selected').text()); + + $('#uob_virtualization_server') + .find('option') + .remove() + .end(); + + for(var i=0;i") + .attr("value",vt_servers_list[i].name) + .text(vt_servers_list[i].name)); + } + } + }, + + + fnCancelVtamForm:function(e){ + jQuery("#univbris_vtam_form").hide(); + jQuery("#univbris_vtam").show(); + console.log("cancel vtam form"); + }, + + fnAddVtamForm:function(e){ + console.log("add vtam form"); + var vmNameVal = /^[a-zA-Z0-9]+$/; + //console.log($("#uob_vm_name").val()); + if (vmNameVal.test($("#uob_vm_name").val())){ + //build form string + var vtam="testbed:"+$('#uob_testbed_name option:selected').text(); + vtam +=",vt_server:"+$('#uob_virtualization_server option:selected').text(); + vtam +=",vm_name:"+$("#uob_vm_name").val(); + var vm_name="

"+$("#uob_vm_name").val()+"

"; + var vtamtable = $("#univbris_vtam__table").dataTable(); + vtamtable.fnAddData([$('#uob_testbed_name option:selected').text(),$('#uob_virtualization_server option:selected').text(), vm_name,'Delete']); + jQuery("#univbris_vtam_form").hide(); + jQuery("#univbris_vtam").show(); + } + else{ + $('#uob_vm_name').addClass('error'); + jQuery('#uob_vm_name_error').show(); + } + }, + + /* PLUGIN EVENTS */ + + on_show: function(e) { + }, + + on_resize: function(e) { + }, + + /* GUI EVENTS */ + + /* GUI MANIPULATION */ + + new_record: function(record) + { + var urn = record['urn']; + var pos = urn.search('vtam'); + if (pos!=-1){ + ///line =new Array(); + var vt_server={}; + var com_ay=urn.split("+"); + vt_server['name']=com_ay[com_ay.length-1]; + var testbed_ay=com_ay[1].split(":"); + vt_server['testbed']=testbed_ay[0]; + this.add_new_vt_server(vt_server); + this.add_new_testbed(testbed_ay[0]); + //this.vt_servers_list.push(vt_server); + } + }, + + clear_table: function() + { + }, + + redraw_table: function() + { + }, + + + add_new_vt_server:function(vt_server){ + var found=false; + for(var i=0;i") + .attr("value",key) + .text(value.testbed)); + });*/ + + $('#uob_testbed_name') + .find('option') + .remove() + .end() + + for(var t=0;t") + .attr("value",testbeds_list[t]) + .text(testbeds_list[t])); + } + + $('#uob_virtualization_server') + .find('option') + .remove() + .end() + + for(var i=0;i") + .attr("value",vt_servers_list[i].name) + .text(vt_servers_list[i].name)); + } + } + + this.unspin(); + }, + + on_field_state_changed: function(data) + { + + }, + + }); //close plugin extend + + $.plugin('UnivbrisVtamForm', UnivbrisVtamForm); + +})(jQuery); + + + + diff --git a/plugins/univbrisvtamform/templates/univbrisvtamform.html b/plugins/univbrisvtamform/templates/univbrisvtamform.html new file mode 100644 index 00000000..b9f7c509 --- /dev/null +++ b/plugins/univbrisvtamform/templates/univbrisvtamform.html @@ -0,0 +1,62 @@ + + +
+
+ + + + + + + + + + + + + + + + + + + +
Testbed + +
Virtualization Server + + + +
VM Name + + + + +

name of VM should be alphanumeric

+
+ +
+ diff --git a/portal/sliceresourceview.py b/portal/sliceresourceview.py index eaf7931c..985e775b 100644 --- a/portal/sliceresourceview.py +++ b/portal/sliceresourceview.py @@ -30,7 +30,8 @@ from plugins.univbrisfv import UnivbrisFv from plugins.univbrisfvf import UnivbrisFvf from plugins.univbrisfvfo import UnivbrisFvfo from plugins.univbristopo import UnivbrisTopo - +from plugins.univbrisvtam import UnivbrisVtam as UnivbrisVtamPlugin +from plugins.univbrisvtamform import UnivbrisVtamForm from plugins.columns_editor import ColumnsEditor from plugins.sladialog import SlaDialog @@ -313,9 +314,8 @@ class SliceResourceView (LoginRequiredView, ThemeView): }, ) - #plugin which allows the definition the match criteria on a single OPTICAL flowspace - - univbrisofvform = UnivbrisFvfo( + #plugin which allows the definition the match criteria on a single OPTICAL flowspace + univbrisofvform = UnivbrisFvfo( page = page, title = 'univbris_oflowspace_form', domid = 'univbris_oflowspace_form', @@ -334,9 +334,34 @@ class SliceResourceView (LoginRequiredView, ThemeView): title = 'univbris_topology', domid = 'univbris_topology', query = query_resource_all, - #query = query_resource_all, ) - + + # -------------------------------------------------------------------------- + # Ofelia VTAM Plugin + # Bristol Plugin + + #plugin which display a table where an experimenter will add VMs to according to his needs + univbrisvtamplugin = UnivbrisVtamPlugin( + page = page, + title = 'univbris_vtam', + domid = 'univbris_vtam', + query = None, + ) + + #plugin which display a form where an experimenter will specify where a + univbrisvtamform = UnivbrisVtamForm( + page = page, + title = 'univbris_vtam_form', + domid = 'univbris_vtam_form', + query = query_resource_all, + query_all = None, + datatables_options = { + 'iDisplayLength': 3, + 'bLengthChange' : True, + 'bAutoWidth' : True, + }, + ) + # -------------------------------------------------------------------------- # SLA View and accept dialog @@ -393,7 +418,9 @@ class SliceResourceView (LoginRequiredView, ThemeView): template_env['oflowspaces_form'] = univbrisofvform.render(self.request) template_env['flowspaces_form'] = univbrisfvform.render(self.request) template_env['topology'] = univbristopology.render(self.request) - + template_env['vms_list'] = univbrisvtamplugin.render(self.request) + template_env['vm_form'] = univbrisvtamform.render(self.request) + # template_env['pending_resources'] = pending_resources.render(self.request) template_env['sla_dialog'] = '' # sla_dialog.render(self.request) template_env["theme"] = self.theme diff --git a/portal/templates/slice-resource-view.html b/portal/templates/slice-resource-view.html index 17e13830..ff1fc3e0 100644 --- a/portal/templates/slice-resource-view.html +++ b/portal/templates/slice-resource-view.html @@ -54,6 +54,7 @@ $(document).ready(function() { @@ -91,8 +92,14 @@ $(document).ready(function() {
{{map_resources}}
-
+
+

{{vms_list}}

+

{{vm_form}}

+ +

{{below_table}}

+
+

{{welcome}}

{{flowspaces}}

{{flowspaces_form}}

@@ -101,8 +108,8 @@ $(document).ready(function() {

{{resources}}

{{below_table}}

-
+
{{scheduler}}
diff --git a/portal/templates/univbrisvtam.html b/portal/templates/univbrisvtam.html new file mode 100644 index 00000000..82de78b9 --- /dev/null +++ b/portal/templates/univbrisvtam.html @@ -0,0 +1,15 @@ +{% extends "layout-unfold1.html" %} + +{% block head %} +{% endblock %} + +{% block unfold_main %} + +

Create New Virtual Machines

+ +

{{vms_list}}

+

{{vm_form}}

+ +

{{below_table}}

+ +{% endblock %} diff --git a/portal/univbrisvtam.py b/portal/univbrisvtam.py new file mode 100644 index 00000000..c557998a --- /dev/null +++ b/portal/univbrisvtam.py @@ -0,0 +1,94 @@ +import json +from manifold.core.query import Query +from manifoldapi.manifoldapi import execute_query + +from unfold.page import Page + +from plugins.lists.testbedlist import TestbedList +from plugins.lists.slicelist import SliceList + +from unfold.loginrequired import FreeAccessView +from unfold.loginrequired import LoginRequiredAutoLogoutView + +from ui.topmenu import topmenu_items_live, the_user +from plugins.lists.staticlist import StaticList +from plugins.lists.slicelist import SliceList +from plugins.messages import Messages +from plugins.querytable import QueryTable +from plugins.univbrisfoam import UnivbrisFoam +from plugins.univbrisfv import UnivbrisFv +from plugins.univbrisvtam import UnivbrisVtam as UnivbrisVtamPlugin +from plugins.univbrisvtamform import UnivbrisVtamForm + +#This view requires login +class UnivbrisVtam (LoginRequiredAutoLogoutView): + template_name = "univbrisvtam.html" + + def get_context_data(self, **kwargs): + + page = Page(self.request) + #print "UNIVBRIS page" + + #create new query to manifold----query is not called yet + #need to modify to get i2cat of resources also + univbrisvtamform_query=Query().get('ofelia-i2cat-vt:resource').select('hostname') + #print univbrisfoam_query #.select('urn') + + #queue the query + page.enqueue_query(univbrisvtamform_query) + page.expose_js_metadata() + + + #plugin which display a table where an experimenter will add VMs to according to his needs + univbrisvtamplugin = UnivbrisVtamPlugin( + page = page, + title = 'univbris_vtam', + domid = 'univbris_vtam', + query = None, + ) + + #plugin which display a form where an experimenter will specify where a + univbrisvtamform = UnivbrisVtamForm( + page = page, + title = 'univbris_vtam_form', + domid = 'univbris_vtam_form', + query = univbrisvtamform_query, + query_all = None, + datatables_options = { + 'iDisplayLength': 3, + 'bLengthChange' : True, + 'bAutoWidth' : True, + }, + ) + + #render plugins in each context within a single page, but not all plugins are visible at all time. + context = super(UnivbrisVtam, self).get_context_data(**kwargs) + context['person'] = self.request.user + #context['welcome'] = univbriswelcome.render(self.request) + #context['resources'] = univbrisfoamlist.render(self.request) + context['vms_list']= univbrisvtamplugin.render(self.request) + context['vm_form']= univbrisvtamform.render(self.request) + #context['oflowspaces_form']= univbrisofvform.render(self.request) + #context['flowspaces_form']= univbrisfvform.render(self.request) + #context['topology']=univbristopology.render(self.request) + + + # XXX This is repeated in all pages + # more general variables expected in the template + context['title'] = 'Create New Virtual Machines' + # the menu items on the top + context['topmenu_items'] = topmenu_items_live('univbris', page) + # so we can sho who is logged + context['username'] = the_user(self.request) + + context.update(page.prelude_env()) + page.expose_js_metadata() + + + # the page header and other stuff + context.update(page.prelude_env()) + + context['layout_1_or_2']="layout-unfold2.html" if not context['username'] else "layout-unfold1.html" + + return context + diff --git a/portal/urls.py b/portal/urls.py index 907267c4..8859e624 100644 --- a/portal/urls.py +++ b/portal/urls.py @@ -44,16 +44,18 @@ from portal.validationview import ValidatePendingView #from portal.experimentview import ExperimentView from portal.termsview import TermsView from portal.univbrisview import UnivbrisView +from portal.univbrisvtam import UnivbrisVtam + from portal.manualdelegationview import ManualDelegationView -from portal.servicedirectory import ServiceDirectoryView +from portal.servicedirectory import ServiceDirectoryView from portal.documentationview import DocumentationView from portal.supportview import SupportView from portal.emailactivationview import ActivateEmailView # hopefully these should move in dedicated source files too -from portal.views import PresViewView, pres_view_static, pres_view_methods, pres_view_animation -from portal.django_passresetview import password_reset, password_reset_done, password_reset_confirm, password_reset_complete +from portal.views import PresViewView, pres_view_static, pres_view_methods, pres_view_animation +from portal.django_passresetview import password_reset, password_reset_done, password_reset_confirm, password_reset_complete # DEPRECATED #named_register_forms = ( # DEPRECATED # ("step1", RegisterUserForm), @@ -122,7 +124,8 @@ urlpatterns = patterns('', 'portal.django_passresetview.password_reset_complete'), url(r'^univbris/?$', UnivbrisView.as_view(), name='univbris'), - + url(r'^univbrisvtam/?$', UnivbrisVtam.as_view(), name='univbrisvtam'), + url(r'^servicedirectory/?$', ServiceDirectoryView.as_view(), name='servicedirectory'), )