commit/galaxy-central: carlfeberhard: history panel: better error-handling
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/9a0d3c0735d7/ Changeset: 9a0d3c0735d7 User: carlfeberhard Date: 2013-04-09 22:39:43 Summary: history panel: better error-handling Affected #: 15 files diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c lib/galaxy/web/base/controller.py --- a/lib/galaxy/web/base/controller.py +++ b/lib/galaxy/web/base/controller.py @@ -382,6 +382,15 @@ return trans.security.encode_dict_ids( hda_dict ) + def get_hda_dict_with_error( self, trans, hda, error_msg='' ): + return trans.security.encode_dict_ids({ + 'id' : hda.id, + 'history_id': hda.history.id, + 'hid' : hda.hid, + 'name' : hda.name, + 'error' : error_msg + }) + def get_display_apps( self, trans, hda ): #TODO: make more straightforward (somehow) display_apps = [] diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c lib/galaxy/webapps/galaxy/controllers/root.py --- a/lib/galaxy/webapps/galaxy/controllers/root.py +++ b/lib/galaxy/webapps/galaxy/controllers/root.py @@ -11,6 +11,7 @@ from galaxy.model.item_attrs import UsesAnnotations from galaxy import util, web from galaxy.util.sanitize_html import sanitize_html +from galaxy.util.json import to_json_string #from galaxy.model.orm import * import logging @@ -106,73 +107,72 @@ yield "</body></html>" ## ---- Root history display --------------------------------------------- + def history_as_xml( self, trans, show_deleted=None, show_hidden=None ): + if trans.app.config.require_login and not trans.user: + return trans.fill_template( '/no_access.mako', message = 'Please log in to access Galaxy histories.' ) + + history = trans.get_history( create=True ) + trans.response.set_content_type('text/xml') + return trans.fill_template_mako( "root/history_as_xml.mako", + history=history, + show_deleted=util.string_as_bool( show_deleted ), + show_hidden=util.string_as_bool( show_hidden ) ) + @web.expose def history( self, trans, as_xml=False, show_deleted=None, show_hidden=None, hda_id=None, **kwd ): """Display the current history, creating a new history if necessary. NOTE: No longer accepts "id" or "template" options for security reasons. """ + if as_xml: + return self.history_as_xml( trans, + show_deleted=util.string_as_bool( show_deleted ), show_hidden=util.string_as_bool( show_hidden ) ) + + # get all datasets server-side, client-side will get flags and render appropriately + show_deleted = util.string_as_bool_or_none( show_deleted ) + show_purged = show_deleted + show_hidden = util.string_as_bool_or_none( show_hidden ) params = util.Params( kwd ) - message = params.get( 'message', None ) + message = params.get( 'message', '' ) status = params.get( 'status', 'done' ) if trans.app.config.require_login and not trans.user: return trans.fill_template( '/no_access.mako', message = 'Please log in to access Galaxy histories.' ) - history = trans.get_history( create=True ) + def err_msg( where=None ): + where = where if where else 'getting the history data from the server' + err_msg = ( 'An error occurred %s. ' + + 'Please contact a Galaxy administrator if the problem persists.' ) %( where ) + return err_msg, 'error' - if as_xml: - trans.response.set_content_type('text/xml') - return trans.fill_template_mako( "root/history_as_xml.mako", - history=history, - show_deleted=util.string_as_bool( show_deleted ), - show_hidden=util.string_as_bool( show_hidden ) ) + history_dictionary = {} + hda_dictionaries = [] + try: + history = trans.get_history( create=True ) + history_dictionary = self.get_history_dict( trans, history ) - show_deleted = util.string_as_bool_or_none( show_deleted ) - show_purged = show_deleted - show_hidden = util.string_as_bool_or_none( show_hidden ) + #TODO: would be good to re-use the hdas above to get the history data... + hdas = self.get_history_datasets( trans, history, + show_deleted=True, show_hidden=True, show_purged=True ) + for hda in hdas: + try: + if hda.id >= 1058: + raise Exception( 'Bler blah bler' ) + hda_dictionaries.append( self.get_hda_dict( trans, hda ) ) - # get all datasets server-side, client-side will get flags and render appropriately - hdas = self.get_history_datasets( trans, history, - show_deleted=True, show_hidden=True, show_purged=True ) + except Exception, exc: + # don't fail entire list if hda err's, record and move on + log.error( 'Error bootstrapping hda %d: %s', hda.id, str( exc ), exc_info=True ) + hda_dictionaries.append( self.get_hda_dict_with_error( trans, hda, str( exc ) ) ) - #TODO: would be good to re-use the hdas above to get the history data... - history_dictionary = self.get_history_dict( trans, history ) - - #TODO: blech - all here for now - duplication of hist. contents, index - hda_dictionaries = [] - for hda in hdas: - try: - hda_dictionaries.append( self.get_hda_dict( trans, hda ) ) - - except Exception, exc: - # don't fail entire list if hda err's, record and move on - # (making sure http recvr knows it's err'd) - encoded_hda_id = trans.security.encode_id( hda.id ) - log.error( "Error in history API at listing contents with history %s, hda %s: (%s) %s", - history_dictionary[ 'id' ], encoded_hda_id, type( exc ), str( exc ) ) - return_val = { - 'id' : encoded_hda_id, - 'name' : hda.name, - 'hid' : hda.hid, - 'history_id': history_dictionary[ 'id' ], - 'state' : trans.model.Dataset.states.ERROR, - 'visible' : True, - 'misc_info' : str( exc ), - 'misc_blurb': 'Failed to retrieve dataset information.', - 'error' : str( exc ) - } - hda_dictionaries.append( return_val ) + except Exception, exc: + log.error( 'Error bootstrapping history for user %d: %s', trans.user.id, str( exc ), exc_info=True ) + message, status = err_msg() + history_dictionary[ 'error' ] = message return trans.stream_template_mako( "root/history.mako", - history_dictionary = history_dictionary, - hda_dictionaries = hda_dictionaries, - show_deleted = show_deleted, - show_hidden = show_hidden, - hda_id = hda_id, - log = log, - message = message, - status = status ) + history_json = to_json_string( history_dictionary ), hda_json = to_json_string( hda_dictionaries ), + show_deleted=show_deleted, show_hidden=show_hidden, hda_id=hda_id, log=log, message=message, status=status ) ## ---- Dataset display / editing ---------------------------------------- @web.expose diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c static/scripts/galaxy.panels.js --- a/static/scripts/galaxy.panels.js +++ b/static/scripts/galaxy.panels.js @@ -201,7 +201,7 @@ var modal; $(function(){ - modal = new Modal( { overlay: $("#overlay"), dialog: $("#dialog-box"), backdrop: $("#overlay-background") } ); + modal = new Modal( { overlay: $("#overlay"), dialog: $("#dialog-box"), backdrop: $("#overlay-background") } ); }); // Backward compatibility diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c static/scripts/mvc/dataset/hda-model.js --- a/static/scripts/mvc/dataset/hda-model.js +++ b/static/scripts/mvc/dataset/hda-model.js @@ -26,15 +26,14 @@ history_id : null, // often used with tagging model_class : 'HistoryDatasetAssociation', - // index within history (??) hid : 0, // ---whereas these are Dataset related/inherited - id : null, + id : null, name : '(unnamed dataset)', // one of HistoryDatasetAssociation.STATES - state : 'ok', + state : 'new', // sniffed datatype (sam, tabular, bed, etc.) data_type : null, // size in bytes @@ -44,13 +43,12 @@ // array of associated file types (eg. [ 'bam_index', ... ]) meta_files : [], - misc_blurb : '', + misc_blurb : '', misc_info : '', - deleted : false, + deleted : false, purged : false, - // aka. !hidden (start hidden) - visible : false, + visible : true, // based on trans.user (is_admin or security_agent.can_access_dataset( <user_roles>, hda.dataset )) accessible : true }, diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c static/scripts/mvc/history/history-model.js --- a/static/scripts/mvc/history/history-model.js +++ b/static/scripts/mvc/history/history-model.js @@ -67,8 +67,11 @@ // handle errors in initialHdas //TODO: errors from the api shouldn't be plain strings... //TODO: remove when mappers and hda_dict are unified (or move to alt history) - } else if( _.isString( initialHdas ) && ( initialHdas.match( /error/i ) ) ){ - alert( _l( 'Error loading bootstrapped history' ) + ':\n' + initialHdas ); + } else if( _.isString( initialHdas ) ){ + this.log( 'error in initialHdas: ', initialHdas ); + Galaxy.show_modal( _l( 'Error loading datasets for history' ), initialHdas, + { 'Ok': function(){ Galaxy.hide_modal(); } } ); + //TODO: retry (via ajax), report } } diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c static/scripts/packed/mvc/data.js --- a/static/scripts/packed/mvc/data.js +++ b/static/scripts/packed/mvc/data.js @@ -1,1 +1,1 @@ -define(["libs/backbone/backbone-relational"],function(){var c=Backbone.RelationalModel.extend({});var d=Backbone.RelationalModel.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){var h=new c();_.each(_.keys(this.attributes),function(i){if(i.indexOf("metadata_")===0){var j=i.split("metadata_")[1];h.set(j,this.attributes[i]);delete this.attributes[i]}},this);this.set("metadata",h)},get_metadata:function(h){return this.attributes.metadata.get(h)},urlRoot:galaxy_paths.get("datasets_url")});var b=d.extend({defaults:_.extend({},d.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(h){d.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var h=this,i=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:h.attributes.chunk_index++}).success(function(j){var k;if(j.ck_data!==""){k=j}else{h.attributes.at_eof=true;k=null}i.resolve(k)});return i}});var f=Backbone.Collection.extend({model:d});var e=Backbone.View.extend({initialize:function(h){},render:function(){this.$el.append($("<div/>").attr("id","loading_indicator"));var l=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(l);var h=this.model.get_metadata("column_names");if(h){l.append("<tr><th>"+h.join("</th><th>")+"</th></tr>")}var j=this.model.get("first_data_chunk");if(j){this._renderChunk(j)}var i=this,m=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"}),k=false;if(!m){m=window}m=$(m);m.scroll(function(){if(!k&&(i.$el.height()-m.scrollTop()-m.height()<=0)){k=true;$.when(i.model.get_next_chunk()).then(function(n){if(n){i._renderChunk(n);k=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},_renderCell:function(j,h,k){var i=this.model.get_metadata("column_types");if(k!==undefined){return $("<td>").attr("colspan",k).addClass("stringalign").text(j)}else{if(i[h]==="str"||i==="list"){return $("<td>").addClass("stringalign").text(j)}else{return $("<td>").text(j)}}},_renderRow:function(h){var i=h.split("\t"),k=$("<tr>"),j=this.model.get_metadata("columns");if(i.length===j){_.each(i,function(m,l){k.append(this._renderCell(m,l))},this)}else{if(i.length>j){_.each(i.slice(0,j-1),function(m,l){k.append(this._renderCell(m,l))},this);k.append(this._renderCell(i.slice(j-1).join("\t"),j-1))}else{if(j>5&&i.length===j-1){_.each(i,function(m,l){k.append(this._renderCell(m,l))},this);k.append($("<td>"))}else{k.append(this._renderCell(h,0,j))}}}return k},_renderChunk:function(h){var i=this.$el.find("table");_.each(h.ck_data.split("\n"),function(j,k){i.append(this._renderRow(j))},this)}});var a=function(k,i,l,h){var j=new i({model:new k(l)});j.render();if(h){h.append(j.$el)}return j};var g=function(j,h){var i=$("<div/>").appendTo(h);return new e({el:i,model:new b(j)}).render()};return{Dataset:d,TabularDataset:b,DatasetCollection:f,TabularDatasetChunkedView:e,createTabularDatasetChunkedView:g}}); \ No newline at end of file +define(["libs/backbone/backbone-relational"],function(){var d=Backbone.RelationalModel.extend({});var e=Backbone.RelationalModel.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){var i=new d();_.each(_.keys(this.attributes),function(j){if(j.indexOf("metadata_")===0){var l=j.split("metadata_")[1];i.set(l,this.attributes[j]);delete this.attributes[j]}},this);this.set("metadata",i)},get_metadata:function(i){return this.attributes.metadata.get(i)},urlRoot:galaxy_paths.get("datasets_url")});var c=e.extend({defaults:_.extend({},e.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(i){e.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var i=this,j=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:i.attributes.chunk_index++}).success(function(k){var l;if(k.ck_data!==""){l=k}else{i.attributes.at_eof=true;l=null}j.resolve(l)});return j}});var g=Backbone.Collection.extend({model:e});var f=Backbone.View.extend({initialize:function(i){},render:function(){var m=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(m);var i=this.model.get_metadata("column_names");if(i){m.append("<tr><th>"+i.join("</th><th>")+"</th></tr>")}var k=this.model.get("first_data_chunk");if(k){this._renderChunk(k)}var j=this,n=_.find(this.$el.parents(),function(o){return $(o).css("overflow")==="auto"}),l=false;if(!n){n=window}n=$(n);n.scroll(function(){if(!l&&(j.$el.height()-n.scrollTop()-n.height()<=0)){l=true;$.when(j.model.get_next_chunk()).then(function(o){if(o){j._renderChunk(o);l=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},_renderCell:function(k,i,l){var j=this.model.get_metadata("column_types");if(l!==undefined){return $("<td>").attr("colspan",l).addClass("stringalign").text(k)}else{if(j[i]==="str"||j==="list"){return $("<td>").addClass("stringalign").text(k)}else{return $("<td>").text(k)}}},_renderRow:function(i){var j=i.split("\t"),l=$("<tr>"),k=this.model.get_metadata("columns");if(j.length===k){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this)}else{if(j.length>k){_.each(j.slice(0,k-1),function(n,m){l.append(this._renderCell(n,m))},this);l.append(this._renderCell(j.slice(k-1).join("\t"),k-1))}else{if(k>5&&j.length===k-1){_.each(j,function(n,m){l.append(this._renderCell(n,m))},this);l.append($("<td>"))}else{l.append(this._renderCell(i,0,k))}}}return l},_renderChunk:function(i){var j=this.$el.find("table");_.each(i.ck_data.split("\n"),function(k,l){j.append(this._renderRow(k))},this)}});var b=f.extend({col:{chrom:null,start:null,end:null,},url_viz:null,dataset_id:null,genome_build:null,get_type:function(i){return({}).toString.call(i).match(/\s([a-zA-Z]+)/)[1].toLowerCase()},initialize:function(i){var j=i.model.attributes.metadata.attributes;if(typeof j.chromCol==="undefined"||typeof j.startCol==="undefined"||typeof j.endCol==="undefined"){console.log("TabularDatasetChunkedViewWithButton : Metadata for column identification is missing.")}else{this.col.chrom=j.chromCol-1;this.col.start=j.startCol-1;this.col.end=j.endCol-1}if(this.col.chrom==null){return}if(typeof i.model.attributes.id==="undefined"){console.log("TabularDatasetChunkedViewWithButton : Dataset identification is missing.")}else{this.dataset_id=i.model.attributes.id}if(typeof i.model.attributes.url_viz==="undefined"){console.log("TabularDatasetChunkedViewWithButton : Url for visualization controller is missing.")}else{this.url_viz=i.model.attributes.url_viz}if(typeof i.model.attributes.genome_build!=="undefined"){this.genome_build=i.model.attributes.genome_build}},events:{"mouseover tr":"btn_viz_show",mouseleave:"btn_viz_hide"},btn_viz_show:function(l){if(this.col.chrom==null){return}var n=$(l.target).parent();var i={dataset_id:this.dataset_id,gene_region:n.children().eq(this.col.chrom).html()+":"+n.children().eq(this.col.start).html()+"-"+n.children().eq(this.col.end).html()};if(n.children().eq(this.col.chrom).html()!=""){var m=n.offset();var k=m.left-10;var j=m.top;$("#btn_viz").css({position:"fixed",top:j+"px",left:k+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,i,this.genome_build));$("#btn_viz").show()}},btn_viz_hide:function(i){$("#btn_viz").hide()},create_trackster_action_new:function(i,k,j){return function(){window.parent.location.href=i+"/trackster?"+$.param(k)}},create_trackster_action:function(i,k,j){return function(){var l={};if(j){l["f-dbkey"]=j}$.ajax({url:i+"/list_tracks?"+$.param(l),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(m){var n=window.parent;n.show_modal(("View Data in a New or Saved Visualization"),"",{Cancel:function(){n.hide_modal()},"View in saved visualization":function(){n.show_modal(("Add Data to Saved Visualization"),m,{Cancel:function(){n.hide_modal()},"Add to visualization":function(){$(n.document).find("input[name=id]:checked").each(function(){var o=$(this).val();k.id=o;n.location=i+"/trackster?"+$.param(k)})}})},"View in new visualization":function(){n.location=i+"/trackster?"+$.param(k)}})}});return false}},render:function(){var i=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.$el.append(i.render().$el);$("#btn_viz").hide();f.prototype.render.call(this)}});var a=function(l,j,m,i){var k=new j({model:new l(m)});k.render();if(i){i.append(k.$el)}return k};var h=function(k,i){var j=$("<div/>").appendTo(i);return new b({el:j,model:new c(k)}).render()};return{Dataset:e,TabularDataset:c,DatasetCollection:g,TabularDatasetChunkedView:f,createTabularDatasetChunkedView:h}}); \ No newline at end of file diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c static/scripts/packed/mvc/dataset/hda-model.js --- a/static/scripts/packed/mvc/dataset/hda-model.js +++ b/static/scripts/packed/mvc/dataset/hda-model.js @@ -1,1 +1,1 @@ -var HistoryDatasetAssociation=BaseModel.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"(unnamed dataset)",state:"ok",data_type:null,file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",deleted:false,purged:false,visible:false,accessible:true},urlRoot:"api/histories/",url:function(){return"api/histories/"+this.get("history_id")+"/contents/"+this.get("id")},initialize:function(){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",HistoryDatasetAssociation.STATES.NOT_VIEWABLE)}this.on("change:state",function(b,a){this.log(this+" has changed state:",b,a);if(this.inReadyState()){this.trigger("state:ready",b,a,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(b,c){var a=true;if((!b)&&(this.get("deleted")||this.get("purged"))){a=false}if((!c)&&(!this.get("visible"))){a=false}return a},inReadyState:function(){var a=this.get("state");return(this.isDeletedOrPurged()||(a===HistoryDatasetAssociation.STATES.OK)||(a===HistoryDatasetAssociation.STATES.EMPTY)||(a===HistoryDatasetAssociation.STATES.FAILED_METADATA)||(a===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(a===HistoryDatasetAssociation.STATES.DISCARDED)||(a===HistoryDatasetAssociation.STATES.ERROR))},hasData:function(){return(this.get("file_size")>0)},toString:function(){var a=this.get("id")||"";if(this.get("name")){a=this.get("hid")+' :"'+this.get("name")+'",'+a}return"HDA("+a+")"}});HistoryDatasetAssociation.STATES={UPLOAD:"upload",QUEUED:"queued",PAUSED:"paused",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};var HDACollection=Backbone.Collection.extend(LoggableMixin).extend({model:HistoryDatasetAssociation,initialize:function(){},ids:function(){return this.map(function(a){return a.id})},getByHid:function(a){return _.first(this.filter(function(b){return b.get("hid")===a}))},hidToCollectionIndex:function(a){if(!a){return this.models.length}var d=this.models.length-1;for(var b=d;b>=0;b--){var c=this.at(b).get("hid");if(c==a){return b}if(c<a){return b+1}}return null},getVisible:function(a,b){return this.filter(function(c){return c.isVisible(a,b)})},getStateLists:function(){var a={};_.each(_.values(HistoryDatasetAssociation.STATES),function(b){a[b]=[]});this.each(function(b){a[b.get("state")].push(b.get("id"))});return a},running:function(){var a=[];this.each(function(b){if(!b.inReadyState()){a.push(b.get("id"))}});return a},set:function(a){var b=this;if(!a||!_.isArray(a)){return}a.forEach(function(c){var d=b.get(c.id);if(d){d.set(c)}})},update:function(a){this.log(this+"update:",a);if(!(a&&a.length)){return[]}var c=this,b=null;_.each(a,function(f,d){var e=c.get(f);if(e){e.fetch();b.push(e)}});return b},toString:function(){return("HDACollection()")}}); \ No newline at end of file +var HistoryDatasetAssociation=BaseModel.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"(unnamed dataset)",state:"new",data_type:null,file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",deleted:false,purged:false,visible:true,accessible:true},urlRoot:"api/histories/",url:function(){return"api/histories/"+this.get("history_id")+"/contents/"+this.get("id")},initialize:function(){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",HistoryDatasetAssociation.STATES.NOT_VIEWABLE)}this.on("change:state",function(b,a){this.log(this+" has changed state:",b,a);if(this.inReadyState()){this.trigger("state:ready",b,a,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(b,c){var a=true;if((!b)&&(this.get("deleted")||this.get("purged"))){a=false}if((!c)&&(!this.get("visible"))){a=false}return a},inReadyState:function(){var a=this.get("state");return(this.isDeletedOrPurged()||(a===HistoryDatasetAssociation.STATES.OK)||(a===HistoryDatasetAssociation.STATES.EMPTY)||(a===HistoryDatasetAssociation.STATES.FAILED_METADATA)||(a===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(a===HistoryDatasetAssociation.STATES.DISCARDED)||(a===HistoryDatasetAssociation.STATES.ERROR))},hasData:function(){return(this.get("file_size")>0)},toString:function(){var a=this.get("id")||"";if(this.get("name")){a=this.get("hid")+' :"'+this.get("name")+'",'+a}return"HDA("+a+")"}});HistoryDatasetAssociation.STATES={UPLOAD:"upload",QUEUED:"queued",PAUSED:"paused",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};var HDACollection=Backbone.Collection.extend(LoggableMixin).extend({model:HistoryDatasetAssociation,initialize:function(){},ids:function(){return this.map(function(a){return a.id})},getByHid:function(a){return _.first(this.filter(function(b){return b.get("hid")===a}))},hidToCollectionIndex:function(a){if(!a){return this.models.length}var d=this.models.length-1;for(var b=d;b>=0;b--){var c=this.at(b).get("hid");if(c==a){return b}if(c<a){return b+1}}return null},getVisible:function(a,b){return this.filter(function(c){return c.isVisible(a,b)})},getStateLists:function(){var a={};_.each(_.values(HistoryDatasetAssociation.STATES),function(b){a[b]=[]});this.each(function(b){a[b.get("state")].push(b.get("id"))});return a},running:function(){var a=[];this.each(function(b){if(!b.inReadyState()){a.push(b.get("id"))}});return a},set:function(a){var b=this;if(!a||!_.isArray(a)){return}a.forEach(function(c){var d=b.get(c.id);if(d){d.set(c)}})},update:function(a){this.log(this+"update:",a);if(!(a&&a.length)){return[]}var c=this,b=null;_.each(a,function(f,d){var e=c.get(f);if(e){e.fetch();b.push(e)}});return b},toString:function(){return("HDACollection()")}}); \ No newline at end of file diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c static/scripts/packed/mvc/history/history-model.js --- a/static/scripts/packed/mvc/history/history-model.js +++ b/static/scripts/packed/mvc/history/history-model.js @@ -1,1 +1,1 @@ -var History=BaseModel.extend(LoggableMixin).extend({defaults:{id:"",name:"",state:"",diskSize:0,deleted:false,annotation:null,message:null},urlRoot:"api/histories/",url:function(){return"api/histories/"+this.get("id")},initialize:function(a,b){this.log(this+".initialize:",a,b);this.hdas=new HDACollection();if(b){if(_.isArray(b)){this.hdas.reset(b);this.checkForUpdates();if(this.hdas.length>0){this.updateDisplayApplications()}}else{if(_.isString(b)&&(b.match(/error/i))){alert(_l("Error loading bootstrapped history")+":\n"+b)}}}this.hdas.bind("state:ready",function(d,f,c){if(d.get("force_history_refresh")){var e=this;setTimeout(function(){e.stateUpdater()},History.UPDATE_DELAY)}},this)},loadFromApi:function(a,c){var b=this;b.attributes.id=a;jQuery.when(jQuery.ajax("api/users/current"),b.fetch()).then(function(e,d){b.attributes.user=e[0];b.trigger("loaded:user",e[0]);b.trigger("loaded",d[0])}).then(function(){jQuery.ajax(b.url()+"/contents?"+jQuery.param({ids:b.hdaIdsFromStateIds().join(",")})).success(function(d){b.hdas.reset(d);b.checkForUpdates();b.trigger("loaded:hdas",d);if(c){callback(b)}})})},hdaIdsFromStateIds:function(){return _.reduce(_.values(this.get("state_ids")),function(b,a){return b.concat(a)})},checkForUpdates:function(a){if(this.hdas.running().length){this.stateUpdater()}else{this.trigger("ready")}return this},stateUpdater:function(){var c=this,a=this.get("state"),b=this.get("state_ids");jQuery.ajax("api/histories/"+this.get("id")).success(function(d){c.set(d);c.log("current history state:",c.get("state"),"(was)",a,"new size:",c.get("nice_size"));var e=[];_.each(_.keys(d.state_ids),function(g){var f=_.difference(d.state_ids[g],b[g]);e=e.concat(f)});if(e.length){c.fetchHdaUpdates(e)}if((c.get("state")===HistoryDatasetAssociation.STATES.RUNNING)||(c.get("state")===HistoryDatasetAssociation.STATES.QUEUED)){setTimeout(function(){c.stateUpdater()},History.UPDATE_DELAY)}else{c.trigger("ready")}}).error(function(f,d,e){if(!((f.readyState===0)&&(f.status===0))){alert(_l("Error getting history updates from the server:")+"\n"+e);c.log("stateUpdater error:",e,"responseText:",f.responseText)}})},fetchHdaUpdates:function(b){var a=this;jQuery.ajax({url:this.url()+"/contents?"+jQuery.param({ids:b.join(",")}),error:function(h,c,d){if((h.readyState===0)&&(h.status===0)){return}var f=JSON.parse(h.responseText);if(_.isArray(f)){var e=_.groupBy(f,function(i){if(_.has(i,"error")){return"errored"}return"ok"});a.log("fetched, errored datasets:",e.errored);a.updateHdas(f)}else{var g=_l("ERROR updating hdas from api history contents")+": ";a.log(g,b,h,c,d,f);alert(g+b.join(","))}},success:function(d,c,e){a.log(a+".fetchHdaUpdates, success:",c,e);a.updateHdas(d)}})},updateHdas:function(a){var c=this,b=[];c.log(c+".updateHdas:",a);_.each(a,function(e,f){var d=c.hdas.get(e.id);if(d){c.log("found existing model in list for id "+e.id+", updating...:");d.set(e)}else{c.log("NO existing model for id "+e.id+", creating...:");b.push(e)}});if(b.length){c.addHdas(b)}},addHdas:function(a){var b=this;_.each(a,function(c,d){var e=b.hdas.hidToCollectionIndex(c.hid);c.history_id=b.get("id");b.hdas.add(new HistoryDatasetAssociation(c),{at:e,silent:true})});b.hdas.trigger("add",a)},updateDisplayApplications:function(a){this.log(this+"updateDisplayApplications:",a);var c=this,b=(a&&_.isArray(a))?({hda_ids:a.join(",")}):({});c.log(this+": fetching display application data");jQuery.ajax("history/get_display_application_links",{data:b,success:function(e,d,f){c.hdas.set(e)},error:function(g,d,e){if(!((g.readyState===0)&&(g.status===0))){var f="Error fetching display applications, "+a+":"+(g.responseText||e);Galaxy.show_modal("History panel error",f,{Ok:function(){Galaxy.hide_modal()}});this.log(f)}}})},toString:function(){var a=(this.get("name"))?(","+this.get("name")):("");return"History("+this.get("id")+a+")"}});History.UPDATE_DELAY=4000;var HistoryCollection=Backbone.Collection.extend(LoggableMixin).extend({model:History,urlRoot:"api/histories"}); \ No newline at end of file +var History=BaseModel.extend(LoggableMixin).extend({defaults:{id:"",name:"",state:"",diskSize:0,deleted:false,annotation:null,message:null},urlRoot:"api/histories/",url:function(){return"api/histories/"+this.get("id")},initialize:function(a,b){this.log(this+".initialize:",a,b);this.hdas=new HDACollection();if(b){if(_.isArray(b)){this.hdas.reset(b);this.checkForUpdates();if(this.hdas.length>0){this.updateDisplayApplications()}}else{if(_.isString(b)){this.log("error in initialHdas: ",b);Galaxy.show_modal(_l("Error loading datasets for history"),b,{Ok:function(){Galaxy.hide_modal()}})}}}this.hdas.bind("state:ready",function(d,f,c){if(d.get("force_history_refresh")){var e=this;setTimeout(function(){e.stateUpdater()},History.UPDATE_DELAY)}},this)},loadFromApi:function(a,c){var b=this;b.attributes.id=a;jQuery.when(jQuery.ajax("api/users/current"),b.fetch()).then(function(e,d){b.attributes.user=e[0];b.trigger("loaded:user",e[0]);b.trigger("loaded",d[0])}).then(function(){jQuery.ajax(b.url()+"/contents?"+jQuery.param({ids:b.hdaIdsFromStateIds().join(",")})).success(function(d){b.hdas.reset(d);b.checkForUpdates();b.trigger("loaded:hdas",d);if(c){callback(b)}})})},hdaIdsFromStateIds:function(){return _.reduce(_.values(this.get("state_ids")),function(b,a){return b.concat(a)})},checkForUpdates:function(a){if(this.hdas.running().length){this.stateUpdater()}else{this.trigger("ready")}return this},stateUpdater:function(){var c=this,a=this.get("state"),b=this.get("state_ids");jQuery.ajax("api/histories/"+this.get("id")).success(function(d){c.set(d);c.log("current history state:",c.get("state"),"(was)",a,"new size:",c.get("nice_size"));var e=[];_.each(_.keys(d.state_ids),function(g){var f=_.difference(d.state_ids[g],b[g]);e=e.concat(f)});if(e.length){c.fetchHdaUpdates(e)}if((c.get("state")===HistoryDatasetAssociation.STATES.RUNNING)||(c.get("state")===HistoryDatasetAssociation.STATES.QUEUED)){setTimeout(function(){c.stateUpdater()},History.UPDATE_DELAY)}else{c.trigger("ready")}}).error(function(f,d,e){if(!((f.readyState===0)&&(f.status===0))){alert(_l("Error getting history updates from the server:")+"\n"+e);c.log("stateUpdater error:",e,"responseText:",f.responseText)}})},fetchHdaUpdates:function(b){var a=this;jQuery.ajax({url:this.url()+"/contents?"+jQuery.param({ids:b.join(",")}),error:function(h,c,d){if((h.readyState===0)&&(h.status===0)){return}var f=JSON.parse(h.responseText);if(_.isArray(f)){var e=_.groupBy(f,function(i){if(_.has(i,"error")){return"errored"}return"ok"});a.log("fetched, errored datasets:",e.errored);a.updateHdas(f)}else{var g=_l("ERROR updating hdas from api history contents")+": ";a.log(g,b,h,c,d,f);alert(g+b.join(","))}},success:function(d,c,e){a.log(a+".fetchHdaUpdates, success:",c,e);a.updateHdas(d)}})},updateHdas:function(a){var c=this,b=[];c.log(c+".updateHdas:",a);_.each(a,function(e,f){var d=c.hdas.get(e.id);if(d){c.log("found existing model in list for id "+e.id+", updating...:");d.set(e)}else{c.log("NO existing model for id "+e.id+", creating...:");b.push(e)}});if(b.length){c.addHdas(b)}},addHdas:function(a){var b=this;_.each(a,function(c,d){var e=b.hdas.hidToCollectionIndex(c.hid);c.history_id=b.get("id");b.hdas.add(new HistoryDatasetAssociation(c),{at:e,silent:true})});b.hdas.trigger("add",a)},updateDisplayApplications:function(a){this.log(this+"updateDisplayApplications:",a);var c=this,b=(a&&_.isArray(a))?({hda_ids:a.join(",")}):({});c.log(this+": fetching display application data");jQuery.ajax("history/get_display_application_links",{data:b,success:function(e,d,f){c.hdas.set(e)},error:function(g,d,e){if(!((g.readyState===0)&&(g.status===0))){var f="Error fetching display applications, "+a+":"+(g.responseText||e);Galaxy.show_modal("History panel error",f,{Ok:function(){Galaxy.hide_modal()}});this.log(f)}}})},toString:function(){var a=(this.get("name"))?(","+this.get("name")):("");return"History("+this.get("id")+a+")"}});History.UPDATE_DELAY=4000;var HistoryCollection=Backbone.Collection.extend(LoggableMixin).extend({model:History,urlRoot:"api/histories"}); \ No newline at end of file diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c static/scripts/packed/templates/compiled/template-hda-warning-messages.js --- a/static/scripts/packed/templates/compiled/template-hda-warning-messages.js +++ b/static/scripts/packed/templates/compiled/template-hda-warning-messages.js @@ -1,1 +1,1 @@ -(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-warning-messages"]=b(function(g,s,q,k,z){this.compilerInfo=[2,">= 1.0.0-rc.3"];q=q||g.helpers;z=z||{};var r="",h,e="function",d=this.escapeExpression,p=this,c=q.blockHelperMissing;function o(C,B){var A;A=q.unless.call(C,C.purged,{hash:{},inverse:p.noop,fn:p.program(2,n,B),data:B});if(A||A===0){return A}else{return""}}function n(E,D){var A="",C,B;A+="\n";B={hash:{},inverse:p.noop,fn:p.program(3,m,D),data:D};if(C=q.warningmessagesmall){C=C.call(E,B)}else{C=E.warningmessagesmall;C=typeof C===e?C.apply(E):C}if(!q.warningmessagesmall){C=c.call(E,C,B)}if(C||C===0){A+=C}A+="\n";return A}function m(F,E){var A="",D,C,B;A+="\n ";B={hash:{},inverse:p.noop,fn:p.program(4,l,E),data:E};if(D=q.local){D=D.call(F,B)}else{D=F.local;D=typeof D===e?D.apply(F):D}if(!q.local){D=c.call(F,D,B)}if(D||D===0){A+=D}A+="\n ";C=q["if"].call(F,((D=F.urls),D==null||D===false?D:D.undelete),{hash:{},inverse:p.noop,fn:p.program(6,j,E),data:E});if(C||C===0){A+=C}A+="\n";return A}function l(B,A){return"This dataset has been deleted."}function j(E,D){var A="",C,B;A+='\n \n Click <a href="'+d(((C=((C=E.urls),C==null||C===false?C:C.undelete)),typeof C===e?C.apply(E):C))+'" class="historyItemUndelete" id="historyItemUndeleter-';if(B=q.id){B=B.call(E,{hash:{},data:D})}else{B=E.id;B=typeof B===e?B.apply(E):B}A+=d(B)+'"\n target="galaxy_history">here</a> to undelete it\n ';B=q["if"].call(E,((C=E.urls),C==null||C===false?C:C.purge),{hash:{},inverse:p.noop,fn:p.program(7,i,D),data:D});if(B||B===0){A+=B}A+="\n ";return A}function i(E,D){var A="",C,B;A+='\n or <a href="'+d(((C=((C=E.urls),C==null||C===false?C:C.purge)),typeof C===e?C.apply(E):C))+'" class="historyItemPurge" id="historyItemPurger-';if(B=q.id){B=B.call(E,{hash:{},data:D})}else{B=E.id;B=typeof B===e?B.apply(E):B}A+=d(B)+'"\n target="galaxy_history">here</a> to immediately remove it from disk\n ';return A}function f(D,C){var B,A;A={hash:{},inverse:p.noop,fn:p.program(10,y,C),data:C};if(B=q.warningmessagesmall){B=B.call(D,A)}else{B=D.warningmessagesmall;B=typeof B===e?B.apply(D):B}if(!q.warningmessagesmall){B=c.call(D,B,A)}if(B||B===0){return B}else{return""}}function y(E,D){var A="",C,B;A+="\n ";B={hash:{},inverse:p.noop,fn:p.program(11,x,D),data:D};if(C=q.local){C=C.call(E,B)}else{C=E.local;C=typeof C===e?C.apply(E):C}if(!q.local){C=c.call(E,C,B)}if(C||C===0){A+=C}A+="\n";return A}function x(B,A){return"This dataset has been deleted and removed from disk."}function w(D,C){var B,A;A={hash:{},inverse:p.noop,fn:p.program(14,v,C),data:C};if(B=q.warningmessagesmall){B=B.call(D,A)}else{B=D.warningmessagesmall;B=typeof B===e?B.apply(D):B}if(!q.warningmessagesmall){B=c.call(D,B,A)}if(B||B===0){return B}else{return""}}function v(F,E){var A="",D,C,B;A+="\n ";B={hash:{},inverse:p.noop,fn:p.program(15,u,E),data:E};if(D=q.local){D=D.call(F,B)}else{D=F.local;D=typeof D===e?D.apply(F):D}if(!q.local){D=c.call(F,D,B)}if(D||D===0){A+=D}A+="\n ";C=q["if"].call(F,((D=F.urls),D==null||D===false?D:D.unhide),{hash:{},inverse:p.noop,fn:p.program(17,t,E),data:E});if(C||C===0){A+=C}A+="\n";return A}function u(B,A){return"This dataset has been hidden."}function t(E,D){var A="",C,B;A+='\n Click <a href="'+d(((C=((C=E.urls),C==null||C===false?C:C.unhide)),typeof C===e?C.apply(E):C))+'" class="historyItemUnhide" id="historyItemUnhider-';if(B=q.id){B=B.call(E,{hash:{},data:D})}else{B=E.id;B=typeof B===e?B.apply(E):B}A+=d(B)+'"\n target="galaxy_history">here</a> to unhide it\n ';return A}h=q["if"].call(s,s.deleted,{hash:{},inverse:p.noop,fn:p.program(1,o,z),data:z});if(h||h===0){r+=h}r+="\n\n";h=q["if"].call(s,s.purged,{hash:{},inverse:p.noop,fn:p.program(9,f,z),data:z});if(h||h===0){r+=h}r+="\n\n";h=q.unless.call(s,s.visible,{hash:{},inverse:p.noop,fn:p.program(13,w,z),data:z});if(h||h===0){r+=h}return r})})(); \ No newline at end of file +(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-warning-messages"]=b(function(h,u,s,n,C){this.compilerInfo=[2,">= 1.0.0-rc.3"];s=s||h.helpers;C=C||{};var t="",j,e="function",d=this.escapeExpression,r=this,c=s.blockHelperMissing;function q(H,G){var D="",F,E;D+='\n<div class="errormessagesmall">\n ';E={hash:{},inverse:r.noop,fn:r.program(2,p,G),data:G};if(F=s.local){F=F.call(H,E)}else{F=H.local;F=typeof F===e?F.apply(H):F}if(!s.local){F=c.call(H,F,E)}if(F||F===0){D+=F}D+=":\n ";E={hash:{},inverse:r.noop,fn:r.program(4,o,G),data:G};if(F=s.local){F=F.call(H,E)}else{F=H.local;F=typeof F===e?F.apply(H):F}if(!s.local){F=c.call(H,F,E)}if(F||F===0){D+=F}D+="\n</div>\n";return D}function p(E,D){return"There was an error getting the data for this dataset"}function o(F,E){var D;if(D=s.error){D=D.call(F,{hash:{},data:E})}else{D=F.error;D=typeof D===e?D.apply(F):D}return d(D)}function m(F,E){var D;D=s.unless.call(F,F.purged,{hash:{},inverse:r.noop,fn:r.program(7,l,E),data:E});if(D||D===0){return D}else{return""}}function l(H,G){var D="",F,E;D+="\n";E={hash:{},inverse:r.noop,fn:r.program(8,i,G),data:G};if(F=s.warningmessagesmall){F=F.call(H,E)}else{F=H.warningmessagesmall;F=typeof F===e?F.apply(H):F}if(!s.warningmessagesmall){F=c.call(H,F,E)}if(F||F===0){D+=F}D+="\n";return D}function i(I,H){var D="",G,F,E;D+="\n ";E={hash:{},inverse:r.noop,fn:r.program(9,g,H),data:H};if(G=s.local){G=G.call(I,E)}else{G=I.local;G=typeof G===e?G.apply(I):G}if(!s.local){G=c.call(I,G,E)}if(G||G===0){D+=G}D+="\n ";F=s["if"].call(I,((G=I.urls),G==null||G===false?G:G.undelete),{hash:{},inverse:r.noop,fn:r.program(11,B,H),data:H});if(F||F===0){D+=F}D+="\n";return D}function g(E,D){return"This dataset has been deleted."}function B(H,G){var D="",F,E;D+='\n \n Click <a href="'+d(((F=((F=H.urls),F==null||F===false?F:F.undelete)),typeof F===e?F.apply(H):F))+'" class="historyItemUndelete" id="historyItemUndeleter-';if(E=s.id){E=E.call(H,{hash:{},data:G})}else{E=H.id;E=typeof E===e?E.apply(H):E}D+=d(E)+'"\n target="galaxy_history">here</a> to undelete it\n ';E=s["if"].call(H,((F=H.urls),F==null||F===false?F:F.purge),{hash:{},inverse:r.noop,fn:r.program(12,A,G),data:G});if(E||E===0){D+=E}D+="\n ";return D}function A(H,G){var D="",F,E;D+='\n or <a href="'+d(((F=((F=H.urls),F==null||F===false?F:F.purge)),typeof F===e?F.apply(H):F))+'" class="historyItemPurge" id="historyItemPurger-';if(E=s.id){E=E.call(H,{hash:{},data:G})}else{E=H.id;E=typeof E===e?E.apply(H):E}D+=d(E)+'"\n target="galaxy_history">here</a> to immediately remove it from disk\n ';return D}function z(G,F){var E,D;D={hash:{},inverse:r.noop,fn:r.program(15,y,F),data:F};if(E=s.warningmessagesmall){E=E.call(G,D)}else{E=G.warningmessagesmall;E=typeof E===e?E.apply(G):E}if(!s.warningmessagesmall){E=c.call(G,E,D)}if(E||E===0){return E}else{return""}}function y(H,G){var D="",F,E;D+="\n ";E={hash:{},inverse:r.noop,fn:r.program(16,x,G),data:G};if(F=s.local){F=F.call(H,E)}else{F=H.local;F=typeof F===e?F.apply(H):F}if(!s.local){F=c.call(H,F,E)}if(F||F===0){D+=F}D+="\n";return D}function x(E,D){return"This dataset has been deleted and removed from disk."}function w(G,F){var E,D;D={hash:{},inverse:r.noop,fn:r.program(19,v,F),data:F};if(E=s.warningmessagesmall){E=E.call(G,D)}else{E=G.warningmessagesmall;E=typeof E===e?E.apply(G):E}if(!s.warningmessagesmall){E=c.call(G,E,D)}if(E||E===0){return E}else{return""}}function v(I,H){var D="",G,F,E;D+="\n ";E={hash:{},inverse:r.noop,fn:r.program(20,k,H),data:H};if(G=s.local){G=G.call(I,E)}else{G=I.local;G=typeof G===e?G.apply(I):G}if(!s.local){G=c.call(I,G,E)}if(G||G===0){D+=G}D+="\n ";F=s["if"].call(I,((G=I.urls),G==null||G===false?G:G.unhide),{hash:{},inverse:r.noop,fn:r.program(22,f,H),data:H});if(F||F===0){D+=F}D+="\n";return D}function k(E,D){return"This dataset has been hidden."}function f(H,G){var D="",F,E;D+='\n Click <a href="'+d(((F=((F=H.urls),F==null||F===false?F:F.unhide)),typeof F===e?F.apply(H):F))+'" class="historyItemUnhide" id="historyItemUnhider-';if(E=s.id){E=E.call(H,{hash:{},data:G})}else{E=H.id;E=typeof E===e?E.apply(H):E}D+=d(E)+'"\n target="galaxy_history">here</a> to unhide it\n ';return D}j=s["if"].call(u,u.error,{hash:{},inverse:r.noop,fn:r.program(1,q,C),data:C});if(j||j===0){t+=j}t+="\n\n";j=s["if"].call(u,u.deleted,{hash:{},inverse:r.noop,fn:r.program(6,m,C),data:C});if(j||j===0){t+=j}t+="\n\n";j=s["if"].call(u,u.purged,{hash:{},inverse:r.noop,fn:r.program(14,z,C),data:C});if(j||j===0){t+=j}t+="\n\n";j=s.unless.call(u,u.visible,{hash:{},inverse:r.noop,fn:r.program(18,w,C),data:C});if(j||j===0){t+=j}return t})})(); \ No newline at end of file diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c static/scripts/packed/templates/compiled/template-history-historyPanel.js --- a/static/scripts/packed/templates/compiled/template-history-historyPanel.js +++ b/static/scripts/packed/templates/compiled/template-history-historyPanel.js @@ -1,1 +1,1 @@ -(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel"]=b(function(l,A,y,r,I){this.compilerInfo=[2,">= 1.0.0-rc.3"];y=y||l.helpers;I=I||{};var z="",o,k,h,v=this,e="function",c=y.blockHelperMissing,d=this.escapeExpression;function u(N,M){var J="",L,K;J+='\n <div id="history-name" class="tooltip editable-text"\n title="';K={hash:{},inverse:v.noop,fn:v.program(2,t,M),data:M};if(L=y.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!y.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+='">';if(L=y.name){L=L.call(N,{hash:{},data:M})}else{L=N.name;L=typeof L===e?L.apply(N):L}J+=d(L)+"</div>\n ";return J}function t(K,J){return"Click to rename history"}function s(N,M){var J="",L,K;J+='\n <div id="history-name" class="tooltip"\n title="';K={hash:{},inverse:v.noop,fn:v.program(5,q,M),data:M};if(L=y.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!y.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+='">';if(L=y.name){L=L.call(N,{hash:{},data:M})}else{L=N.name;L=typeof L===e?L.apply(N):L}J+=d(L)+"</div>\n ";return J}function q(K,J){return"You must be logged in to edit your history name"}function p(N,M){var J="",L,K;J+='\n <a id="history-tag" title="';K={hash:{},inverse:v.noop,fn:v.program(8,n,M),data:M};if(L=y.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!y.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+='"\n class="icon-button tags tooltip" target="galaxy_main" href="javascript:void(0)"></a>\n <a id="history-annotate" title="';K={hash:{},inverse:v.noop,fn:v.program(10,H,M),data:M};if(L=y.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!y.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+='"\n class="icon-button annotate tooltip" target="galaxy_main" href="javascript:void(0)"></a>\n ';return J}function n(K,J){return"Edit history tags"}function H(K,J){return"Edit history annotation"}function G(N,M){var J="",L,K;J+="\n ";K={hash:{},inverse:v.noop,fn:v.program(13,F,M),data:M};if(L=y.warningmessagesmall){L=L.call(N,K)}else{L=N.warningmessagesmall;L=typeof L===e?L.apply(N):L}if(!y.warningmessagesmall){L=c.call(N,L,K)}if(L||L===0){J+=L}J+="\n ";return J}function F(M,L){var K,J;J={hash:{},inverse:v.noop,fn:v.program(14,E,L),data:L};if(K=y.local){K=K.call(M,J)}else{K=M.local;K=typeof K===e?K.apply(M):K}if(!y.local){K=c.call(M,K,J)}if(K||K===0){return K}else{return""}}function E(K,J){return"You are currently viewing a deleted history!"}function D(N,M){var J="",L,K;J+='\n <div id="history-tag-annotation">\n\n <div id="history-tag-area" style="display: none">\n <strong>';K={hash:{},inverse:v.noop,fn:v.program(17,C,M),data:M};if(L=y.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!y.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+=':</strong>\n <div class="tag-elt"></div>\n </div>\n\n <div id="history-annotation-area" style="display: none">\n <strong>';K={hash:{},inverse:v.noop,fn:v.program(19,B,M),data:M};if(L=y.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!y.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+=':</strong>\n <div id="history-annotation-container">\n <div id="history-annotation" class="tooltip editable-text"\n title="';K={hash:{},inverse:v.noop,fn:v.program(21,m,M),data:M};if(L=y.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!y.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+='">\n ';L=y["if"].call(N,N.annotation,{hash:{},inverse:v.program(25,i,M),fn:v.program(23,j,M),data:M});if(L||L===0){J+=L}J+="\n </div>\n </div>\n </div>\n </div>\n ";return J}function C(K,J){return"Tags"}function B(K,J){return"Annotation"}function m(K,J){return"Click to edit annotation"}function j(M,L){var J="",K;J+="\n ";if(K=y.annotation){K=K.call(M,{hash:{},data:L})}else{K=M.annotation;K=typeof K===e?K.apply(M):K}J+=d(K)+"\n ";return J}function i(N,M){var J="",L,K;J+="\n <em>";K={hash:{},inverse:v.noop,fn:v.program(26,g,M),data:M};if(L=y.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!y.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+="</em>\n ";return J}function g(K,J){return"Describe or add notes to history"}function f(M,L){var J="",K;J+='\n <div id="message-container">\n <div class="';if(K=y.status){K=K.call(M,{hash:{},data:L})}else{K=M.status;K=typeof K===e?K.apply(M):K}J+=d(K)+'message">\n ';if(K=y.message){K=K.call(M,{hash:{},data:L})}else{K=M.message;K=typeof K===e?K.apply(M):K}J+=d(K)+"\n </div><br />\n </div>\n ";return J}function x(K,J){return"You are over your disk quota.\n Tool execution is on hold until your disk usage drops below your allocated quota."}function w(K,J){return"Your history is empty. Click 'Get Data' on the left pane to start"}z+='<div id="history-controls">\n <div id="history-title-area" class="historyLinks">\n\n \n <div id="history-name-container">\n \n ';k=y["if"].call(A,((o=A.user),o==null||o===false?o:o.email),{hash:{},inverse:v.program(4,s,I),fn:v.program(1,u,I),data:I});if(k||k===0){z+=k}z+='\n </div>\n </div>\n\n <div id="history-subtitle-area">\n <div id="history-size" style="float:left;">';if(k=y.nice_size){k=k.call(A,{hash:{},data:I})}else{k=A.nice_size;k=typeof k===e?k.apply(A):k}z+=d(k)+'</div>\n\n <div id="history-secondary-links" style="float: right;">\n ';k=y["if"].call(A,((o=A.user),o==null||o===false?o:o.email),{hash:{},inverse:v.noop,fn:v.program(7,p,I),data:I});if(k||k===0){z+=k}z+='\n </div>\n <div style="clear: both;"></div>\n </div>\n\n ';k=y["if"].call(A,A.deleted,{hash:{},inverse:v.noop,fn:v.program(12,G,I),data:I});if(k||k===0){z+=k}z+="\n\n \n \n ";k=y["if"].call(A,((o=A.user),o==null||o===false?o:o.email),{hash:{},inverse:v.noop,fn:v.program(16,D,I),data:I});if(k||k===0){z+=k}z+="\n\n ";k=y["if"].call(A,A.message,{hash:{},inverse:v.noop,fn:v.program(28,f,I),data:I});if(k||k===0){z+=k}z+='\n\n <div id="quota-message-container" style="display: none">\n <div id="quota-message" class="errormessage">\n ';h={hash:{},inverse:v.noop,fn:v.program(30,x,I),data:I};if(k=y.local){k=k.call(A,h)}else{k=A.local;k=typeof k===e?k.apply(A):k}if(!y.local){k=c.call(A,k,h)}if(k||k===0){z+=k}z+='\n </div>\n </div>\n</div>\n\n<div id="';if(k=y.id){k=k.call(A,{hash:{},data:I})}else{k=A.id;k=typeof k===e?k.apply(A):k}z+=d(k)+'-datasets" class="history-datasets-list"></div>\n\n<div class="infomessagesmall" id="emptyHistoryMessage" style="display: none;">\n ';h={hash:{},inverse:v.noop,fn:v.program(32,w,I),data:I};if(k=y.local){k=k.call(A,h)}else{k=A.local;k=typeof k===e?k.apply(A):k}if(!y.local){k=c.call(A,k,h)}if(k||k===0){z+=k}z+="\n</div>";return z})})(); \ No newline at end of file +(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-historyPanel"]=b(function(m,B,z,s,I){this.compilerInfo=[2,">= 1.0.0-rc.3"];z=z||m.helpers;I=I||{};var A="",p,l,h,w=this,e="function",c=z.blockHelperMissing,d=this.escapeExpression;function v(N,M){var J="",L,K;J+='\n <div id="history-name" class="tooltip editable-text"\n title="';K={hash:{},inverse:w.noop,fn:w.program(2,u,M),data:M};if(L=z.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!z.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+='">';if(L=z.name){L=L.call(N,{hash:{},data:M})}else{L=N.name;L=typeof L===e?L.apply(N):L}J+=d(L)+"</div>\n ";return J}function u(K,J){return"Click to rename history"}function t(N,M){var J="",L,K;J+='\n <div id="history-name" class="tooltip"\n title="';K={hash:{},inverse:w.noop,fn:w.program(5,r,M),data:M};if(L=z.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!z.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+='">';if(L=z.name){L=L.call(N,{hash:{},data:M})}else{L=N.name;L=typeof L===e?L.apply(N):L}J+=d(L)+"</div>\n ";return J}function r(K,J){return"You must be logged in to edit your history name"}function q(N,M){var J="",L,K;J+='\n <a id="history-tag" title="';K={hash:{},inverse:w.noop,fn:w.program(8,o,M),data:M};if(L=z.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!z.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+='"\n class="icon-button tags tooltip" target="galaxy_main" href="javascript:void(0)"></a>\n <a id="history-annotate" title="';K={hash:{},inverse:w.noop,fn:w.program(10,H,M),data:M};if(L=z.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!z.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+='"\n class="icon-button annotate tooltip" target="galaxy_main" href="javascript:void(0)"></a>\n ';return J}function o(K,J){return"Edit history tags"}function H(K,J){return"Edit history annotation"}function G(N,M){var J="",L,K;J+='\n <div id="history-tag-annotation">\n\n <div id="history-tag-area" style="display: none">\n <strong>';K={hash:{},inverse:w.noop,fn:w.program(13,F,M),data:M};if(L=z.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!z.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+=':</strong>\n <div class="tag-elt"></div>\n </div>\n\n <div id="history-annotation-area" style="display: none">\n <strong>';K={hash:{},inverse:w.noop,fn:w.program(15,E,M),data:M};if(L=z.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!z.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+=':</strong>\n <div id="history-annotation-container">\n <div id="history-annotation" class="tooltip editable-text"\n title="';K={hash:{},inverse:w.noop,fn:w.program(17,D,M),data:M};if(L=z.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!z.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+='">\n ';L=z["if"].call(N,N.annotation,{hash:{},inverse:w.program(21,n,M),fn:w.program(19,C,M),data:M});if(L||L===0){J+=L}J+="\n </div>\n </div>\n </div>\n </div>\n ";return J}function F(K,J){return"Tags"}function E(K,J){return"Annotation"}function D(K,J){return"Click to edit annotation"}function C(M,L){var J="",K;J+="\n ";if(K=z.annotation){K=K.call(M,{hash:{},data:L})}else{K=M.annotation;K=typeof K===e?K.apply(M):K}J+=d(K)+"\n ";return J}function n(N,M){var J="",L,K;J+="\n <em>";K={hash:{},inverse:w.noop,fn:w.program(22,k,M),data:M};if(L=z.local){L=L.call(N,K)}else{L=N.local;L=typeof L===e?L.apply(N):L}if(!z.local){L=c.call(N,L,K)}if(L||L===0){J+=L}J+="</em>\n ";return J}function k(K,J){return"Describe or add notes to history"}function j(N,M){var J="",L,K;J+="\n ";K={hash:{},inverse:w.noop,fn:w.program(25,i,M),data:M};if(L=z.warningmessagesmall){L=L.call(N,K)}else{L=N.warningmessagesmall;L=typeof L===e?L.apply(N):L}if(!z.warningmessagesmall){L=c.call(N,L,K)}if(L||L===0){J+=L}J+="\n ";return J}function i(M,L){var K,J;J={hash:{},inverse:w.noop,fn:w.program(26,g,L),data:L};if(K=z.local){K=K.call(M,J)}else{K=M.local;K=typeof K===e?K.apply(M):K}if(!z.local){K=c.call(M,K,J)}if(K||K===0){return K}else{return""}}function g(K,J){return"You are currently viewing a deleted history!"}function f(M,L){var J="",K;J+='\n <div id="message-container">\n <div class="';if(K=z.status){K=K.call(M,{hash:{},data:L})}else{K=M.status;K=typeof K===e?K.apply(M):K}J+=d(K)+'message">';if(K=z.message){K=K.call(M,{hash:{},data:L})}else{K=M.message;K=typeof K===e?K.apply(M):K}J+=d(K)+"</div>\n </div>\n ";return J}function y(K,J){return"You are over your disk quota.\n Tool execution is on hold until your disk usage drops below your allocated quota."}function x(K,J){return"Your history is empty. Click 'Get Data' on the left pane to start"}A+='<div id="history-controls">\n\n <div id="history-title-area" class="historyLinks">\n \n <div id="history-name-container">\n \n ';l=z["if"].call(B,((p=B.user),p==null||p===false?p:p.email),{hash:{},inverse:w.program(4,t,I),fn:w.program(1,v,I),data:I});if(l||l===0){A+=l}A+='\n </div>\n </div>\n\n <div id="history-subtitle-area">\n <div id="history-size" style="float:left;">';if(l=z.nice_size){l=l.call(B,{hash:{},data:I})}else{l=B.nice_size;l=typeof l===e?l.apply(B):l}A+=d(l)+'</div>\n\n <div id="history-secondary-links" style="float: right;">\n ';l=z["if"].call(B,((p=B.user),p==null||p===false?p:p.email),{hash:{},inverse:w.noop,fn:w.program(7,q,I),data:I});if(l||l===0){A+=l}A+='\n </div>\n <div style="clear: both;"></div>\n </div>\n\n \n \n ';l=z["if"].call(B,((p=B.user),p==null||p===false?p:p.email),{hash:{},inverse:w.noop,fn:w.program(12,G,I),data:I});if(l||l===0){A+=l}A+="\n\n ";l=z["if"].call(B,B.deleted,{hash:{},inverse:w.noop,fn:w.program(24,j,I),data:I});if(l||l===0){A+=l}A+="\n\n ";l=z["if"].call(B,B.message,{hash:{},inverse:w.noop,fn:w.program(28,f,I),data:I});if(l||l===0){A+=l}A+='\n\n <div id="quota-message-container" style="display: none">\n <div id="quota-message" class="errormessage">\n ';h={hash:{},inverse:w.noop,fn:w.program(30,y,I),data:I};if(l=z.local){l=l.call(B,h)}else{l=B.local;l=typeof l===e?l.apply(B):l}if(!z.local){l=c.call(B,l,h)}if(l||l===0){A+=l}A+='\n </div>\n </div>\n</div>\n\n<div id="';if(l=z.id){l=l.call(B,{hash:{},data:I})}else{l=B.id;l=typeof l===e?l.apply(B):l}A+=d(l)+'-datasets" class="history-datasets-list"></div>\n\n<div class="infomessagesmall" id="emptyHistoryMessage" style="display: none;">\n ';h={hash:{},inverse:w.noop,fn:w.program(32,x,I),data:I};if(l=z.local){l=l.call(B,h)}else{l=B.local;l=typeof l===e?l.apply(B):l}if(!z.local){l=c.call(B,l,h)}if(l||l===0){A+=l}A+="\n</div>";return A})})(); \ No newline at end of file diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c static/scripts/templates/compiled/template-hda-warning-messages.js --- a/static/scripts/templates/compiled/template-hda-warning-messages.js +++ b/static/scripts/templates/compiled/template-hda-warning-messages.js @@ -7,16 +7,48 @@ function program1(depth0,data) { + var buffer = "", stack1, options; + buffer += "\n<div class=\"errormessagesmall\">\n "; + options = {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data}; + if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } + else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += ":\n "; + options = {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data}; + if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } + else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n</div>\n"; + return buffer; + } +function program2(depth0,data) { + + + return "There was an error getting the data for this dataset"; + } + +function program4(depth0,data) { + var stack1; - stack1 = helpers.unless.call(depth0, depth0.purged, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data}); + if (stack1 = helpers.error) { stack1 = stack1.call(depth0, {hash:{},data:data}); } + else { stack1 = depth0.error; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + return escapeExpression(stack1); + } + +function program6(depth0,data) { + + var stack1; + stack1 = helpers.unless.call(depth0, depth0.purged, {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data}); if(stack1 || stack1 === 0) { return stack1; } else { return ''; } } -function program2(depth0,data) { +function program7(depth0,data) { var buffer = "", stack1, options; buffer += "\n"; - options = {hash:{},inverse:self.noop,fn:self.program(3, program3, data),data:data}; + options = {hash:{},inverse:self.noop,fn:self.program(8, program8, data),data:data}; if (stack1 = helpers.warningmessagesmall) { stack1 = stack1.call(depth0, options); } else { stack1 = depth0.warningmessagesmall; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } if (!helpers.warningmessagesmall) { stack1 = blockHelperMissing.call(depth0, stack1, options); } @@ -24,28 +56,28 @@ buffer += "\n"; return buffer; } -function program3(depth0,data) { +function program8(depth0,data) { var buffer = "", stack1, stack2, options; buffer += "\n "; - options = {hash:{},inverse:self.noop,fn:self.program(4, program4, data),data:data}; + options = {hash:{},inverse:self.noop,fn:self.program(9, program9, data),data:data}; if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } if(stack1 || stack1 === 0) { buffer += stack1; } buffer += "\n "; - stack2 = helpers['if'].call(depth0, ((stack1 = depth0.urls),stack1 == null || stack1 === false ? stack1 : stack1.undelete), {hash:{},inverse:self.noop,fn:self.program(6, program6, data),data:data}); + stack2 = helpers['if'].call(depth0, ((stack1 = depth0.urls),stack1 == null || stack1 === false ? stack1 : stack1.undelete), {hash:{},inverse:self.noop,fn:self.program(11, program11, data),data:data}); if(stack2 || stack2 === 0) { buffer += stack2; } buffer += "\n"; return buffer; } -function program4(depth0,data) { +function program9(depth0,data) { return "This dataset has been deleted."; } -function program6(depth0,data) { +function program11(depth0,data) { var buffer = "", stack1, stack2; buffer += "\n " @@ -56,12 +88,12 @@ else { stack2 = depth0.id; stack2 = typeof stack2 === functionType ? stack2.apply(depth0) : stack2; } buffer += escapeExpression(stack2) + "\"\n target=\"galaxy_history\">here</a> to undelete it\n "; - stack2 = helpers['if'].call(depth0, ((stack1 = depth0.urls),stack1 == null || stack1 === false ? stack1 : stack1.purge), {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data}); + stack2 = helpers['if'].call(depth0, ((stack1 = depth0.urls),stack1 == null || stack1 === false ? stack1 : stack1.purge), {hash:{},inverse:self.noop,fn:self.program(12, program12, data),data:data}); if(stack2 || stack2 === 0) { buffer += stack2; } buffer += "\n "; return buffer; } -function program7(depth0,data) { +function program12(depth0,data) { var buffer = "", stack1, stack2; buffer += "\n or <a href=\"" @@ -74,21 +106,21 @@ return buffer; } -function program9(depth0,data) { +function program14(depth0,data) { var stack1, options; - options = {hash:{},inverse:self.noop,fn:self.program(10, program10, data),data:data}; + options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data}; if (stack1 = helpers.warningmessagesmall) { stack1 = stack1.call(depth0, options); } else { stack1 = depth0.warningmessagesmall; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } if (!helpers.warningmessagesmall) { stack1 = blockHelperMissing.call(depth0, stack1, options); } if(stack1 || stack1 === 0) { return stack1; } else { return ''; } } -function program10(depth0,data) { +function program15(depth0,data) { var buffer = "", stack1, options; buffer += "\n "; - options = {hash:{},inverse:self.noop,fn:self.program(11, program11, data),data:data}; + options = {hash:{},inverse:self.noop,fn:self.program(16, program16, data),data:data}; if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } @@ -96,44 +128,44 @@ buffer += "\n"; return buffer; } -function program11(depth0,data) { +function program16(depth0,data) { return "This dataset has been deleted and removed from disk."; } -function program13(depth0,data) { +function program18(depth0,data) { var stack1, options; - options = {hash:{},inverse:self.noop,fn:self.program(14, program14, data),data:data}; + options = {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data}; if (stack1 = helpers.warningmessagesmall) { stack1 = stack1.call(depth0, options); } else { stack1 = depth0.warningmessagesmall; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } if (!helpers.warningmessagesmall) { stack1 = blockHelperMissing.call(depth0, stack1, options); } if(stack1 || stack1 === 0) { return stack1; } else { return ''; } } -function program14(depth0,data) { +function program19(depth0,data) { var buffer = "", stack1, stack2, options; buffer += "\n "; - options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data}; + options = {hash:{},inverse:self.noop,fn:self.program(20, program20, data),data:data}; if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } if(stack1 || stack1 === 0) { buffer += stack1; } buffer += "\n "; - stack2 = helpers['if'].call(depth0, ((stack1 = depth0.urls),stack1 == null || stack1 === false ? stack1 : stack1.unhide), {hash:{},inverse:self.noop,fn:self.program(17, program17, data),data:data}); + stack2 = helpers['if'].call(depth0, ((stack1 = depth0.urls),stack1 == null || stack1 === false ? stack1 : stack1.unhide), {hash:{},inverse:self.noop,fn:self.program(22, program22, data),data:data}); if(stack2 || stack2 === 0) { buffer += stack2; } buffer += "\n"; return buffer; } -function program15(depth0,data) { +function program20(depth0,data) { return "This dataset has been hidden."; } -function program17(depth0,data) { +function program22(depth0,data) { var buffer = "", stack1, stack2; buffer += "\n Click <a href=\"" @@ -146,13 +178,16 @@ return buffer; } - stack1 = helpers['if'].call(depth0, depth0.deleted, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); + stack1 = helpers['if'].call(depth0, depth0.error, {hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data}); if(stack1 || stack1 === 0) { buffer += stack1; } buffer += "\n\n"; - stack1 = helpers['if'].call(depth0, depth0.purged, {hash:{},inverse:self.noop,fn:self.program(9, program9, data),data:data}); + stack1 = helpers['if'].call(depth0, depth0.deleted, {hash:{},inverse:self.noop,fn:self.program(6, program6, data),data:data}); if(stack1 || stack1 === 0) { buffer += stack1; } buffer += "\n\n"; - stack1 = helpers.unless.call(depth0, depth0.visible, {hash:{},inverse:self.noop,fn:self.program(13, program13, data),data:data}); + stack1 = helpers['if'].call(depth0, depth0.purged, {hash:{},inverse:self.noop,fn:self.program(14, program14, data),data:data}); + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n\n"; + stack1 = helpers.unless.call(depth0, depth0.visible, {hash:{},inverse:self.noop,fn:self.program(18, program18, data),data:data}); if(stack1 || stack1 === 0) { buffer += stack1; } return buffer; }); diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c static/scripts/templates/compiled/template-history-historyPanel.js --- a/static/scripts/templates/compiled/template-history-historyPanel.js +++ b/static/scripts/templates/compiled/template-history-historyPanel.js @@ -82,77 +82,49 @@ function program12(depth0,data) { var buffer = "", stack1, options; - buffer += "\n "; + buffer += "\n <div id=\"history-tag-annotation\">\n\n <div id=\"history-tag-area\" style=\"display: none\">\n <strong>"; options = {hash:{},inverse:self.noop,fn:self.program(13, program13, data),data:data}; - if (stack1 = helpers.warningmessagesmall) { stack1 = stack1.call(depth0, options); } - else { stack1 = depth0.warningmessagesmall; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } - if (!helpers.warningmessagesmall) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if(stack1 || stack1 === 0) { buffer += stack1; } - buffer += "\n "; - return buffer; - } -function program13(depth0,data) { - - var stack1, options; - options = {hash:{},inverse:self.noop,fn:self.program(14, program14, data),data:data}; if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if(stack1 || stack1 === 0) { return stack1; } - else { return ''; } - } -function program14(depth0,data) { - - - return "You are currently viewing a deleted history!"; - } - -function program16(depth0,data) { - - var buffer = "", stack1, options; - buffer += "\n <div id=\"history-tag-annotation\">\n\n <div id=\"history-tag-area\" style=\"display: none\">\n <strong>"; + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += ":</strong>\n <div class=\"tag-elt\"></div>\n </div>\n\n <div id=\"history-annotation-area\" style=\"display: none\">\n <strong>"; + options = {hash:{},inverse:self.noop,fn:self.program(15, program15, data),data:data}; + if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } + else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += ":</strong>\n <div id=\"history-annotation-container\">\n <div id=\"history-annotation\" class=\"tooltip editable-text\"\n title=\""; options = {hash:{},inverse:self.noop,fn:self.program(17, program17, data),data:data}; if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } if(stack1 || stack1 === 0) { buffer += stack1; } - buffer += ":</strong>\n <div class=\"tag-elt\"></div>\n </div>\n\n <div id=\"history-annotation-area\" style=\"display: none\">\n <strong>"; - options = {hash:{},inverse:self.noop,fn:self.program(19, program19, data),data:data}; - if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } - else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } - if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if(stack1 || stack1 === 0) { buffer += stack1; } - buffer += ":</strong>\n <div id=\"history-annotation-container\">\n <div id=\"history-annotation\" class=\"tooltip editable-text\"\n title=\""; - options = {hash:{},inverse:self.noop,fn:self.program(21, program21, data),data:data}; - if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } - else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } - if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if(stack1 || stack1 === 0) { buffer += stack1; } buffer += "\">\n "; - stack1 = helpers['if'].call(depth0, depth0.annotation, {hash:{},inverse:self.program(25, program25, data),fn:self.program(23, program23, data),data:data}); + stack1 = helpers['if'].call(depth0, depth0.annotation, {hash:{},inverse:self.program(21, program21, data),fn:self.program(19, program19, data),data:data}); if(stack1 || stack1 === 0) { buffer += stack1; } buffer += "\n </div>\n </div>\n </div>\n </div>\n "; return buffer; } -function program17(depth0,data) { +function program13(depth0,data) { return "Tags"; } -function program19(depth0,data) { +function program15(depth0,data) { return "Annotation"; } -function program21(depth0,data) { +function program17(depth0,data) { return "Click to edit annotation"; } -function program23(depth0,data) { +function program19(depth0,data) { var buffer = "", stack1; buffer += "\n "; @@ -163,11 +135,11 @@ return buffer; } -function program25(depth0,data) { +function program21(depth0,data) { var buffer = "", stack1, options; buffer += "\n <em>"; - options = {hash:{},inverse:self.noop,fn:self.program(26, program26, data),data:data}; + options = {hash:{},inverse:self.noop,fn:self.program(22, program22, data),data:data}; if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } @@ -175,10 +147,38 @@ buffer += "</em>\n "; return buffer; } +function program22(depth0,data) { + + + return "Describe or add notes to history"; + } + +function program24(depth0,data) { + + var buffer = "", stack1, options; + buffer += "\n "; + options = {hash:{},inverse:self.noop,fn:self.program(25, program25, data),data:data}; + if (stack1 = helpers.warningmessagesmall) { stack1 = stack1.call(depth0, options); } + else { stack1 = depth0.warningmessagesmall; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if (!helpers.warningmessagesmall) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if(stack1 || stack1 === 0) { buffer += stack1; } + buffer += "\n "; + return buffer; + } +function program25(depth0,data) { + + var stack1, options; + options = {hash:{},inverse:self.noop,fn:self.program(26, program26, data),data:data}; + if (stack1 = helpers.local) { stack1 = stack1.call(depth0, options); } + else { stack1 = depth0.local; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } + if (!helpers.local) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if(stack1 || stack1 === 0) { return stack1; } + else { return ''; } + } function program26(depth0,data) { - return "Describe or add notes to history"; + return "You are currently viewing a deleted history!"; } function program28(depth0,data) { @@ -188,11 +188,11 @@ if (stack1 = helpers.status) { stack1 = stack1.call(depth0, {hash:{},data:data}); } else { stack1 = depth0.status; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } buffer += escapeExpression(stack1) - + "message\">\n "; + + "message\">"; if (stack1 = helpers.message) { stack1 = stack1.call(depth0, {hash:{},data:data}); } else { stack1 = depth0.message; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; } buffer += escapeExpression(stack1) - + "\n </div><br />\n </div>\n "; + + "</div>\n </div>\n "; return buffer; } @@ -208,7 +208,7 @@ return "Your history is empty. Click 'Get Data' on the left pane to start"; } - buffer += "<div id=\"history-controls\">\n <div id=\"history-title-area\" class=\"historyLinks\">\n\n " + buffer += "<div id=\"history-controls\">\n\n <div id=\"history-title-area\" class=\"historyLinks\">\n " + "\n <div id=\"history-name-container\">\n " + "\n "; stack2 = helpers['if'].call(depth0, ((stack1 = depth0.user),stack1 == null || stack1 === false ? stack1 : stack1.email), {hash:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),data:data}); @@ -220,13 +220,13 @@ + "</div>\n\n <div id=\"history-secondary-links\" style=\"float: right;\">\n "; stack2 = helpers['if'].call(depth0, ((stack1 = depth0.user),stack1 == null || stack1 === false ? stack1 : stack1.email), {hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data}); if(stack2 || stack2 === 0) { buffer += stack2; } - buffer += "\n </div>\n <div style=\"clear: both;\"></div>\n </div>\n\n "; - stack2 = helpers['if'].call(depth0, depth0.deleted, {hash:{},inverse:self.noop,fn:self.program(12, program12, data),data:data}); - if(stack2 || stack2 === 0) { buffer += stack2; } - buffer += "\n\n " + buffer += "\n </div>\n <div style=\"clear: both;\"></div>\n </div>\n\n " + "\n " + "\n "; - stack2 = helpers['if'].call(depth0, ((stack1 = depth0.user),stack1 == null || stack1 === false ? stack1 : stack1.email), {hash:{},inverse:self.noop,fn:self.program(16, program16, data),data:data}); + stack2 = helpers['if'].call(depth0, ((stack1 = depth0.user),stack1 == null || stack1 === false ? stack1 : stack1.email), {hash:{},inverse:self.noop,fn:self.program(12, program12, data),data:data}); + if(stack2 || stack2 === 0) { buffer += stack2; } + buffer += "\n\n "; + stack2 = helpers['if'].call(depth0, depth0.deleted, {hash:{},inverse:self.noop,fn:self.program(24, program24, data),data:data}); if(stack2 || stack2 === 0) { buffer += stack2; } buffer += "\n\n "; stack2 = helpers['if'].call(depth0, depth0.message, {hash:{},inverse:self.noop,fn:self.program(28, program28, data),data:data}); diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c static/scripts/templates/hda-templates.html --- a/static/scripts/templates/hda-templates.html +++ b/static/scripts/templates/hda-templates.html @@ -1,5 +1,12 @@ <!-- ---------------------------------------------------------------------- WARNING BOXES --><script type="text/template" class="template-hda" id="template-hda-warning-messages"> +{{#if error}} +<div class="errormessagesmall"> + {{#local}}There was an error getting the data for this dataset{{/local}}: + {{#local}}{{error}}{{/local}} +</div> +{{/if}} + {{#if deleted}}{{#unless purged}} {{#warningmessagesmall}} {{#local}}This dataset has been deleted.{{/local}} diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c static/scripts/templates/history-templates.html --- a/static/scripts/templates/history-templates.html +++ b/static/scripts/templates/history-templates.html @@ -3,8 +3,8 @@ --><script type="text/template" class="template-history" id="template-history-historyPanel"><div id="history-controls"> + <div id="history-title-area" class="historyLinks"> - {{! history name (if any) }} <div id="history-name-container"> {{! TODO: factor out conditional css }} @@ -32,10 +32,6 @@ <div style="clear: both;"></div></div> - {{#if deleted}} - {{#warningmessagesmall}}{{#local}}You are currently viewing a deleted history!{{/local}}{{/warningmessagesmall}} - {{/if}} - {{! tags and annotations }} {{! TODO: move inline styles out }} {{#if user.email}} @@ -62,11 +58,13 @@ </div> {{/if}} + {{#if deleted}} + {{#warningmessagesmall}}{{#local}}You are currently viewing a deleted history!{{/local}}{{/warningmessagesmall}} + {{/if}} + {{#if message}} <div id="message-container"> - <div class="{{status}}message"> - {{message}} - </div><br /> + <div class="{{status}}message">{{message}}</div></div> {{/if}} diff -r 6d1e0123ffef00c0f1de717d31dfc350bf9027ce -r 9a0d3c0735d7a6bccbe214f2c209a97a2df3831c templates/webapps/galaxy/root/history.mako --- a/templates/webapps/galaxy/root/history.mako +++ b/templates/webapps/galaxy/root/history.mako @@ -174,18 +174,8 @@ ${ unquote_plus( h.to_json_string( url_dict ) ) } </%def> + ## ----------------------------------------------------------------------------- -<%def name="get_history_json( history )"> -<% - try: - return h.to_json_string( history ) - except TypeError, type_err: - log.error( 'Could not serialize history' ) - log.debug( 'history data: %s', str( history ) ) - return '{}' -%> -</%def> - <%def name="get_current_user()"><% user_json = trans.webapp.api_controllers[ 'users' ].show( trans, 'current' ) @@ -193,17 +183,6 @@ %></%def> -<%def name="get_hda_json( hdas )"> -<% - try: - return h.to_json_string( hdas ) - except TypeError, type_err: - log.error( 'Could not serialize hdas for history: %s', history['id'] ) - log.debug( 'hda data: %s', str( hdas ) ) - return '{}' -%> -</%def> - ## ----------------------------------------------------------------------------- <%def name="javascripts()"> @@ -242,6 +221,10 @@ )} <script type="text/javascript"> +function modalAsAlert( title, body, buttons ){ + alert( title + ':\n' + body ); +} + function galaxyPageSetUp(){ // moving global functions, objects into Galaxy namespace top.Galaxy = top.Galaxy || {}; @@ -258,8 +241,8 @@ top.Galaxy.$rightPanel = top.Galaxy.$rightPanel || $( top.document ).find( 'div#right' ); //modals - top.Galaxy.show_modal = top.show_modal; - top.Galaxy.hide_modal = top.hide_modal; + top.Galaxy.show_modal = top.show_modal || modalAsAlert; + top.Galaxy.hide_modal = top.hide_modal || function(){}; // other base functions @@ -288,6 +271,7 @@ // 1. load history panel in own tab // 2. from console: new PersistantStorage( '__history_panel' ).set( 'debugging', true ) // -> history panel and hdas will display console logs in console + var debugging = false; if( jQuery.jStorage.get( '__history_panel' ) ){ debugging = new PersistantStorage( '__history_panel' ).get( 'debugging' ); @@ -299,29 +283,35 @@ var page_show_deleted = ${ 'true' if show_deleted == True else ( 'null' if show_deleted == None else 'false' ) }, page_show_hidden = ${ 'true' if show_hidden == True else ( 'null' if show_hidden == None else 'false' ) }, - user = ${ get_current_user() }, - history = ${ get_history_json( history_dictionary ) }, - hdas = ${ get_hda_json( hda_dictionaries ) }; + userJson = ${ get_current_user() }, + historyJson = ${ history_json }, + hdaJson = ${ hda_json }; + + // set up messages passed in + %if message: + historyJson.message = "${_( message )}"; historyJson.status = "${status}"; + %endif // add user data to history // i don't like this history+user relationship, but user authentication changes views/behaviour - history.user = user; + historyJson.user = userJson; // create the history panel + var history = new History( historyJson, hdaJson ); var historyPanel = new HistoryPanel({ - model : new History( history, hdas ), - urlTemplates : galaxy_paths.attributes, - logger : ( debugging )?( console ):( null ), - // is page sending in show settings? if so override history's - show_deleted : page_show_deleted, - show_hidden : page_show_hidden - }); + model : history, + urlTemplates : galaxy_paths.attributes, + logger : ( debugging )?( console ):( null ), + // is page sending in show settings? if so override history's + show_deleted : page_show_deleted, + show_hidden : page_show_hidden + }); historyPanel.render(); // set it up to be accessible across iframes //TODO:?? mem leak top.Galaxy.currHistoryPanel = historyPanel; - var currUser = new User( user ); + var currUser = new User( userJson ); if( !Galaxy.currUser ){ Galaxy.currUser = currUser; } // QUOTA METER is a cross-frame ui element (meter in masthead, over quota message in history) @@ -451,19 +441,25 @@ )} <style> ## TODO: move to base.less - .historyItemBody { - display: none; + /*---- page level */ + .warningmessagesmall { + margin: 8px 0 0 0; + } + #message-container { + margin: 8px 0 0 0; + } + #message-container [class$="message"] { + margin: 0px; } + /*---- history level */ #history-controls { - /*border: 1px solid white;*/ margin-bottom: 5px; padding: 5px; } #history-title-area { margin: 0px 0px 5px 0px; - /*border: 1px solid red;*/ } #history-name { word-wrap: break-word; @@ -477,7 +473,6 @@ width: 90%; margin: -2px 0px -3px -4px; font-weight: bold; - /*color: gray;*/ } #quota-message-container { @@ -488,14 +483,12 @@ } #history-subtitle-area { - /*border: 1px solid green;*/ } #history-size { } #history-secondary-links { } - /*why this is getting underlined is beyond me*/ #history-secondary-links #history-refresh { text-decoration: none; } @@ -508,6 +501,19 @@ margin: 10px 0px 10px 0px; } + /*---- HDA level */ + .historyItem div.errormessagesmall { + font-size: small; + margin: 0px 0px 4px 0px; + } + .historyItem div.warningmessagesmall { + font-size: small; + margin: 0px 0px 4px 0px; + } + .historyItemBody { + display: none; + } + .historyItemTitle { text-decoration: underline; cursor: pointer; Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org