From: Loic Baron Date: Thu, 26 Sep 2013 10:10:16 +0000 (+0200) Subject: Merge branch 'master' of git://git.onelab.eu/myslice X-Git-Tag: myslice-0.2-5~85^2~7^2~2 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=4dfd873aec658a5f2a22983c7221f8b7006aa475 Merge branch 'master' of git://git.onelab.eu/myslice Conflicts: portal/templates/registration_view.html --- 4dfd873aec658a5f2a22983c7221f8b7006aa475 diff --cc manifold/manifoldproxy.py index 3ead6a3e,a63e4a8b..6eb67c3a --- a/manifold/manifoldproxy.py +++ b/manifold/manifoldproxy.py @@@ -1,14 -1,15 +1,16 @@@ import json + import os.path + # this is for django objects only #from django.core import serializers -from django.http import HttpResponse, HttpResponseForbidden +from django.http import HttpResponse, HttpResponseForbidden #from manifold.manifoldquery import ManifoldQuery -from manifold.core.query import Query +from manifold.core.query import Query from manifold.core.result_value import ResultValue -from manifold.manifoldapi import ManifoldAPI -from manifold.manifoldresult import ManifoldException +from manifold.manifoldapi import ManifoldAPI +from manifold.manifoldresult import ManifoldException +from manifold.util.log import Log debug=False debug=True diff --cc plugins/query_editor/__init__.py index 16261503,16261503..53adeae7 --- a/plugins/query_editor/__init__.py +++ b/plugins/query_editor/__init__.py @@@ -17,7 -17,7 +17,7 @@@ class QueryEditor(Plugin) ] , 'css_files': [ 'css/query_editor.css', --# 'css/jquery-ui.css', ++ 'css/jquery-ui.css', # 'css/demo_page.css', # 'css/demo_table.css', ] diff --cc plugins/query_editor/static/js/query_editor.js index 1e15a018,1e15a018..553dbc6c --- a/plugins/query_editor/static/js/query_editor.js +++ b/plugins/query_editor/static/js/query_editor.js @@@ -16,10 -16,10 +16,16 @@@ event_filter_added: function(op, suffix) { suffix = (typeof suffix === 'undefined') ? '' : manifold.separator + suffix; var self = this; -- return function(e) { ++ return function(e, ui) { var array = self.array_from_id(e.target.id); var key = self.field_from_id(array); // No need to remove suffix... -- var value = e.target.value; ++ ++ // using autocomplete ui ++ if(typeof(ui) != "undefined"){ ++ var value = ui.item.value; ++ }else{ ++ var value = e.target.value; ++ } if (value) { // XXX This should be handled by manifold @@@ -34,7 -34,7 +40,7 @@@ init: function(options, element) { this._super(options, element); -- ++ console.log("init Query_Editor"); this.listen_query(options.query_uuid); this.elts('queryeditor-auto-filter').change(this.event_filter_added('=')); @@@ -82,7 -82,7 +88,6 @@@ ] }); -- var self = this; // Actions on the newly added fields this.elmt('table tbody td span').on('click', function() { var nTr = this.parentNode.parentNode; @@@ -105,6 -105,6 +110,9 @@@ 'padding-top' : '0em', 'padding-bottom': '0em' }); ++ ++ // autocomplete list of tags ++ this.availableTags = {}; }, // init @@@ -162,6 -162,6 +170,7 @@@ on_field_added: function(field) { ++ console.log("on_field_added : "+field); this.check_field(field); }, @@@ -170,6 -170,6 +179,30 @@@ this.uncheck_field(field); }, ++ /* RECORD HANDLERS */ ++ on_query_done: function() ++ { ++ //console.log("Query_Editor: query_done!"); ++ //console.log(this.availableTags); ++ }, ++ on_new_record: function(record) ++ { ++ //console.log("Query_Editor: new_record!"); ++ //console.log(record); ++ availableTags = this.availableTags; ++ jQuery.each(record,function(key,value){ ++ value = get_value(value); ++ if(!availableTags.hasOwnProperty(key)){availableTags[key]=new Array();} ++ //availableTags[key].push(value); ++ var currentArray = availableTags[key]; ++ if(value!=null){ ++ if(jQuery.inArray(value,currentArray)==-1){availableTags[key].push(value);} ++ } ++ }); ++ this.availableTags = availableTags; ++ this.update_autocomplete(availableTags); ++ }, ++ /* Former code not used at the moment */ print_field_description: function(field_header, div_id) @@@ -236,6 -236,6 +269,23 @@@ return output; }, ++ update_autocomplete: function(availableTags) ++ { ++ var self = this; ++ var domid = this.options.plugin_uuid; ++ ++ jQuery.each(availableTags, function(key, value){ ++ value.sort(); ++ jQuery("#"+domid+"__field__"+key).autocomplete({ ++ source: value, ++ selectFirst: true, ++ minLength: 0, // allows to browse items with no value typed in ++ select: self.event_filter_added('=') ++ }); ++ }); ++ }, // update_autocomplete ++ ++/* update_autocomplete: function(e, rows, current_query) { var d = data; @@@ -272,7 -272,7 +322,7 @@@ }); }); }, // update_autocomplete -- ++*/ fnFormatDetails: function( metaTable, nTr, div_id ) { var aData = metaTable.fnGetData( nTr ); diff --cc portal/sliceview.py index b265e796,b265e796..97802f60 --- a/portal/sliceview.py +++ b/portal/sliceview.py @@@ -24,7 -24,7 +24,8 @@@ from plugins.messages im tmp_default_slice='ple.upmc.myslicedemo' # temporary : turn off the users part to speed things up --do_query_users=True ++#do_query_users=True ++do_query_users=False class SliceView (LoginRequiredAutoLogoutView): @@@ -32,6 -32,6 +33,7 @@@ page = Page(request) page.add_css_files ('css/slice-view.css') ++ page.add_js_files ( [ "js/common.functions.js" ] ) page.add_js_chunks ('$(function() { console.log("sliceview: jQuery version " + $.fn.jquery); });') page.add_js_chunks ('$(function() { console.log("sliceview: users turned %s"); });'%("on" if do_query_users else "off")) page.expose_js_metadata() @@@ -143,7 -143,7 +145,7 @@@ resources_query_editor = QueryEditor( page = page, -- query = sq_resource, ++ query = query_resource_all, title = "Select Columns", ) resources_active_filters = ActiveFilters( diff --cc portal/templates/registration_view.html index 302871e6,18759f4e..71ef1b86 --- a/portal/templates/registration_view.html +++ b/portal/templates/registration_view.html @@@ -18,85 -22,88 +22,90 @@@ {% endfor %} {% endif %} - - -
-

OneLab Experimenter Registration

-

For First Line Support please Contact Support

-
-
- {% csrf_token %} -
-
- - -

Enter your first name

- -
-
- - -

Enter your last name

- -
- -
- - -

Please select an authority responsible for vetting your account

-
- -
- - -

Enter a valid email address

- -
-
- - -

Enter password

- -
-
- - -

Retype the password

-
-
- - -

Genkey: Account Delegation Automatic (Recommended)

- -
- -
- -
-
-
-
++ +
+ {% csrf_token %} +
+ +
+ +
+

Enter your first name

+
+
+ +
+ +
+

Enter your last name

+
+
+ +
+ +
+

Please select an authority responsible for vetting your account

+
+ +
+ +
+ +
+

Enter a valid email address

+
+
+ +
+ +
+

Enter password

+
+
+ +
+ +
+

Retype the password

+
+
+ +
+ +
+

Genkey: Account Delegation Automatic (Recommended)

+
+ +
+
+ +
+
+
+
++>>>>>>> abb43f86edd5a2888cb96ca92a58350db9e32fcf
{% endblock %} diff --cc unfold/static/js/unfold-helper.js index 8d75cc3e,8d75cc3e..67524a1c --- a/unfold/static/js/unfold-helper.js +++ b/unfold/static/js/unfold-helper.js @@@ -34,7 -34,7 +34,11 @@@ var unfold = }, escape_id: function(id) { -- return id.replace( /(:|\.|\[|\])/g, "\\$1" ); ++ if(typeof id != 'undefined'){ ++ return id.replace( /(:|\.|\[|\])/g, "\\$1" ); ++ }else{ ++ return "fake-id"; ++ } } } // global unfold