diff --git a/static/scripts/mvc/dataset/hda-base.js b/static/scripts/mvc/dataset/hda-base.js new file mode 100644 index 00000000000..ab1be5ff311 --- /dev/null +++ b/static/scripts/mvc/dataset/hda-base.js @@ -0,0 +1,447 @@ +//define([ +// "../mvc/base-mvc" +//], function(){ +//============================================================================== +/** read only view for HistoryDatasetAssociations + * + */ +var HDABaseView = BaseView.extend( LoggableMixin ).extend({ + //??TODO: add alias in initialize this.hda = this.model? + // view for HistoryDatasetAssociation model above + + // uncomment this out see log messages + //logger : console, + + tagName : "div", + className : "historyItemContainer", + + // ................................................................................ SET UP + initialize : function( attributes ){ + this.log( this + '.initialize:', attributes ); + + // which buttons go in most states (ok/failed meta are more complicated) + this.defaultPrimaryActionButtonRenderers = [ + this._render_showParamsButton + ]; + + // render urlTemplates (gen. provided by GalaxyPaths) to urls + if( !attributes.urlTemplates ){ throw( 'HDAView needs urlTemplates on initialize' ); } + this.urls = this.renderUrls( attributes.urlTemplates, this.model.toJSON() ); + + // whether the body of this hda is expanded (shown) + this.expanded = attributes.expanded || false; + + // re-render the entire view on any model change + this.model.bind( 'change', this.render, this ); + //this.bind( 'all', function( event ){ + // this.log( event ); + //}, this ); + }, + + // urlTemplates is a map (or nested map) of underscore templates (currently, anyhoo) + // use the templates to create the apropo urls for each action this ds could use + renderUrls : function( urlTemplates, modelJson ){ + var hdaView = this, + urls = {}; + _.each( urlTemplates, function( urlTemplateOrObj, urlKey ){ + // object == nested templates: recurse + if( _.isObject( urlTemplateOrObj ) ){ + urls[ urlKey ] = hdaView.renderUrls( urlTemplateOrObj, modelJson ); + + // string == template: + } else { + // meta_down load is a special case (see renderMetaDownloadUrls) + //TODO: should be a better (gen.) way to handle this case + if( urlKey === 'meta_download' ){ + urls[ urlKey ] = hdaView.renderMetaDownloadUrls( urlTemplateOrObj, modelJson ); + } else { + urls[ urlKey ] = _.template( urlTemplateOrObj, modelJson ); + } + } + }); + return urls; + }, + + // there can be more than one meta_file to download, so return a list of url and file_type for each + renderMetaDownloadUrls : function( urlTemplate, modelJson ){ + return _.map( modelJson.meta_files, function( meta_file ){ + return { + url : _.template( urlTemplate, { id: modelJson.id, file_type: meta_file.file_type }), + file_type : meta_file.file_type + }; + }); + }, + + // ................................................................................ RENDER MAIN + // events: rendered, rendered:ready, rendered:initial, rendered:ready:initial + render : function(){ + var view = this, + id = this.model.get( 'id' ), + state = this.model.get( 'state' ), + itemWrapper = $( '
' ).attr( 'id', 'historyItem-' + id ), + initialRender = ( this.$el.children().size() === 0 ); + + //console.debug( this + '.render, initial?:', initialRender ); + this.$el.attr( 'id', 'historyItemContainer-' + id ); + + itemWrapper + .addClass( 'historyItemWrapper' ).addClass( 'historyItem' ) + .addClass( 'historyItem-' + state ); + + itemWrapper.append( this._render_warnings() ); + itemWrapper.append( this._render_titleBar() ); + this.body = $( this._render_body() ); + itemWrapper.append( this.body ); + + //TODO: move to own function: setUpBehaviours + // we can potentially skip this step and call popupmenu directly on the download button + make_popup_menus( itemWrapper ); + + // set up canned behavior on children (bootstrap, popupmenus, editable_text, etc.) + itemWrapper.find( '.tooltip' ).tooltip({ placement : 'bottom' }); + + // transition... + this.$el.fadeOut( 'fast', function(){ + view.$el.children().remove(); + view.$el.append( itemWrapper ).fadeIn( 'fast', function(){ + view.log( view + ' rendered:', view.$el ); + + var renderedEventName = 'rendered'; + if( initialRender ){ + renderedEventName += ':initial'; + } else if( view.model.inReadyState() ){ + renderedEventName += ':ready'; + } + view.trigger( renderedEventName ); + }); + }); + return this; + }, + + // ................................................................................ RENDER WARNINGS + // hda warnings including: is deleted, is purged, is hidden (including links to further actions (undelete, etc.)) + _render_warnings : function(){ + // jQ errs on building dom with whitespace - if there are no messages, trim -> '' + return $( jQuery.trim( HDABaseView.templates.messages( this.model.toJSON() ))); + }, + + // ................................................................................ RENDER TITLEBAR + // the part of an hda always shown (whether the body is expanded or not): title link, title buttons + _render_titleBar : function(){ + var titleBar = $( '
' ); + titleBar.append( this._render_titleButtons() ); + titleBar.append( '' ); + titleBar.append( this._render_titleLink() ); + return titleBar; + }, + + // ................................................................................ display, edit attr, delete + // icon-button group for the common, most easily accessed actions + //NOTE: these are generally displayed for almost every hda state (tho poss. disabled) + _render_titleButtons : function(){ + // render the display, edit attr and delete icon-buttons + var buttonDiv = $( '
' ); + buttonDiv.append( this._render_displayButton() ); + return buttonDiv; + }, + + // icon-button to display this hda in the galaxy main iframe + _render_displayButton : function(){ + // don't show display if not in ready state, error'd, or not accessible + if( ( !this.model.inReadyState() ) + || ( this.model.get( 'state' ) === HistoryDatasetAssociation.STATES.ERROR ) + || ( this.model.get( 'state' ) === HistoryDatasetAssociation.STATES.NOT_VIEWABLE ) + || ( !this.model.get( 'accessible' ) ) ){ + this.displayButton = null; + return null; + } + + var displayBtnData = { + icon_class : 'display', + target : 'galaxy_main' + }; + + // show a disabled display if the data's been purged + if( this.model.get( 'purged' ) ){ + displayBtnData.enabled = false; + displayBtnData.title = _l( 'Cannot display datasets removed from disk' ); + + } else { + displayBtnData.title = _l( 'Display data in browser' ); + displayBtnData.href = this.urls.display; + } + + this.displayButton = new IconButtonView({ model : new IconButton( displayBtnData ) }); + return this.displayButton.render().$el; + }, + + // ................................................................................ titleLink + // render the hid and hda.name as a link (that will expand the body) + _render_titleLink : function(){ + return $( jQuery.trim( HDABaseView.templates.titleLink( + _.extend( this.model.toJSON(), { urls: this.urls } ) + ))); + }, + + // ................................................................................ RENDER BODY + // render the data/metadata summary (format, size, misc info, etc.) + _render_hdaSummary : function(){ + var modelData = _.extend( this.model.toJSON(), { urls: this.urls } ); + return HDABaseView.templates.hdaSummary( modelData ); + }, + + // ................................................................................ primary actions + // render the icon-buttons gen. placed underneath the hda summary + _render_primaryActionButtons : function( buttonRenderingFuncs ){ + var view = this, + primaryActionButtons = $( '
' ).attr( 'id', 'primary-actions-' + this.model.get( 'id' ) ); + _.each( buttonRenderingFuncs, function( fn ){ + primaryActionButtons.append( fn.call( view ) ); + }); + return primaryActionButtons; + }, + + // icon-button/popupmenu to down the data (and/or the associated meta files (bai, etc.)) for this hda + _render_downloadButton : function(){ + // don't show anything if the data's been purged + if( this.model.get( 'purged' ) || !this.model.hasData() ){ return null; } + + // return either: a single download icon-button (if there are no meta files) + // or a popupmenu with links to download assoc. meta files (if there are meta files) + var downloadLinkHTML = HDABaseView.templates.downloadLinks( + _.extend( this.model.toJSON(), { urls: this.urls } ) + ); + //this.log( this + '_render_downloadButton, downloadLinkHTML:', downloadLinkHTML ); + return $( downloadLinkHTML ); + }, + + // icon-button to show the input and output (stdout/err) for the job that created this hda + _render_showParamsButton : function(){ + // gen. safe to show in all cases + this.showParamsButton = new IconButtonView({ model : new IconButton({ + title : _l( 'View details' ), + href : this.urls.show_params, + target : 'galaxy_main', + icon_class : 'information' + }) }); + return this.showParamsButton.render().$el; + }, + + // ................................................................................ other elements + // render links to external genome display applications (igb, gbrowse, etc.) + //TODO: not a fan of the style on these + _render_displayApps : function(){ + if( !this.model.hasData() ){ return null; } + + var displayAppsDiv = $( '
' ).addClass( 'display-apps' ); + if( !_.isEmpty( this.model.get( 'display_types' ) ) ){ + //this.log( this + 'display_types:', this.model.get( 'urls' ).display_types ); + //TODO:?? does this ever get used? + displayAppsDiv.append( + HDABaseView.templates.displayApps({ displayApps : this.model.get( 'display_types' ) }) + ); + } + if( !_.isEmpty( this.model.get( 'display_apps' ) ) ){ + //this.log( this + 'display_apps:', this.model.get( 'urls' ).display_apps ); + displayAppsDiv.append( + HDABaseView.templates.displayApps({ displayApps : this.model.get( 'display_apps' ) }) + ); + } + return displayAppsDiv; + }, + + // render the data peek + //TODO: curr. pre-formatted into table on the server side - may not be ideal/flexible + _render_peek : function(){ + if( !this.model.get( 'peek' ) ){ return null; } + return $( '
' ).append( + $( '
' )
+                .attr( 'id', 'peek' + this.model.get( 'id' ) )
+                .addClass( 'peek' )
+                .append( this.model.get( 'peek' ) )
+        );
+    },
+    
+    // ................................................................................ state body renderers
+    // _render_body fns for the various states
+    //TODO: only render these on expansion (or already expanded)
+    _render_body_not_viewable : function( parent ){
+        //TODO: revisit - still showing display, edit, delete (as common) - that CAN'T be right
+        parent.append( $( '
' + _l( 'You do not have permission to view dataset' ) + '.
' ) ); + }, + + _render_body_uploading : function( parent ){ + parent.append( $( '
' + _l( 'Dataset is uploading' ) + '
' ) ); + }, + + _render_body_queued : function( parent ){ + parent.append( $( '
' + _l( 'Job is waiting to run' ) + '.
' ) ); + parent.append( this._render_primaryActionButtons( this.defaultPrimaryActionButtonRenderers )); + }, + + _render_body_running : function( parent ){ + parent.append( '
' + _l( 'Job is currently running' ) + '.
' ); + parent.append( this._render_primaryActionButtons( this.defaultPrimaryActionButtonRenderers )); + }, + + _render_body_error : function( parent ){ + if( !this.model.get( 'purged' ) ){ + parent.append( $( '
' + this.model.get( 'misc_blurb' ) + '
' ) ); + } + parent.append( ( _l( 'An error occurred running this job' ) + ': ' + + '' + $.trim( this.model.get( 'misc_info' ) ) + '' ) ); + parent.append( this._render_primaryActionButtons( + this.defaultPrimaryActionButtonRenderers.concat([ this._render_downloadButton ]) + )); + }, + + _render_body_discarded : function( parent ){ + parent.append( '
' + _l( 'The job creating this dataset was cancelled before completion' ) + '.
' ); + parent.append( this._render_primaryActionButtons( this.defaultPrimaryActionButtonRenderers )); + }, + + _render_body_setting_metadata : function( parent ){ + parent.append( $( '
' + _l( 'Metadata is being auto-detected' ) + '.
' ) ); + }, + + _render_body_empty : function( parent ){ + //TODO: replace i with dataset-misc-info class + //?? why are we showing the file size when we know it's zero?? + parent.append( $( '
' + _l( 'No data' ) + ': ' + this.model.get( 'misc_blurb' ) + '
' ) ); + parent.append( this._render_primaryActionButtons( this.defaultPrimaryActionButtonRenderers )); + }, + + _render_body_failed_metadata : function( parent ){ + //TODO: the css for this box is broken (unlike the others) + // add a message box about the failure at the top of the body... + parent.append( $( HDABaseView.templates.failedMetadata( this.model.toJSON() ) ) ); + //...then render the remaining body as STATES.OK (only diff between these states is the box above) + this._render_body_ok( parent ); + }, + + _render_body_ok : function( parent ){ + // most common state renderer and the most complicated + parent.append( this._render_hdaSummary() ); + + // return shortened form if del'd + //TODO: is this correct? maybe only on purged + if( this.model.isDeletedOrPurged() ){ + parent.append( this._render_primaryActionButtons([ + this._render_downloadButton, + this._render_showParamsButton + ])); + return; + } + + //NOTE: change the order here + parent.append( this._render_primaryActionButtons([ + this._render_downloadButton, + this._render_showParamsButton + ])); + parent.append( '
' ); + + parent.append( this._render_displayApps() ); + parent.append( this._render_peek() ); + }, + + _render_body : function(){ + //this.log( this + '_render_body' ); + + var body = $( '
' ) + .attr( 'id', 'info-' + this.model.get( 'id' ) ) + .addClass( 'historyItemBody' ) + .attr( 'style', 'display: block' ); + + //TODO: not a fan of this dispatch + switch( this.model.get( 'state' ) ){ + case HistoryDatasetAssociation.STATES.NOT_VIEWABLE : + this._render_body_not_viewable( body ); + break; + case HistoryDatasetAssociation.STATES.UPLOAD : + this._render_body_uploading( body ); + break; + case HistoryDatasetAssociation.STATES.QUEUED : + this._render_body_queued( body ); + break; + case HistoryDatasetAssociation.STATES.RUNNING : + this._render_body_running( body ); + break; + case HistoryDatasetAssociation.STATES.ERROR : + this._render_body_error( body ); + break; + case HistoryDatasetAssociation.STATES.DISCARDED : + this._render_body_discarded( body ); + break; + case HistoryDatasetAssociation.STATES.SETTING_METADATA : + this._render_body_setting_metadata( body ); + break; + case HistoryDatasetAssociation.STATES.EMPTY : + this._render_body_empty( body ); + break; + case HistoryDatasetAssociation.STATES.FAILED_METADATA : + this._render_body_failed_metadata( body ); + break; + case HistoryDatasetAssociation.STATES.OK : + this._render_body_ok( body ); + break; + default: + //??: no body? + body.append( $( '
Error: unknown dataset state "' + state + '".
' ) ); + } + body.append( '
' ); + + if( this.expanded ){ + body.show(); + } else { + body.hide(); + } + return body; + }, + + // ................................................................................ EVENTS + events : { + 'click .historyItemTitle' : 'toggleBodyVisibility' + }, + + // expand/collapse body + // event: body-visible, body-hidden + toggleBodyVisibility : function( event, expanded ){ + var hdaView = this, + $body = this.$el.find( '.historyItemBody' ); + expanded = ( expanded === undefined )?( !$body.is( ':visible' ) ):( expanded ); + //this.log( 'toggleBodyVisibility, expanded:', expanded, '$body:', $body ); + + if( expanded ){ + $body.slideDown( 'fast', function(){ + hdaView.trigger( 'body-visible', hdaView.model.get( 'id' ) ); + }); + } else { + $body.slideUp( 'fast', function(){ + hdaView.trigger( 'body-hidden', hdaView.model.get( 'id' ) ); + }); + } + }, + + // ................................................................................ UTILTIY + toString : function(){ + var modelString = ( this.model )?( this.model + '' ):( '(no model)' ); + return 'HDABaseView(' + modelString + ')'; + } +}); + +//------------------------------------------------------------------------------ +HDABaseView.templates = { + warningMsg : Handlebars.templates[ 'template-warningmessagesmall' ], + + messages : Handlebars.templates[ 'template-hda-warning-messages' ], + titleLink : Handlebars.templates[ 'template-hda-titleLink' ], + hdaSummary : Handlebars.templates[ 'template-hda-hdaSummary' ], + downloadLinks : Handlebars.templates[ 'template-hda-downloadLinks' ], + failedMetadata : Handlebars.templates[ 'template-hda-failedMetaData' ], + displayApps : Handlebars.templates[ 'template-hda-displayApps' ] +}; + +//============================================================================== +//return { +// HDABaseView : HDABaseView, +//};}); diff --git a/static/scripts/mvc/dataset/hda-edit.js b/static/scripts/mvc/dataset/hda-edit.js index 049e77975cf..2ffdbc6a973 100644 --- a/static/scripts/mvc/dataset/hda-edit.js +++ b/static/scripts/mvc/dataset/hda-edit.js @@ -2,155 +2,32 @@ // "../mvc/base-mvc" //], function(){ //============================================================================== -/** View for editing (working with - as opposed to viewing/read-only) an hda +/** editing view for HistoryDatasetAssociations * */ -var HDAView = BaseView.extend( LoggableMixin ).extend({ - //??TODO: add alias in initialize this.hda = this.model? - // view for HistoryDatasetAssociation model above +var HDAEditView = HDABaseView.extend({ - // uncomment this out see log messages - //logger : console, - - tagName : "div", - className : "historyItemContainer", - // ................................................................................ SET UP initialize : function( attributes ){ - this.log( this + '.initialize:', attributes ); + HDABaseView.prototype.initialize.call( this, attributes ); - // render urlTemplates (gen. provided by GalaxyPaths) to urls - if( !attributes.urlTemplates ){ throw( 'HDAView needs urlTemplates on initialize' ); } - this.urls = this.renderUrls( attributes.urlTemplates, this.model.toJSON() ); - - // whether the body of this hda is expanded (shown) - this.expanded = attributes.expanded || false; - - // re-render the entire view on any model change - this.model.bind( 'change', this.render, this ); - //this.bind( 'all', function( event ){ - // this.log( event ); - //}, this ); - }, - - // urlTemplates is a map (or nested map) of underscore templates (currently, anyhoo) - // use the templates to create the apropo urls for each action this ds could use - renderUrls : function( urlTemplates, modelJson ){ - var hdaView = this, - urls = {}; - _.each( urlTemplates, function( urlTemplateOrObj, urlKey ){ - // object == nested templates: recurse - if( _.isObject( urlTemplateOrObj ) ){ - urls[ urlKey ] = hdaView.renderUrls( urlTemplateOrObj, modelJson ); - - // string == template: - } else { - // meta_down load is a special case (see renderMetaDownloadUrls) - //TODO: should be a better (gen.) way to handle this case - if( urlKey === 'meta_download' ){ - urls[ urlKey ] = hdaView.renderMetaDownloadUrls( urlTemplateOrObj, modelJson ); - } else { - urls[ urlKey ] = _.template( urlTemplateOrObj, modelJson ); - } - } - }); - return urls; + // which buttons go in most states (ok/failed meta are more complicated) + // HDAEdit gets the rerun button on almost all states + this.defaultPrimaryActionButtonRenderers = [ + this._render_showParamsButton, + this._render_rerunButton + ]; }, - // there can be more than one meta_file to download, so return a list of url and file_type for each - renderMetaDownloadUrls : function( urlTemplate, modelJson ){ - return _.map( modelJson.meta_files, function( meta_file ){ - return { - url : _.template( urlTemplate, { id: modelJson.id, file_type: meta_file.file_type }), - file_type : meta_file.file_type - }; - }); - }, - - // ................................................................................ RENDER MAIN - // events: rendered, rendered:ready, rendered:initial, rendered:ready:initial - render : function(){ - var view = this, - id = this.model.get( 'id' ), - state = this.model.get( 'state' ), - itemWrapper = $( '
' ).attr( 'id', 'historyItem-' + id ), - initialRender = ( this.$el.children().size() === 0 ); - - //console.debug( this + '.render, initial?:', initialRender ); - - this._clearReferences(); - this.$el.attr( 'id', 'historyItemContainer-' + id ); - - itemWrapper - .addClass( 'historyItemWrapper' ).addClass( 'historyItem' ) - .addClass( 'historyItem-' + state ); - - itemWrapper.append( this._render_warnings() ); - itemWrapper.append( this._render_titleBar() ); - this.body = $( this._render_body() ); - itemWrapper.append( this.body ); - - //TODO: move to own function: setUpBehaviours - // we can potentially skip this step and call popupmenu directly on the download button - make_popup_menus( itemWrapper ); - - // set up canned behavior on children (bootstrap, popupmenus, editable_text, etc.) - itemWrapper.find( '.tooltip' ).tooltip({ placement : 'bottom' }); - - // transition... - this.$el.fadeOut( 'fast', function(){ - view.$el.children().remove(); - view.$el.append( itemWrapper ).fadeIn( 'fast', function(){ - view.log( view + ' rendered:', view.$el ); - - var renderedEventName = 'rendered'; - if( initialRender ){ - renderedEventName += ':initial'; - } else if( view.model.inReadyState() ){ - renderedEventName += ':ready'; - } - view.trigger( renderedEventName ); - }); - }); - return this; - }, - - //NOTE: button renderers have the side effect of caching their IconButtonViews to this view - // clear out cached sub-views, dom refs, etc. from prev. render - _clearReferences : function(){ - //??TODO: we should reset these in the button logic checks (i.e. if not needed this.button = null; return null) - //?? do we really need these - not so far - //TODO: at least move these to a map - this.displayButton = null; - this.editButton = null; - this.deleteButton = null; - this.errButton = null; - this.showParamsButton = null; - this.rerunButton = null; - this.visualizationsButton = null; - this.tagButton = null; - this.annotateButton = null; - }, - // ................................................................................ RENDER WARNINGS // hda warnings including: is deleted, is purged, is hidden (including links to further actions (undelete, etc.)) _render_warnings : function(){ // jQ errs on building dom with whitespace - if there are no messages, trim -> '' - return $( jQuery.trim( HDAView.templates.messages( + return $( jQuery.trim( HDABaseView.templates.messages( _.extend( this.model.toJSON(), { urls: this.urls } ) ))); }, - // ................................................................................ RENDER TITLEBAR - // the part of an hda always shown (whether the body is expanded or not): title link, title buttons - _render_titleBar : function(){ - var titleBar = $( '
' ); - titleBar.append( this._render_titleButtons() ); - titleBar.append( '' ); - titleBar.append( this._render_titleLink() ); - return titleBar; - }, - // ................................................................................ display, edit attr, delete // icon-button group for the common, most easily accessed actions //NOTE: these are generally displayed for almost every hda state (tho poss. disabled) @@ -163,46 +40,16 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ return buttonDiv; }, - // icon-button to display this hda in the galaxy main iframe - _render_displayButton : function(){ - // don't show display if not in ready state, error'd, or not accessible - if( ( !this.model.inReadyState() ) - || ( this.model.get( 'state' ) === HistoryDatasetAssociation.STATES.ERROR ) - || ( this.model.get( 'state' ) === HistoryDatasetAssociation.STATES.NOT_VIEWABLE ) - || ( !this.model.get( 'accessible' ) ) ){ - return null; - } - - var displayBtnData = { - icon_class : 'display' - }; - - // show a disabled display if the data's been purged - if( this.model.get( 'purged' ) ){ - displayBtnData.enabled = false; - displayBtnData.title = _l( 'Cannot display datasets removed from disk' ); - - } else { - displayBtnData.title = _l( 'Display data in browser' ); - displayBtnData.href = this.urls.display; - } - - if( this.model.get( 'for_editing' ) ){ - displayBtnData.target = 'galaxy_main'; - } - - this.displayButton = new IconButtonView({ model : new IconButton( displayBtnData ) }); - return this.displayButton.render().$el; - }, - // icon-button to edit the attributes (format, permissions, etc.) this hda _render_editButton : function(){ - // don't show edit while uploading, or if editable + // don't show edit while uploading + //TODO??: error? + //TODO??: not viewable/accessible are essentially the same (not viewable set from accessible) if( ( this.model.get( 'state' ) === HistoryDatasetAssociation.STATES.UPLOAD ) || ( this.model.get( 'state' ) === HistoryDatasetAssociation.STATES.ERROR ) || ( this.model.get( 'state' ) === HistoryDatasetAssociation.STATES.NOT_VIEWABLE ) - || ( !this.model.get( 'accessible' ) ) - || ( !this.model.get( 'for_editing' ) ) ){ + || ( !this.model.get( 'accessible' ) ) ){ + this.editButton = null; return null; } @@ -216,7 +63,6 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ }; // disable if purged or deleted and explain why in the tooltip - //TODO: if for_editing if( deleted || purged ){ editBtnData.enabled = false; if( purged ){ @@ -233,9 +79,10 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ // icon-button to delete this hda _render_deleteButton : function(){ // don't show delete if... - if( ( !this.model.get( 'for_editing' ) ) - || ( this.model.get( 'state' ) === HistoryDatasetAssociation.STATES.NOT_VIEWABLE ) + //TODO??: not viewable/accessible are essentially the same (not viewable set from accessible) + if( ( this.model.get( 'state' ) === HistoryDatasetAssociation.STATES.NOT_VIEWABLE ) || ( !this.model.get( 'accessible' ) ) ){ + this.deleteButton = null; return null; } @@ -255,14 +102,6 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ this.deleteButton = new IconButtonView({ model : new IconButton( deleteBtnData ) }); return this.deleteButton.render().$el; }, - - // ................................................................................ titleLink - // render the hid and hda.name as a link (that will expand the body) - _render_titleLink : function(){ - return $( jQuery.trim( HDAView.templates.titleLink( - _.extend( this.model.toJSON(), { urls: this.urls } ) - ))); - }, // ................................................................................ RENDER BODY // render the data/metadata summary (format, size, misc info, etc.) @@ -271,40 +110,19 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ // if there's no dbkey and it's editable : pass a flag to the template to render a link to editing in the '?' if( this.model.get( 'metadata_dbkey' ) === '?' && !this.model.isDeletedOrPurged() ){ + //TODO: use HDABaseView and select/replace base on this switch _.extend( modelData, { dbkey_unknown_and_editable : true }); } - return HDAView.templates.hdaSummary( modelData ); + return HDABaseView.templates.hdaSummary( modelData ); }, // ................................................................................ primary actions - // render the icon-buttons gen. placed underneath the hda summary - _render_primaryActionButtons : function( buttonRenderingFuncs ){ - var primaryActionButtons = $( '
' ).attr( 'id', 'primary-actions-' + this.model.get( 'id' ) ), - view = this; - _.each( buttonRenderingFuncs, function( fn ){ - primaryActionButtons.append( fn.call( view ) ); - }); - return primaryActionButtons; - }, - - // icon-button/popupmenu to down the data (and/or the associated meta files (bai, etc.)) for this hda - _render_downloadButton : function(){ - // don't show anything if the data's been purged - if( this.model.get( 'purged' ) ){ return null; } - - // return either: a single download icon-button (if there are no meta files) - // or a popupmenu with links to download assoc. meta files (if there are meta files) - var downloadLinkHTML = HDAView.templates.downloadLinks( - _.extend( this.model.toJSON(), { urls: this.urls } ) - ); - //this.log( this + '_render_downloadButton, downloadLinkHTML:', downloadLinkHTML ); - return $( downloadLinkHTML ); - }, - // icon-button to show the input and output (stdout/err) for the job that created this hda - _render_errButton : function(){ - if( ( this.model.get( 'state' ) !== HistoryDatasetAssociation.STATES.ERROR ) - || ( !this.model.get( 'for_editing' ) ) ){ return null; } + _render_errButton : function(){ + if( this.model.get( 'state' ) !== HistoryDatasetAssociation.STATES.ERROR ){ + this.errButton = null; + return null; + } this.errButton = new IconButtonView({ model : new IconButton({ title : _l( 'View or report this error' ), @@ -315,21 +133,8 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ return this.errButton.render().$el; }, - // icon-button to show the input and output (stdout/err) for the job that created this hda - _render_showParamsButton : function(){ - // gen. safe to show in all cases - this.showParamsButton = new IconButtonView({ model : new IconButton({ - title : _l( 'View details' ), - href : this.urls.show_params, - target : 'galaxy_main', - icon_class : 'information' - }) }); - return this.showParamsButton.render().$el; - }, - // icon-button to re run the job that created this hda _render_rerunButton : function(){ - if( !this.model.get( 'for_editing' ) ){ return null; } this.rerunButton = new IconButtonView({ model : new IconButton({ title : _l( 'Run this job again' ), href : this.urls.rerun, @@ -352,10 +157,10 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ }; if( !( this.model.hasData() ) - || !( this.model.get( 'for_editing' ) ) || !( visualizations && visualizations.length ) || !( visualization_url ) ){ //console.warn( 'NOT rendering visualization icon' ) + this.visualizationsButton = null; return null; } @@ -422,9 +227,12 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ // icon-button to load and display tagging html //TODO: these should be a sub-MV _render_tagButton : function(){ + //TODO: check for User if( !( this.model.hasData() ) - || !( this.model.get( 'for_editing' ) ) - || ( !this.urls.tags.get ) ){ return null; } + || ( !this.urls.tags.get ) ){ + this.tagButton = null; + return null; + } this.tagButton = new IconButtonView({ model : new IconButton({ title : _l( 'Edit dataset tags' ), @@ -438,9 +246,12 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ // icon-button to load and display annotation html //TODO: these should be a sub-MV _render_annotateButton : function(){ + //TODO: check for User if( !( this.model.hasData() ) - || !( this.model.get( 'for_editing' ) ) - || ( !this.urls.annotation.get ) ){ return null; } + || ( !this.urls.annotation.get ) ){ + this.annotateButton = null; + return null; + } this.annotateButton = new IconButtonView({ model : new IconButton({ title : _l( 'Edit dataset annotation' ), @@ -451,130 +262,34 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ }, // ................................................................................ other elements - // render links to external genome display applications (igb, gbrowse, etc.) - //TODO: not a fan of the style on these - _render_displayApps : function(){ - if( !this.model.hasData() ){ return null; } - - var displayAppsDiv = $( '
' ).addClass( 'display-apps' ); - if( !_.isEmpty( this.model.get( 'display_types' ) ) ){ - //this.log( this + 'display_types:', this.model.get( 'urls' ).display_types ); - //TODO:?? does this ever get used? - displayAppsDiv.append( - HDAView.templates.displayApps({ displayApps : this.model.get( 'display_types' ) }) - ); - } - if( !_.isEmpty( this.model.get( 'display_apps' ) ) ){ - //this.log( this + 'display_apps:', this.model.get( 'urls' ).display_apps ); - displayAppsDiv.append( - HDAView.templates.displayApps({ displayApps : this.model.get( 'display_apps' ) }) - ); - } - return displayAppsDiv; - }, - //TODO: into sub-MV + //TODO: check for User // render the area used to load tag display _render_tagArea : function(){ if( !this.urls.tags.set ){ return null; } //TODO: move to mvc/tags.js - return $( HDAView.templates.tagArea( + return $( HDAEditView.templates.tagArea( _.extend( this.model.toJSON(), { urls: this.urls } ) )); }, //TODO: into sub-MV + //TODO: check for User // render the area used to load annotation display _render_annotationArea : function(){ if( !this.urls.annotation.get ){ return null; } //TODO: move to mvc/annotations.js - return $( HDAView.templates.annotationArea( + return $( HDAEditView.templates.annotationArea( _.extend( this.model.toJSON(), { urls: this.urls } ) )); }, - - // render the data peek - //TODO: curr. pre-formatted into table on the server side - may not be ideal/flexible - _render_peek : function(){ - if( !this.model.get( 'peek' ) ){ return null; } - return $( '
' ).append( - $( '
' )
-                .attr( 'id', 'peek' + this.model.get( 'id' ) )
-                .addClass( 'peek' )
-                .append( this.model.get( 'peek' ) )
-        );
-    },
     
     // ................................................................................ state body renderers
-    // _render_body fns for the various states
-    //TODO: only render these on expansion (or already expanded)
-    _render_body_not_viewable : function( parent ){
-        //TODO: revisit - still showing display, edit, delete (as common) - that CAN'T be right
-        parent.append( $( '
' + _l( 'You do not have permission to view dataset' ) + '.
' ) ); - }, - - _render_body_uploading : function( parent ){ - parent.append( $( '
' + _l( 'Dataset is uploading' ) + '
' ) ); - }, - - _render_body_queued : function( parent ){ - parent.append( $( '
' + _l( 'Job is waiting to run' ) + '.
' ) ); - parent.append( this._render_primaryActionButtons([ - this._render_showParamsButton, - this._render_rerunButton - ])); - }, - - _render_body_running : function( parent ){ - parent.append( '
' + _l( 'Job is currently running' ) + '.
' ); - parent.append( this._render_primaryActionButtons([ - this._render_showParamsButton, - this._render_rerunButton - ])); - }, - _render_body_error : function( parent ){ - if( !this.model.get( 'purged' ) ){ - parent.append( $( '
' + this.model.get( 'misc_blurb' ) + '
' ) ); - } - parent.append( ( _l( 'An error occurred running this job' ) + ': ' - + '' + $.trim( this.model.get( 'misc_info' ) ) + '' ) ); - parent.append( this._render_primaryActionButtons([ - this._render_downloadButton, - this._render_errButton, - this._render_showParamsButton, - this._render_rerunButton - ])); - }, - - _render_body_discarded : function( parent ){ - parent.append( '
' + _l( 'The job creating this dataset was cancelled before completion' ) + '.
' ); - parent.append( this._render_primaryActionButtons([ - this._render_showParamsButton, - this._render_rerunButton - ])); - }, - - _render_body_setting_metadata : function( parent ){ - parent.append( $( '
' + _l( 'Metadata is being auto-detected' ) + '.
' ) ); - }, - - _render_body_empty : function( parent ){ - //TODO: replace i with dataset-misc-info class - //?? why are we showing the file size when we know it's zero?? - parent.append( $( '
' + _l( 'No data' ) + ': ' + this.model.get( 'misc_blurb' ) + '
' ) ); - parent.append( this._render_primaryActionButtons([ - this._render_showParamsButton, - this._render_rerunButton - ])); - }, - - _render_body_failed_metadata : function( parent ){ - //TODO: the css for this box is broken (unlike the others) - // add a message box about the failure at the top of the body... - parent.append( $( HDAView.templates.failedMetadata( this.model.toJSON() ) ) ); - //...then render the remaining body as STATES.OK (only diff between these states is the box above) - this._render_body_ok( parent ); + // overridden to prepend error report button to primary actions strip + HDABaseView.prototype._render_body_error.call( this, parent ); + var primaryActions = parent.find( '#primary-actions-' + this.model.get( 'id' ) ); + primaryActions.prepend( this._render_errButton() ); }, _render_body_ok : function( parent ){ @@ -595,7 +310,6 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ //NOTE: change the order here parent.append( this._render_primaryActionButtons([ this._render_downloadButton, - this._render_errButton, this._render_showParamsButton, this._render_rerunButton, this._render_visualizationsButton @@ -611,70 +325,6 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ parent.append( this._render_displayApps() ); parent.append( this._render_peek() ); - - //TODO??: still needed? - //// If Mozilla, hide scrollbars in hidden items since they cause animation bugs - //if ( $.browser.mozilla ) { - // $( "div.historyItemBody" ).each( function() { - // if ( !$(this).is(":visible") ) { $(this).find( "pre.peek" ).css( "overflow", "hidden" ); } - // }); - //} - }, - - _render_body : function(){ - //this.log( this + '_render_body' ); - //this.log( 'state:', state, 'for_editing', for_editing ); - - //TODO: incorrect id (encoded - use hid?) - var body = $( '
' ) - .attr( 'id', 'info-' + this.model.get( 'id' ) ) - .addClass( 'historyItemBody' ) - .attr( 'style', 'display: block' ); - - //TODO: not a fan of this dispatch - switch( this.model.get( 'state' ) ){ - case HistoryDatasetAssociation.STATES.NOT_VIEWABLE : - this._render_body_not_viewable( body ); - break; - case HistoryDatasetAssociation.STATES.UPLOAD : - this._render_body_uploading( body ); - break; - case HistoryDatasetAssociation.STATES.QUEUED : - this._render_body_queued( body ); - break; - case HistoryDatasetAssociation.STATES.RUNNING : - this._render_body_running( body ); - break; - case HistoryDatasetAssociation.STATES.ERROR : - this._render_body_error( body ); - break; - case HistoryDatasetAssociation.STATES.DISCARDED : - this._render_body_discarded( body ); - break; - case HistoryDatasetAssociation.STATES.SETTING_METADATA : - this._render_body_setting_metadata( body ); - break; - case HistoryDatasetAssociation.STATES.EMPTY : - this._render_body_empty( body ); - break; - case HistoryDatasetAssociation.STATES.FAILED_METADATA : - this._render_body_failed_metadata( body ); - break; - case HistoryDatasetAssociation.STATES.OK : - this._render_body_ok( body ); - break; - default: - //??: no body? - body.append( $( '
Error: unknown dataset state "' + state + '".
' ) ); - } - body.append( '
' ); - - if( this.expanded ){ - body.show(); - } else { - body.hide(); - } - return body; }, // ................................................................................ EVENTS @@ -761,25 +411,6 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ return false; }, - // expand/collapse body - // event: body-visible, body-hidden - toggleBodyVisibility : function( event, expanded ){ - var hdaView = this, - $body = this.$el.find( '.historyItemBody' ); - expanded = ( expanded === undefined )?( !$body.is( ':visible' ) ):( expanded ); - //this.log( 'toggleBodyVisibility, expanded:', expanded, '$body:', $body ); - - if( expanded ){ - $body.slideDown( 'fast', function(){ - hdaView.trigger( 'body-visible', hdaView.model.get( 'id' ) ); - }); - } else { - $body.slideUp( 'fast', function(){ - hdaView.trigger( 'body-hidden', hdaView.model.get( 'id' ) ); - }); - } - }, - // ................................................................................ UTILTIY toString : function(){ var modelString = ( this.model )?( this.model + '' ):( '(no model)' ); @@ -788,17 +419,9 @@ var HDAView = BaseView.extend( LoggableMixin ).extend({ }); //------------------------------------------------------------------------------ -HDAView.templates = { - warningMsg : Handlebars.templates[ 'template-warningmessagesmall' ], - - messages : Handlebars.templates[ 'template-history-warning-messages' ], - titleLink : Handlebars.templates[ 'template-history-titleLink' ], - hdaSummary : Handlebars.templates[ 'template-history-hdaSummary' ], - downloadLinks : Handlebars.templates[ 'template-history-downloadLinks' ], - failedMetadata : Handlebars.templates[ 'template-history-failedMetaData' ], - tagArea : Handlebars.templates[ 'template-history-tagArea' ], - annotationArea : Handlebars.templates[ 'template-history-annotationArea' ], - displayApps : Handlebars.templates[ 'template-history-displayApps' ] +HDAEditView.templates = { + tagArea : Handlebars.templates[ 'template-hda-tagArea' ], + annotationArea : Handlebars.templates[ 'template-hda-annotationArea' ] }; //============================================================================== diff --git a/static/scripts/mvc/dataset/hda-model.js b/static/scripts/mvc/dataset/hda-model.js index 91baa1c2071..e7686e31953 100644 --- a/static/scripts/mvc/dataset/hda-model.js +++ b/static/scripts/mvc/dataset/hda-model.js @@ -43,10 +43,7 @@ var HistoryDatasetAssociation = BaseModel.extend( LoggableMixin ).extend({ // aka. !hidden visible : false, // based on trans.user (is_admin or security_agent.can_access_dataset( , hda.dataset )) - accessible : false, - - //TODO: this needs to be removed (it is a function of the view type (e.g. HDAForEditingView)) - for_editing : true + accessible : false }, // fetch location of this history in the api diff --git a/static/scripts/mvc/history/history-panel.js b/static/scripts/mvc/history/history-panel.js index 980b5a203b6..c2196833f37 100644 --- a/static/scripts/mvc/history/history-panel.js +++ b/static/scripts/mvc/history/history-panel.js @@ -5,26 +5,26 @@ Backbone.js implementation of history panel TODO: + refactoring on for_editing: + uhoh: purge link in warning message in history_common.mako conditional on trans.app.config.allow_user_dataset_purge + bug: rerun still doesn't take encoded ids + anon user, mako template init: - bug: rename url seems to be wrong url BUG: shouldn't have tag/anno buttons (on hdas) Check for user in hdaView somehow logged in, mako template: - BUG: quotaMsg not showing when 100% (on load) bug: rename not being changed locally - render() shows old name, refresh: new name + TODO: editable text to MV, might also just use REST.update on history BUG: meter is not updating RELIABLY on change:nice_size BUG: am able to start upload even if over quota - 'runs' forever bug: quotaMeter bar rendering square in chrome - BUG: imported, shared history with unaccessible dataset errs in historycontents when getting history - (entire history is inaccessible) - ??: still happening? from loadFromApi: - BUG: not loading deleted datasets - FIXED: history_contents, show: state_ids returns all ids now (incl. deleted) fixed: + BUG: not loading deleted datasets + FIXED: history_contents, show: state_ids returns all ids now (incl. deleted) BUG: upload, history size, doesn't change FIXED: using change:nice_size to trigger re-render of history size BUG: delete uploading hda - now in state 'discarded'! ...new state to handle @@ -112,6 +112,8 @@ var HistoryPanel = BaseView.extend( LoggableMixin ).extend({ // direct attachment to existing element el : 'body.historyPage', + //HDAView : HDABaseView, + HDAView : HDAEditView, // init with the model, urlTemplates, set up storage, bind HDACollection events //NOTE: this will create or load PersistantStorage keyed under 'HistoryView.' @@ -122,9 +124,9 @@ var HistoryPanel = BaseView.extend( LoggableMixin ).extend({ // set up url templates //TODO: prob. better to put this in class scope (as the handlebars templates), but... // they're added to GalaxyPaths on page load (after this file is loaded) - if( !attributes.urlTemplates ){ throw( 'HDAView needs urlTemplates on initialize' ); } - if( !attributes.urlTemplates.history ){ throw( 'HDAView needs urlTemplates.history on initialize' ); } - if( !attributes.urlTemplates.hda ){ throw( 'HDAView needs urlTemplates.hda on initialize' ); } + if( !attributes.urlTemplates ){ throw( this + ' needs urlTemplates on initialize' ); } + if( !attributes.urlTemplates.history ){ throw( this + ' needs urlTemplates.history on initialize' ); } + if( !attributes.urlTemplates.hda ){ throw( this + ' needs urlTemplates.hda on initialize' ); } this.urlTemplates = attributes.urlTemplates.history; this.hdaUrlTemplates = attributes.urlTemplates.hda; @@ -283,7 +285,7 @@ var HistoryPanel = BaseView.extend( LoggableMixin ).extend({ var hdaId = hda.get( 'id' ), expanded = historyView.storage.get( 'expandedHdas' ).get( hdaId ); - historyView.hdaViews[ hdaId ] = new HDAView({ + historyView.hdaViews[ hdaId ] = new historyView.HDAView({ model : hda, expanded : expanded, urlTemplates : historyView.hdaUrlTemplates @@ -301,12 +303,11 @@ var HistoryPanel = BaseView.extend( LoggableMixin ).extend({ setUpHdaListeners : function( hdaView ){ var historyView = this; // use storage to maintain a list of hdas whose bodies are expanded - hdaView.bind( 'toggleBodyVisibility', function( id, visible ){ - if( visible ){ - historyView.storage.get( 'expandedHdas' ).set( id, true ); - } else { - historyView.storage.get( 'expandedHdas' ).deleteKey( id ); - } + hdaView.bind( 'body-visible', function( id ){ + historyView.storage.get( 'expandedHdas' ).set( id, true ); + }); + hdaView.bind( 'body-hidden', function( id ){ + historyView.storage.get( 'expandedHdas' ).deleteKey( id ); }); }, diff --git a/static/scripts/packed/mvc/dataset/hda-base.js b/static/scripts/packed/mvc/dataset/hda-base.js new file mode 100644 index 00000000000..c37fec08fbe --- /dev/null +++ b/static/scripts/packed/mvc/dataset/hda-base.js @@ -0,0 +1 @@ +var HDABaseView=BaseView.extend(LoggableMixin).extend({tagName:"div",className:"historyItemContainer",initialize:function(a){this.log(this+".initialize:",a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];if(!a.urlTemplates){throw ("HDAView needs urlTemplates on initialize")}this.urls=this.renderUrls(a.urlTemplates,this.model.toJSON());this.expanded=a.expanded||false;this.model.bind("change",this.render,this)},renderUrls:function(d,a){var b=this,c={};_.each(d,function(e,f){if(_.isObject(e)){c[f]=b.renderUrls(e,a)}else{if(f==="meta_download"){c[f]=b.renderMetaDownloadUrls(e,a)}else{c[f]=_.template(e,a)}}});return c},renderMetaDownloadUrls:function(b,a){return _.map(a.meta_files,function(c){return{url:_.template(b,{id:a.id,file_type:c.file_type}),file_type:c.file_type}})},render:function(){var b=this,e=this.model.get("id"),c=this.model.get("state"),a=$("
").attr("id","historyItem-"+e),d=(this.$el.children().size()===0);this.$el.attr("id","historyItemContainer-"+e);a.addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_warnings());a.append(this._render_titleBar());this.body=$(this._render_body());a.append(this.body);make_popup_menus(a);a.find(".tooltip").tooltip({placement:"bottom"});this.$el.fadeOut("fast",function(){b.$el.children().remove();b.$el.append(a).fadeIn("fast",function(){b.log(b+" rendered:",b.$el);var f="rendered";if(d){f+=":initial"}else{if(b.model.inReadyState()){f+=":ready"}}b.trigger(f)})});return this},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(this.model.toJSON())))},_render_titleBar:function(){var a=$('
');a.append(this._render_titleButtons());a.append('');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('
');a.append(this._render_displayButton());return a},_render_displayButton:function(){if((!this.model.inReadyState())||(this.model.get("state")===HistoryDatasetAssociation.STATES.ERROR)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.displayButton=null;return null}var a={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){a.enabled=false;a.title=_l("Cannot display datasets removed from disk")}else{a.title=_l("Display data in browser");a.href=this.urls.display}this.displayButton=new IconButtonView({model:new IconButton(a)});return this.displayButton.render().$el},_render_titleLink:function(){return $(jQuery.trim(HDABaseView.templates.titleLink(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});return HDABaseView.templates.hdaSummary(a)},_render_primaryActionButtons:function(c){var a=this,b=$("
").attr("id","primary-actions-"+this.model.get("id"));_.each(c,function(d){b.append(d.call(a))});return b},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var a=HDABaseView.templates.downloadLinks(_.extend(this.model.toJSON(),{urls:this.urls}));return $(a)},_render_showParamsButton:function(){this.showParamsButton=new IconButtonView({model:new IconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",icon_class:"information"})});return this.showParamsButton.render().$el},_render_displayApps:function(){if(!this.model.hasData()){return null}var a=$("
").addClass("display-apps");if(!_.isEmpty(this.model.get("display_types"))){a.append(HDABaseView.templates.displayApps({displayApps:this.model.get("display_types")}))}if(!_.isEmpty(this.model.get("display_apps"))){a.append(HDABaseView.templates.displayApps({displayApps:this.model.get("display_apps")}))}return a},_render_peek:function(){if(!this.model.get("peek")){return null}return $("
").append($("
").attr("id","peek"+this.model.get("id")).addClass("peek").append(this.model.get("peek")))},_render_body_not_viewable:function(a){a.append($("
"+_l("You do not have permission to view dataset")+".
"))},_render_body_uploading:function(a){a.append($("
"+_l("Dataset is uploading")+"
"))},_render_body_queued:function(a){a.append($("
"+_l("Job is waiting to run")+".
"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_running:function(a){a.append("
"+_l("Job is currently running")+".
");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("
"+this.model.get("misc_blurb")+"
"))}a.append((_l("An error occurred running this job")+": "+$.trim(this.model.get("misc_info"))+""));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton])))},_render_body_discarded:function(a){a.append("
"+_l("The job creating this dataset was cancelled before completion")+".
");a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_setting_metadata:function(a){a.append($("
"+_l("Metadata is being auto-detected")+".
"))},_render_body_empty:function(a){a.append($("
"+_l("No data")+": "+this.model.get("misc_blurb")+"
"));a.append(this._render_primaryActionButtons(this.defaultPrimaryActionButtonRenderers))},_render_body_failed_metadata:function(a){a.append($(HDABaseView.templates.failedMetadata(this.model.toJSON())));this._render_body_ok(a)},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton]));a.append('
');a.append(this._render_displayApps());a.append(this._render_peek())},_render_body:function(){var a=$("
").attr("id","info-"+this.model.get("id")).addClass("historyItemBody").attr("style","display: block");switch(this.model.get("state")){case HistoryDatasetAssociation.STATES.NOT_VIEWABLE:this._render_body_not_viewable(a);break;case HistoryDatasetAssociation.STATES.UPLOAD:this._render_body_uploading(a);break;case HistoryDatasetAssociation.STATES.QUEUED:this._render_body_queued(a);break;case HistoryDatasetAssociation.STATES.RUNNING:this._render_body_running(a);break;case HistoryDatasetAssociation.STATES.ERROR:this._render_body_error(a);break;case HistoryDatasetAssociation.STATES.DISCARDED:this._render_body_discarded(a);break;case HistoryDatasetAssociation.STATES.SETTING_METADATA:this._render_body_setting_metadata(a);break;case HistoryDatasetAssociation.STATES.EMPTY:this._render_body_empty(a);break;case HistoryDatasetAssociation.STATES.FAILED_METADATA:this._render_body_failed_metadata(a);break;case HistoryDatasetAssociation.STATES.OK:this._render_body_ok(a);break;default:a.append($('
Error: unknown dataset state "'+state+'".
'))}a.append('
');if(this.expanded){a.show()}else{a.hide()}return a},events:{"click .historyItemTitle":"toggleBodyVisibility"},toggleBodyVisibility:function(c,a){var b=this,d=this.$el.find(".historyItemBody");a=(a===undefined)?(!d.is(":visible")):(a);if(a){d.slideDown("fast",function(){b.trigger("body-visible",b.model.get("id"))})}else{d.slideUp("fast",function(){b.trigger("body-hidden",b.model.get("id"))})}},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+a+")"}});HDABaseView.templates={warningMsg:Handlebars.templates["template-warningmessagesmall"],messages:Handlebars.templates["template-hda-warning-messages"],titleLink:Handlebars.templates["template-hda-titleLink"],hdaSummary:Handlebars.templates["template-hda-hdaSummary"],downloadLinks:Handlebars.templates["template-hda-downloadLinks"],failedMetadata:Handlebars.templates["template-hda-failedMetaData"],displayApps:Handlebars.templates["template-hda-displayApps"]}; \ No newline at end of file diff --git a/static/scripts/packed/mvc/dataset/hda-edit.js b/static/scripts/packed/mvc/dataset/hda-edit.js index 7726d77e295..28fe8d31d05 100644 --- a/static/scripts/packed/mvc/dataset/hda-edit.js +++ b/static/scripts/packed/mvc/dataset/hda-edit.js @@ -1 +1 @@ -var HDAView=BaseView.extend(LoggableMixin).extend({tagName:"div",className:"historyItemContainer",initialize:function(a){this.log(this+".initialize:",a);if(!a.urlTemplates){throw ("HDAView needs urlTemplates on initialize")}this.urls=this.renderUrls(a.urlTemplates,this.model.toJSON());this.expanded=a.expanded||false;this.model.bind("change",this.render,this)},renderUrls:function(d,a){var b=this,c={};_.each(d,function(e,f){if(_.isObject(e)){c[f]=b.renderUrls(e,a)}else{if(f==="meta_download"){c[f]=b.renderMetaDownloadUrls(e,a)}else{c[f]=_.template(e,a)}}});return c},renderMetaDownloadUrls:function(b,a){return _.map(a.meta_files,function(c){return{url:_.template(b,{id:a.id,file_type:c.file_type}),file_type:c.file_type}})},render:function(){var b=this,e=this.model.get("id"),c=this.model.get("state"),a=$("
").attr("id","historyItem-"+e),d=(this.$el.children().size()===0);this._clearReferences();this.$el.attr("id","historyItemContainer-"+e);a.addClass("historyItemWrapper").addClass("historyItem").addClass("historyItem-"+c);a.append(this._render_warnings());a.append(this._render_titleBar());this.body=$(this._render_body());a.append(this.body);make_popup_menus(a);a.find(".tooltip").tooltip({placement:"bottom"});this.$el.fadeOut("fast",function(){b.$el.children().remove();b.$el.append(a).fadeIn("fast",function(){b.log(b+" rendered:",b.$el);var f="rendered";if(d){f+=":initial"}else{if(b.model.inReadyState()){f+=":ready"}}b.trigger(f)})});return this},_clearReferences:function(){this.displayButton=null;this.editButton=null;this.deleteButton=null;this.errButton=null;this.showParamsButton=null;this.rerunButton=null;this.visualizationsButton=null;this.tagButton=null;this.annotateButton=null},_render_warnings:function(){return $(jQuery.trim(HDAView.templates.messages(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_titleBar:function(){var a=$('
');a.append(this._render_titleButtons());a.append('');a.append(this._render_titleLink());return a},_render_titleButtons:function(){var a=$('
');a.append(this._render_displayButton());a.append(this._render_editButton());a.append(this._render_deleteButton());return a},_render_displayButton:function(){if((!this.model.inReadyState())||(this.model.get("state")===HistoryDatasetAssociation.STATES.ERROR)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var a={icon_class:"display"};if(this.model.get("purged")){a.enabled=false;a.title=_l("Cannot display datasets removed from disk")}else{a.title=_l("Display data in browser");a.href=this.urls.display}if(this.model.get("for_editing")){a.target="galaxy_main"}this.displayButton=new IconButtonView({model:new IconButton(a)});return this.displayButton.render().$el},_render_editButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.UPLOAD)||(this.model.get("state")===HistoryDatasetAssociation.STATES.ERROR)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))||(!this.model.get("for_editing"))){return null}var c=this.model.get("purged"),a=this.model.get("deleted"),b={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(a||c){b.enabled=false;if(c){b.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(a){b.title=_l("Undelete dataset to edit attributes")}}}this.editButton=new IconButtonView({model:new IconButton(b)});return this.editButton.render().$el},_render_deleteButton:function(){if((!this.model.get("for_editing"))||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var a={title:_l("Delete"),href:this.urls["delete"],id:"historyItemDeleter-"+this.model.get("id"),icon_class:"delete"};if(this.model.get("deleted")||this.model.get("purged")){a={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}this.deleteButton=new IconButtonView({model:new IconButton(a)});return this.deleteButton.render().$el},_render_titleLink:function(){return $(jQuery.trim(HDAView.templates.titleLink(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){_.extend(a,{dbkey_unknown_and_editable:true})}return HDAView.templates.hdaSummary(a)},_render_primaryActionButtons:function(c){var b=$("
").attr("id","primary-actions-"+this.model.get("id")),a=this;_.each(c,function(d){b.append(d.call(a))});return b},_render_downloadButton:function(){if(this.model.get("purged")){return null}var a=HDAView.templates.downloadLinks(_.extend(this.model.toJSON(),{urls:this.urls}));return $(a)},_render_errButton:function(){if((this.model.get("state")!==HistoryDatasetAssociation.STATES.ERROR)||(!this.model.get("for_editing"))){return null}this.errButton=new IconButtonView({model:new IconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",icon_class:"bug"})});return this.errButton.render().$el},_render_showParamsButton:function(){this.showParamsButton=new IconButtonView({model:new IconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",icon_class:"information"})});return this.showParamsButton.render().$el},_render_rerunButton:function(){if(!this.model.get("for_editing")){return null}this.rerunButton=new IconButtonView({model:new IconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",icon_class:"arrow-circle"})});return this.rerunButton.render().$el},_render_visualizationsButton:function(){var c=this.model.get("dbkey"),a=this.model.get("visualizations"),f=this.urls.visualization,d={},g={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(!(this.model.hasData())||!(this.model.get("for_editing"))||!(a&&a.length)||!(f)){return null}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),href:f,icon_class:"chart_curve"})});var b=this.visualizationsButton.render().$el;b.addClass("visualize-icon");if(c){g.dbkey=c}function e(h){switch(h){case"trackster":return create_trackster_action_fn(f,g,c);case"scatterplot":return create_scatterplot_action_fn(f,g);default:return function(){window.parent.location=f+"/"+h+"?"+$.param(g)}}}if(a.length===1){b.attr("title",a[0]);b.click(e(a[0]))}else{_.each(a,function(i){var h=i.charAt(0).toUpperCase()+i.slice(1);d[_l(h)]=e(i)});make_popupmenu(b,d)}return b},_render_secondaryActionButtons:function(b){var c=$("
"),a=this;c.attr("style","float: right;").attr("id","secondary-actions-"+this.model.get("id"));_.each(b,function(d){c.append(d.call(a))});return c},_render_tagButton:function(){if(!(this.model.hasData())||!(this.model.get("for_editing"))||(!this.urls.tags.get)){return null}this.tagButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset tags"),target:"galaxy_main",href:this.urls.tags.get,icon_class:"tags"})});return this.tagButton.render().$el},_render_annotateButton:function(){if(!(this.model.hasData())||!(this.model.get("for_editing"))||(!this.urls.annotation.get)){return null}this.annotateButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset annotation"),target:"galaxy_main",icon_class:"annotate"})});return this.annotateButton.render().$el},_render_displayApps:function(){if(!this.model.hasData()){return null}var a=$("
").addClass("display-apps");if(!_.isEmpty(this.model.get("display_types"))){a.append(HDAView.templates.displayApps({displayApps:this.model.get("display_types")}))}if(!_.isEmpty(this.model.get("display_apps"))){a.append(HDAView.templates.displayApps({displayApps:this.model.get("display_apps")}))}return a},_render_tagArea:function(){if(!this.urls.tags.set){return null}return $(HDAView.templates.tagArea(_.extend(this.model.toJSON(),{urls:this.urls})))},_render_annotationArea:function(){if(!this.urls.annotation.get){return null}return $(HDAView.templates.annotationArea(_.extend(this.model.toJSON(),{urls:this.urls})))},_render_peek:function(){if(!this.model.get("peek")){return null}return $("
").append($("
").attr("id","peek"+this.model.get("id")).addClass("peek").append(this.model.get("peek")))},_render_body_not_viewable:function(a){a.append($("
"+_l("You do not have permission to view dataset")+".
"))},_render_body_uploading:function(a){a.append($("
"+_l("Dataset is uploading")+"
"))},_render_body_queued:function(a){a.append($("
"+_l("Job is waiting to run")+".
"));a.append(this._render_primaryActionButtons([this._render_showParamsButton,this._render_rerunButton]))},_render_body_running:function(a){a.append("
"+_l("Job is currently running")+".
");a.append(this._render_primaryActionButtons([this._render_showParamsButton,this._render_rerunButton]))},_render_body_error:function(a){if(!this.model.get("purged")){a.append($("
"+this.model.get("misc_blurb")+"
"))}a.append((_l("An error occurred running this job")+": "+$.trim(this.model.get("misc_info"))+""));a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_errButton,this._render_showParamsButton,this._render_rerunButton]))},_render_body_discarded:function(a){a.append("
"+_l("The job creating this dataset was cancelled before completion")+".
");a.append(this._render_primaryActionButtons([this._render_showParamsButton,this._render_rerunButton]))},_render_body_setting_metadata:function(a){a.append($("
"+_l("Metadata is being auto-detected")+".
"))},_render_body_empty:function(a){a.append($("
"+_l("No data")+": "+this.model.get("misc_blurb")+"
"));a.append(this._render_primaryActionButtons([this._render_showParamsButton,this._render_rerunButton]))},_render_body_failed_metadata:function(a){a.append($(HDAView.templates.failedMetadata(this.model.toJSON())));this._render_body_ok(a)},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_errButton,this._render_showParamsButton,this._render_rerunButton,this._render_visualizationsButton]));a.append(this._render_secondaryActionButtons([this._render_tagButton,this._render_annotateButton]));a.append('
');a.append(this._render_tagArea());a.append(this._render_annotationArea());a.append(this._render_displayApps());a.append(this._render_peek())},_render_body:function(){var a=$("
").attr("id","info-"+this.model.get("id")).addClass("historyItemBody").attr("style","display: block");switch(this.model.get("state")){case HistoryDatasetAssociation.STATES.NOT_VIEWABLE:this._render_body_not_viewable(a);break;case HistoryDatasetAssociation.STATES.UPLOAD:this._render_body_uploading(a);break;case HistoryDatasetAssociation.STATES.QUEUED:this._render_body_queued(a);break;case HistoryDatasetAssociation.STATES.RUNNING:this._render_body_running(a);break;case HistoryDatasetAssociation.STATES.ERROR:this._render_body_error(a);break;case HistoryDatasetAssociation.STATES.DISCARDED:this._render_body_discarded(a);break;case HistoryDatasetAssociation.STATES.SETTING_METADATA:this._render_body_setting_metadata(a);break;case HistoryDatasetAssociation.STATES.EMPTY:this._render_body_empty(a);break;case HistoryDatasetAssociation.STATES.FAILED_METADATA:this._render_body_failed_metadata(a);break;case HistoryDatasetAssociation.STATES.OK:this._render_body_ok(a);break;default:a.append($('
Error: unknown dataset state "'+state+'".
'))}a.append('
');if(this.expanded){a.show()}else{a.hide()}return a},events:{"click .historyItemTitle":"toggleBodyVisibility","click a.icon-button.tags":"loadAndDisplayTags","click a.icon-button.annotate":"loadAndDisplayAnnotation"},loadAndDisplayTags:function(b){this.log(this+".loadAndDisplayTags",b);var c=this.$el.find(".tag-area"),a=c.find(".tag-elt");if(c.is(":hidden")){if(!jQuery.trim(a.html())){$.ajax({url:this.urls.tags.get,error:function(){alert(_l("Tagging failed"))},success:function(d){a.html(d);a.find(".tooltip").tooltip();c.slideDown("fast")}})}else{c.slideDown("fast")}}else{c.slideUp("fast")}return false},loadAndDisplayAnnotation:function(b){this.log(this+".loadAndDisplayAnnotation",b);var d=this.$el.find(".annotation-area"),c=d.find(".annotation-elt"),a=this.urls.annotation.set;if(d.is(":hidden")){if(!jQuery.trim(c.html())){$.ajax({url:this.urls.annotation.get,error:function(){alert(_l("Annotations failed"))},success:function(e){if(e===""){e=""+_l("Describe or add notes to dataset")+""}c.html(e);d.find(".tooltip").tooltip();async_save_text(c.attr("id"),c.attr("id"),a,"new_annotation",18,true,4);d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},toggleBodyVisibility:function(c,a){var b=this,d=this.$el.find(".historyItemBody");a=(a===undefined)?(!d.is(":visible")):(a);if(a){d.slideDown("fast",function(){b.trigger("body-visible",b.model.get("id"))})}else{d.slideUp("fast",function(){b.trigger("body-hidden",b.model.get("id"))})}},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDAView("+a+")"}});HDAView.templates={warningMsg:Handlebars.templates["template-warningmessagesmall"],messages:Handlebars.templates["template-history-warning-messages"],titleLink:Handlebars.templates["template-history-titleLink"],hdaSummary:Handlebars.templates["template-history-hdaSummary"],downloadLinks:Handlebars.templates["template-history-downloadLinks"],failedMetadata:Handlebars.templates["template-history-failedMetaData"],tagArea:Handlebars.templates["template-history-tagArea"],annotationArea:Handlebars.templates["template-history-annotationArea"],displayApps:Handlebars.templates["template-history-displayApps"]};function create_scatterplot_action_fn(a,b){action=function(){var d=$(window.parent.document).find("iframe#galaxy_main"),c=a+"/scatterplot?"+$.param(b);d.attr("src",c);$("div.popmenu-wrapper").remove();return false};return action}function create_trackster_action_fn(a,c,b){return function(){var d={};if(b){d.dbkey=b}$.ajax({url:a+"/list_tracks?f-"+$.param(d),dataType:"html",error:function(){alert(_l("Could not add this dataset to browser")+".")},success:function(e){var f=window.parent;f.show_modal(_l("View Data in a New or Saved Visualization"),"",{Cancel:function(){f.hide_modal()},"View in saved visualization":function(){f.show_modal(_l("Add Data to Saved Visualization"),e,{Cancel:function(){f.hide_modal()},"Add to visualization":function(){$(f.document).find("input[name=id]:checked").each(function(){var g=$(this).val();c.id=g;f.location=a+"/trackster?"+$.param(c)})}})},"View in new visualization":function(){f.location=a+"/trackster?"+$.param(c)}})}});return false}}; \ No newline at end of file +var HDAEditView=HDABaseView.extend({initialize:function(a){HDABaseView.prototype.initialize.call(this,a);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_warnings:function(){return $(jQuery.trim(HDABaseView.templates.messages(_.extend(this.model.toJSON(),{urls:this.urls}))))},_render_titleButtons:function(){var a=$('
');a.append(this._render_displayButton());a.append(this._render_editButton());a.append(this._render_deleteButton());return a},_render_editButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.UPLOAD)||(this.model.get("state")===HistoryDatasetAssociation.STATES.ERROR)||(this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.editButton=null;return null}var c=this.model.get("purged"),a=this.model.get("deleted"),b={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(a||c){b.enabled=false;if(c){b.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(a){b.title=_l("Undelete dataset to edit attributes")}}}this.editButton=new IconButtonView({model:new IconButton(b)});return this.editButton.render().$el},_render_deleteButton:function(){if((this.model.get("state")===HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){this.deleteButton=null;return null}var a={title:_l("Delete"),href:this.urls["delete"],id:"historyItemDeleter-"+this.model.get("id"),icon_class:"delete"};if(this.model.get("deleted")||this.model.get("purged")){a={title:_l("Dataset is already deleted"),icon_class:"delete",enabled:false}}this.deleteButton=new IconButtonView({model:new IconButton(a)});return this.deleteButton.render().$el},_render_hdaSummary:function(){var a=_.extend(this.model.toJSON(),{urls:this.urls});if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){_.extend(a,{dbkey_unknown_and_editable:true})}return HDABaseView.templates.hdaSummary(a)},_render_errButton:function(){if(this.model.get("state")!==HistoryDatasetAssociation.STATES.ERROR){this.errButton=null;return null}this.errButton=new IconButtonView({model:new IconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",icon_class:"bug"})});return this.errButton.render().$el},_render_rerunButton:function(){this.rerunButton=new IconButtonView({model:new IconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",icon_class:"arrow-circle"})});return this.rerunButton.render().$el},_render_visualizationsButton:function(){var c=this.model.get("dbkey"),a=this.model.get("visualizations"),f=this.urls.visualization,d={},g={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(!(this.model.hasData())||!(a&&a.length)||!(f)){this.visualizationsButton=null;return null}this.visualizationsButton=new IconButtonView({model:new IconButton({title:_l("Visualize"),href:f,icon_class:"chart_curve"})});var b=this.visualizationsButton.render().$el;b.addClass("visualize-icon");if(c){g.dbkey=c}function e(h){switch(h){case"trackster":return create_trackster_action_fn(f,g,c);case"scatterplot":return create_scatterplot_action_fn(f,g);default:return function(){window.parent.location=f+"/"+h+"?"+$.param(g)}}}if(a.length===1){b.attr("title",a[0]);b.click(e(a[0]))}else{_.each(a,function(i){var h=i.charAt(0).toUpperCase()+i.slice(1);d[_l(h)]=e(i)});make_popupmenu(b,d)}return b},_render_secondaryActionButtons:function(b){var c=$("
"),a=this;c.attr("style","float: right;").attr("id","secondary-actions-"+this.model.get("id"));_.each(b,function(d){c.append(d.call(a))});return c},_render_tagButton:function(){if(!(this.model.hasData())||(!this.urls.tags.get)){this.tagButton=null;return null}this.tagButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset tags"),target:"galaxy_main",href:this.urls.tags.get,icon_class:"tags"})});return this.tagButton.render().$el},_render_annotateButton:function(){if(!(this.model.hasData())||(!this.urls.annotation.get)){this.annotateButton=null;return null}this.annotateButton=new IconButtonView({model:new IconButton({title:_l("Edit dataset annotation"),target:"galaxy_main",icon_class:"annotate"})});return this.annotateButton.render().$el},_render_tagArea:function(){if(!this.urls.tags.set){return null}return $(HDAEditView.templates.tagArea(_.extend(this.model.toJSON(),{urls:this.urls})))},_render_annotationArea:function(){if(!this.urls.annotation.get){return null}return $(HDAEditView.templates.annotationArea(_.extend(this.model.toJSON(),{urls:this.urls})))},_render_body_error:function(a){HDABaseView.prototype._render_body_error.call(this,a);var b=a.find("#primary-actions-"+this.model.get("id"));b.prepend(this._render_errButton())},_render_body_ok:function(a){a.append(this._render_hdaSummary());if(this.model.isDeletedOrPurged()){a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton]));return}a.append(this._render_primaryActionButtons([this._render_downloadButton,this._render_showParamsButton,this._render_rerunButton,this._render_visualizationsButton]));a.append(this._render_secondaryActionButtons([this._render_tagButton,this._render_annotateButton]));a.append('
');a.append(this._render_tagArea());a.append(this._render_annotationArea());a.append(this._render_displayApps());a.append(this._render_peek())},events:{"click .historyItemTitle":"toggleBodyVisibility","click a.icon-button.tags":"loadAndDisplayTags","click a.icon-button.annotate":"loadAndDisplayAnnotation"},loadAndDisplayTags:function(b){this.log(this+".loadAndDisplayTags",b);var c=this.$el.find(".tag-area"),a=c.find(".tag-elt");if(c.is(":hidden")){if(!jQuery.trim(a.html())){$.ajax({url:this.urls.tags.get,error:function(){alert(_l("Tagging failed"))},success:function(d){a.html(d);a.find(".tooltip").tooltip();c.slideDown("fast")}})}else{c.slideDown("fast")}}else{c.slideUp("fast")}return false},loadAndDisplayAnnotation:function(b){this.log(this+".loadAndDisplayAnnotation",b);var d=this.$el.find(".annotation-area"),c=d.find(".annotation-elt"),a=this.urls.annotation.set;if(d.is(":hidden")){if(!jQuery.trim(c.html())){$.ajax({url:this.urls.annotation.get,error:function(){alert(_l("Annotations failed"))},success:function(e){if(e===""){e=""+_l("Describe or add notes to dataset")+""}c.html(e);d.find(".tooltip").tooltip();async_save_text(c.attr("id"),c.attr("id"),a,"new_annotation",18,true,4);d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},toString:function(){var a=(this.model)?(this.model+""):("(no model)");return"HDAView("+a+")"}});HDAEditView.templates={tagArea:Handlebars.templates["template-hda-tagArea"],annotationArea:Handlebars.templates["template-hda-annotationArea"]};function create_scatterplot_action_fn(a,b){action=function(){var d=$(window.parent.document).find("iframe#galaxy_main"),c=a+"/scatterplot?"+$.param(b);d.attr("src",c);$("div.popmenu-wrapper").remove();return false};return action}function create_trackster_action_fn(a,c,b){return function(){var d={};if(b){d.dbkey=b}$.ajax({url:a+"/list_tracks?f-"+$.param(d),dataType:"html",error:function(){alert(_l("Could not add this dataset to browser")+".")},success:function(e){var f=window.parent;f.show_modal(_l("View Data in a New or Saved Visualization"),"",{Cancel:function(){f.hide_modal()},"View in saved visualization":function(){f.show_modal(_l("Add Data to Saved Visualization"),e,{Cancel:function(){f.hide_modal()},"Add to visualization":function(){$(f.document).find("input[name=id]:checked").each(function(){var g=$(this).val();c.id=g;f.location=a+"/trackster?"+$.param(c)})}})},"View in new visualization":function(){f.location=a+"/trackster?"+$.param(c)}})}});return false}}; \ No newline at end of file diff --git a/static/scripts/packed/mvc/dataset/hda-model.js b/static/scripts/packed/mvc/dataset/hda-model.js index 3fbd559c81a..851c078a0d9 100644 --- a/static/scripts/packed/mvc/dataset/hda-model.js +++ b/static/scripts/packed/mvc/dataset/hda-model.js @@ -1 +1 @@ -var HistoryDatasetAssociation=BaseModel.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"",state:"",data_type:null,file_size:0,meta_files:[],misc_blurb:"",misc_info:"",deleted:false,purged:false,visible:false,accessible:false,for_editing:true},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",this.get("id"),a,this.previous("state"),b)}})},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((a===HistoryDatasetAssociation.STATES.NEW)||(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("name")+'"'}return"HistoryDatasetAssociation("+a+")"}});HistoryDatasetAssociation.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",OK:"ok",EMPTY:"empty",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})},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},update:function(a){this.log(this+"update:",a);if(!(a&&a.length)){return}var b=this;_.each(a,function(e,c){var d=b.get(e);d.fetch()})},toString:function(){return("HDACollection("+this.ids().join(",")+")")}}); \ No newline at end of file +var HistoryDatasetAssociation=BaseModel.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"",state:"",data_type:null,file_size:0,meta_files:[],misc_blurb:"",misc_info:"",deleted:false,purged:false,visible:false,accessible:false},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",this.get("id"),a,this.previous("state"),b)}})},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((a===HistoryDatasetAssociation.STATES.NEW)||(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("name")+'"'}return"HistoryDatasetAssociation("+a+")"}});HistoryDatasetAssociation.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",OK:"ok",EMPTY:"empty",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})},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},update:function(a){this.log(this+"update:",a);if(!(a&&a.length)){return}var b=this;_.each(a,function(e,c){var d=b.get(e);d.fetch()})},toString:function(){return("HDACollection("+this.ids().join(",")+")")}}); \ No newline at end of file diff --git a/static/scripts/packed/mvc/history/history-panel.js b/static/scripts/packed/mvc/history/history-panel.js index d6838d80eeb..5429a716d59 100644 --- a/static/scripts/packed/mvc/history/history-panel.js +++ b/static/scripts/packed/mvc/history/history-panel.js @@ -1 +1 @@ -var HistoryPanel=BaseView.extend(LoggableMixin).extend({el:"body.historyPage",initialize:function(a){this.log(this+".initialize:",a);if(!a.urlTemplates){throw ("HDAView needs urlTemplates on initialize")}if(!a.urlTemplates.history){throw ("HDAView needs urlTemplates.history on initialize")}if(!a.urlTemplates.hda){throw ("HDAView needs urlTemplates.hda on initialize")}this.urlTemplates=a.urlTemplates.history;this.hdaUrlTemplates=a.urlTemplates.hda;this.storage=new PersistantStorage("HistoryView."+this.model.get("id"),{expandedHdas:{},show_deleted:false,show_hidden:false});this.log("this.storage:",this.storage.get());this.log("show_deleted:",a.show_deleted,"show_hidden",a.show_hidden);if((a.show_deleted===true)||(a.show_deleted===false)){this.storage.set("show_deleted",a.show_deleted)}if((a.show_hidden===true)||(a.show_hidden===false)){this.storage.set("show_hidden",a.show_hidden)}this.show_deleted=this.storage.get("show_deleted");this.show_hidden=this.storage.get("show_hidden");this.log("this.show_deleted:",this.show_deleted,"show_hidden",this.show_hidden);this.log("(now) this.storage:",this.storage.get());this.model.bind("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.bind("add",this.add,this);this.model.hdas.bind("reset",this.addAll,this);this.model.hdas.bind("all",this.all,this);this.hdaViews={};this.urls={}},add:function(a){},addAll:function(){this.render()},all:function(a){},renderUrls:function(a){var b=this;b.urls={};_.each(this.urlTemplates,function(d,c){b.urls[c]=_.template(d,a)});return b.urls},render:function(){var b=this,d=b.toString()+".set-up",c=$("
"),a=this.model.toJSON(),e=(this.$el.children().size()===0);a.urls=this.renderUrls(a);c.append(HistoryPanel.templates.historyPanel(a));c.find(".tooltip").tooltip({placement:"bottom"});this.setUpActionButton(c.find("#history-action-popup"));if(!this.model.hdas.length||!this.renderItems(c.find("#"+this.model.get("id")+"-datasets"))){c.find("#emptyHistoryMessage").show()}$(b).queue(d,function(f){b.$el.fadeOut("fast",function(){f()})});$(b).queue(d,function(f){b.$el.html("");b.$el.append(c.children());b.$el.fadeIn("fast",function(){f()})});$(b).queue(d,function(f){this.log(b+" rendered:",b.$el);b.setUpBehaviours();if(e){b.trigger("rendered:initial")}else{b.trigger("rendered")}f()});$(b).dequeue(d);return this},setUpActionButton:function(e){var c=this,d=(this.storage.get("show_deleted"))?("Hide deleted"):("Show deleted"),a=(this.storage.get("show_hidden"))?("Hide hidden"):("Show hidden"),b={};b[_l("refresh")]=function(){window.location.reload()};b[_l("collapse all")]=function(){c.hideAllHdaBodies()};b[_l(d)]=function(){c.toggleShowDeleted()};b[_l(a)]=function(){c.toggleShowHidden()};make_popupmenu(e,b)},renderItems:function(b){this.hdaViews={};var a=this,c=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"));_.each(c,function(f){var e=f.get("id"),d=a.storage.get("expandedHdas").get(e);a.hdaViews[e]=new HDAView({model:f,expanded:d,urlTemplates:a.hdaUrlTemplates});a.setUpHdaListeners(a.hdaViews[e]);b.prepend(a.hdaViews[e].render().$el)});return c.length},setUpHdaListeners:function(b){var a=this;b.bind("toggleBodyVisibility",function(d,c){if(c){a.storage.get("expandedHdas").set(d,true)}else{a.storage.get("expandedHdas").deleteKey(d)}})},setUpBehaviours:function(){if(!(this.model.get("user")&&this.model.get("user").email)){return}var a=this.$("#history-annotation-area");this.$("#history-annotate").click(function(){if(a.is(":hidden")){a.slideDown("fast")}else{a.slideUp("fast")}return false});async_save_text("history-name-container","history-name",this.urls.rename,"new_name",18);async_save_text("history-annotation-container","history-annotation",this.urls.annotate,"new_annotation",18,true,4)},updateHistoryDiskSize:function(){this.$el.find("#history-size").text(this.model.get("nice_size"))},events:{"click #history-tag":"loadAndDisplayTags"},showQuotaMessage:function(a){var b=this.$el.find("#quota-message-container");if(b.is(":hidden")){b.slideDown("fast")}},hideQuotaMessage:function(a){var b=this.$el.find("#quota-message-container");if(!b.is(":hidden")){b.slideUp("fast")}},toggleShowDeleted:function(a,c,b){this.storage.set("show_deleted",!this.storage.get("show_deleted"));this.render()},toggleShowHidden:function(){this.storage.set("show_hidden",!this.storage.get("show_hidden"));this.render()},hideAllHdaBodies:function(){_.each(this.hdaViews,function(a){a.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{})},loadAndDisplayTags:function(c){this.log(this+".loadAndDisplayTags",c);var d=this.$el.find("#history-tag-area"),b=d.find(".tag-elt");this.log("\t tagArea",d," tagElt",b);if(d.is(":hidden")){if(!jQuery.trim(b.html())){var a=this;$.ajax({url:a.urls.tag,error:function(){alert(_l("Tagging failed"))},success:function(e){b.html(e);b.find(".tooltip").tooltip();d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},toString:function(){var a=this.model.get("name")||"";return"HistoryView("+a+")"}});HistoryPanel.templates={historyPanel:Handlebars.templates["template-history-historyPanel"]}; \ No newline at end of file +var HistoryPanel=BaseView.extend(LoggableMixin).extend({el:"body.historyPage",HDAView:HDAEditView,initialize:function(a){this.log(this+".initialize:",a);if(!a.urlTemplates){throw (this+" needs urlTemplates on initialize")}if(!a.urlTemplates.history){throw (this+" needs urlTemplates.history on initialize")}if(!a.urlTemplates.hda){throw (this+" needs urlTemplates.hda on initialize")}this.urlTemplates=a.urlTemplates.history;this.hdaUrlTemplates=a.urlTemplates.hda;this.storage=new PersistantStorage("HistoryView."+this.model.get("id"),{expandedHdas:{},show_deleted:false,show_hidden:false});this.log("this.storage:",this.storage.get());this.log("show_deleted:",a.show_deleted,"show_hidden",a.show_hidden);if((a.show_deleted===true)||(a.show_deleted===false)){this.storage.set("show_deleted",a.show_deleted)}if((a.show_hidden===true)||(a.show_hidden===false)){this.storage.set("show_hidden",a.show_hidden)}this.show_deleted=this.storage.get("show_deleted");this.show_hidden=this.storage.get("show_hidden");this.log("this.show_deleted:",this.show_deleted,"show_hidden",this.show_hidden);this.log("(now) this.storage:",this.storage.get());this.model.bind("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.bind("add",this.add,this);this.model.hdas.bind("reset",this.addAll,this);this.model.hdas.bind("all",this.all,this);this.hdaViews={};this.urls={}},add:function(a){},addAll:function(){this.render()},all:function(a){},renderUrls:function(a){var b=this;b.urls={};_.each(this.urlTemplates,function(d,c){b.urls[c]=_.template(d,a)});return b.urls},render:function(){var b=this,d=b.toString()+".set-up",c=$("
"),a=this.model.toJSON(),e=(this.$el.children().size()===0);a.urls=this.renderUrls(a);c.append(HistoryPanel.templates.historyPanel(a));c.find(".tooltip").tooltip({placement:"bottom"});this.setUpActionButton(c.find("#history-action-popup"));if(!this.model.hdas.length||!this.renderItems(c.find("#"+this.model.get("id")+"-datasets"))){c.find("#emptyHistoryMessage").show()}$(b).queue(d,function(f){b.$el.fadeOut("fast",function(){f()})});$(b).queue(d,function(f){b.$el.html("");b.$el.append(c.children());b.$el.fadeIn("fast",function(){f()})});$(b).queue(d,function(f){this.log(b+" rendered:",b.$el);b.setUpBehaviours();if(e){b.trigger("rendered:initial")}else{b.trigger("rendered")}f()});$(b).dequeue(d);return this},setUpActionButton:function(e){var c=this,d=(this.storage.get("show_deleted"))?("Hide deleted"):("Show deleted"),a=(this.storage.get("show_hidden"))?("Hide hidden"):("Show hidden"),b={};b[_l("refresh")]=function(){window.location.reload()};b[_l("collapse all")]=function(){c.hideAllHdaBodies()};b[_l(d)]=function(){c.toggleShowDeleted()};b[_l(a)]=function(){c.toggleShowHidden()};make_popupmenu(e,b)},renderItems:function(b){this.hdaViews={};var a=this,c=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"));_.each(c,function(f){var e=f.get("id"),d=a.storage.get("expandedHdas").get(e);a.hdaViews[e]=new a.HDAView({model:f,expanded:d,urlTemplates:a.hdaUrlTemplates});a.setUpHdaListeners(a.hdaViews[e]);b.prepend(a.hdaViews[e].render().$el)});return c.length},setUpHdaListeners:function(b){var a=this;b.bind("body-visible",function(c){a.storage.get("expandedHdas").set(c,true)});b.bind("body-hidden",function(c){a.storage.get("expandedHdas").deleteKey(c)})},setUpBehaviours:function(){if(!(this.model.get("user")&&this.model.get("user").email)){return}var a=this.$("#history-annotation-area");this.$("#history-annotate").click(function(){if(a.is(":hidden")){a.slideDown("fast")}else{a.slideUp("fast")}return false});async_save_text("history-name-container","history-name",this.urls.rename,"new_name",18);async_save_text("history-annotation-container","history-annotation",this.urls.annotate,"new_annotation",18,true,4)},updateHistoryDiskSize:function(){this.$el.find("#history-size").text(this.model.get("nice_size"))},events:{"click #history-tag":"loadAndDisplayTags"},showQuotaMessage:function(a){var b=this.$el.find("#quota-message-container");if(b.is(":hidden")){b.slideDown("fast")}},hideQuotaMessage:function(a){var b=this.$el.find("#quota-message-container");if(!b.is(":hidden")){b.slideUp("fast")}},toggleShowDeleted:function(a,c,b){this.storage.set("show_deleted",!this.storage.get("show_deleted"));this.render()},toggleShowHidden:function(){this.storage.set("show_hidden",!this.storage.get("show_hidden"));this.render()},hideAllHdaBodies:function(){_.each(this.hdaViews,function(a){a.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{})},loadAndDisplayTags:function(c){this.log(this+".loadAndDisplayTags",c);var d=this.$el.find("#history-tag-area"),b=d.find(".tag-elt");this.log("\t tagArea",d," tagElt",b);if(d.is(":hidden")){if(!jQuery.trim(b.html())){var a=this;$.ajax({url:a.urls.tag,error:function(){alert(_l("Tagging failed"))},success:function(e){b.html(e);b.find(".tooltip").tooltip();d.slideDown("fast")}})}else{d.slideDown("fast")}}else{d.slideUp("fast")}return false},toString:function(){var a=this.model.get("name")||"";return"HistoryView("+a+")"}});HistoryPanel.templates={historyPanel:Handlebars.templates["template-history-historyPanel"]}; \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-hda-annotationArea.js b/static/scripts/packed/templates/compiled/template-hda-annotationArea.js new file mode 100644 index 00000000000..04d38429345 --- /dev/null +++ b/static/scripts/packed/templates/compiled/template-hda-annotationArea.js @@ -0,0 +1 @@ +(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-annotationArea"]=b(function(g,n,f,m,l){f=f||g.helpers;var j="",d,i,h="function",k=this.escapeExpression,p=this,o=f.blockHelperMissing;function e(r,q){return"Annotation"}function c(r,q){return"Edit dataset annotation"}j+='\n';return j})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-hda-displayApps.js b/static/scripts/packed/templates/compiled/template-hda-displayApps.js new file mode 100644 index 00000000000..07e9108a5fc --- /dev/null +++ b/static/scripts/packed/templates/compiled/template-hda-displayApps.js @@ -0,0 +1 @@ +(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-displayApps"]=b(function(h,m,g,l,k){g=g||h.helpers;var d,i="function",j=this.escapeExpression,o=this,n=g.blockHelperMissing;function f(t,s){var q="",r,p;q+="\n ";p=g.label;if(p){r=p.call(t,{hash:{}})}else{r=t.label;r=typeof r===i?r():r}q+=j(r)+"\n ";r=t.links;r=g.each.call(t,r,{hash:{},inverse:o.noop,fn:o.program(2,e,s)});if(r||r===0){q+=r}q+="\n
\n";return q}function e(t,s){var q="",r,p;q+='\n ';p=g.local;if(p){r=p.call(t,{hash:{},inverse:o.noop,fn:o.program(3,c,s)})}else{r=t.local;r=typeof r===i?r():r}if(!g.local){r=n.call(t,r,{hash:{},inverse:o.noop,fn:o.program(3,c,s)})}if(r||r===0){q+=r}q+="\n ";return q}function c(s,r){var q,p;p=g.text;if(p){q=p.call(s,{hash:{}})}else{q=s.text;q=typeof q===i?q():q}return j(q)}d=m.displayApps;d=g.each.call(m,d,{hash:{},inverse:o.noop,fn:o.program(1,f,k)});if(d||d===0){return d}else{return""}})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-hda-downloadLinks.js b/static/scripts/packed/templates/compiled/template-hda-downloadLinks.js new file mode 100644 index 00000000000..282d47d3a81 --- /dev/null +++ b/static/scripts/packed/templates/compiled/template-hda-downloadLinks.js @@ -0,0 +1 @@ +(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-downloadLinks"]=b(function(g,q,p,k,t){p=p||g.helpers;var h,e="function",d=this.escapeExpression,o=this,c=p.blockHelperMissing;function n(y,x){var v="",w,u;v+="\n";v+='\n\n\n';return v}function m(v,u){return"Download Dataset"}function l(v,u){return"Additional Files"}function j(y,x){var v="",w,u;v+='\n ';u=p.local;if(u){w=u.call(y,{hash:{},inverse:o.noop,fn:o.program(7,i,x)})}else{w=y.local;w=typeof w===e?w():w}if(!p.local){w=c.call(y,w,{hash:{},inverse:o.noop,fn:o.program(7,i,x)})}if(w||w===0){v+=w}v+=" ";u=p.file_type;if(u){w=u.call(y,{hash:{}})}else{w=y.file_type;w=typeof w===e?w():w}v+=d(w)+"\n ";return v}function i(v,u){return"Download"}function f(v,u){return"Download"}function s(y,x){var v="",w,u;v+="\n";v+='\n\n';return v}function r(v,u){return"Download"}h=q.urls;h=h==null||h===false?h:h.meta_download;h=p["if"].call(q,h,{hash:{},inverse:o.program(11,s,t),fn:o.program(1,n,t)});if(h||h===0){return h}else{return""}})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-hda-failedMetaData.js b/static/scripts/packed/templates/compiled/template-hda-failedMetaData.js new file mode 100644 index 00000000000..d743693ce2c --- /dev/null +++ b/static/scripts/packed/templates/compiled/template-hda-failedMetaData.js @@ -0,0 +1 @@ +(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-failedMetaData"]=b(function(g,m,f,l,k){f=f||g.helpers;var c,i,o=this,h="function",n=f.blockHelperMissing,j=this.escapeExpression;function e(t,s){var q="",r,p;q+="\n";p=f.local;if(p){r=p.call(t,{hash:{},inverse:o.noop,fn:o.program(2,d,s)})}else{r=t.local;r=typeof r===h?r():r}if(!f.local){r=n.call(t,r,{hash:{},inverse:o.noop,fn:o.program(2,d,s)})}if(r||r===0){q+=r}q+='\nYou may be able to set it manually or retry auto-detection.\n';return q}function d(q,p){return"An error occurred setting the metadata for this dataset."}i=f.warningmessagesmall;if(i){c=i.call(m,{hash:{},inverse:o.noop,fn:o.program(1,e,k)})}else{c=m.warningmessagesmall;c=typeof c===h?c():c}if(!f.warningmessagesmall){c=n.call(m,c,{hash:{},inverse:o.noop,fn:o.program(1,e,k)})}if(c||c===0){return c}else{return""}})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-hda-hdaSummary.js b/static/scripts/packed/templates/compiled/template-hda-hdaSummary.js new file mode 100644 index 00000000000..14abcd337ff --- /dev/null +++ b/static/scripts/packed/templates/compiled/template-hda-hdaSummary.js @@ -0,0 +1 @@ +(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-hdaSummary"]=b(function(g,n,f,m,l){f=f||g.helpers;var j="",d,i,h="function",k=this.escapeExpression,p=this;function e(u,t){var r="",s,q;r+='\n \n ";return r}function c(u,t){var r="",s,q;r+='\n \n ";return r}function o(u,t){var r="",s,q;r+='\n
';q=f.misc_info;if(q){s=q.call(u,{hash:{}})}else{s=u.misc_info;s=typeof s===h?s():s}r+=k(s)+"
\n";return r}j+='
\n ';i=f.misc_blurb;if(i){d=i.call(n,{hash:{}})}else{d=n.misc_blurb;d=typeof d===h?d():d}j+=k(d)+'
\n format: ';i=f.data_type;if(i){d=i.call(n,{hash:{}})}else{d=n.data_type;d=typeof d===h?d():d}j+=k(d)+",\n database:\n ";d=n.dbkey_unknown_and_editable;d=f["if"].call(n,d,{hash:{},inverse:p.program(3,c,l),fn:p.program(1,e,l)});if(d||d===0){j+=d}j+="\n
\n";d=n.misc_info;d=f["if"].call(n,d,{hash:{},inverse:p.noop,fn:p.program(5,o,l)});if(d||d===0){j+=d}return j})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-hda-tagArea.js b/static/scripts/packed/templates/compiled/template-hda-tagArea.js new file mode 100644 index 00000000000..d8e64287897 --- /dev/null +++ b/static/scripts/packed/templates/compiled/template-hda-tagArea.js @@ -0,0 +1 @@ +(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-tagArea"]=b(function(f,l,e,k,j){e=e||f.helpers;var i="",c,h,n=this,g="function",m=e.blockHelperMissing;function d(p,o){return"Tags"}i+='\n';return i})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-hda-titleLink.js b/static/scripts/packed/templates/compiled/template-hda-titleLink.js new file mode 100644 index 00000000000..56b831c1e43 --- /dev/null +++ b/static/scripts/packed/templates/compiled/template-hda-titleLink.js @@ -0,0 +1 @@ +(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-titleLink"]=b(function(e,l,d,k,j){d=d||e.helpers;var h="",c,g,f="function",i=this.escapeExpression;h+='';g=d.hid;if(g){c=g.call(l,{hash:{}})}else{c=l.hid;c=typeof c===f?c():c}h+=i(c)+": ";g=d.name;if(g){c=g.call(l,{hash:{}})}else{c=l.name;c=typeof c===f?c():c}h+=i(c)+"";return h})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-hda-warning-messages.js b/static/scripts/packed/templates/compiled/template-hda-warning-messages.js new file mode 100644 index 00000000000..025c41def9a --- /dev/null +++ b/static/scripts/packed/templates/compiled/template-hda-warning-messages.js @@ -0,0 +1 @@ +(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-hda-warning-messages"]=b(function(g,s,q,k,z){q=q||g.helpers;var r="",h,e="function",d=this.escapeExpression,p=this,c=q.blockHelperMissing;function o(C,B){var A;A=C.purged;A=q.unless.call(C,A,{hash:{},inverse:p.noop,fn:p.program(2,n,B)});if(A||A===0){return A}else{return""}}function n(E,D){var B="",C,A;B+="\n";A=q.warningmessagesmall;if(A){C=A.call(E,{hash:{},inverse:p.noop,fn:p.program(3,m,D)})}else{C=E.warningmessagesmall;C=typeof C===e?C():C}if(!q.warningmessagesmall){C=c.call(E,C,{hash:{},inverse:p.noop,fn:p.program(3,m,D)})}if(C||C===0){B+=C}B+="\n";return B}function m(E,D){var B="",C,A;B+="\n ";A=q.local;if(A){C=A.call(E,{hash:{},inverse:p.noop,fn:p.program(4,l,D)})}else{C=E.local;C=typeof C===e?C():C}if(!q.local){C=c.call(E,C,{hash:{},inverse:p.noop,fn:p.program(4,l,D)})}if(C||C===0){B+=C}B+="\n ";C=E.urls;C=C==null||C===false?C:C.undelete;C=q["if"].call(E,C,{hash:{},inverse:p.noop,fn:p.program(6,j,D)});if(C||C===0){B+=C}B+="\n";return B}function l(B,A){return"This dataset has been deleted."}function j(E,D){var B="",C,A;B+="\n ";B+='\n Click here to undelete it\n ';C=E.urls;C=C==null||C===false?C:C.purge;C=q["if"].call(E,C,{hash:{},inverse:p.noop,fn:p.program(7,i,D)});if(C||C===0){B+=C}B+="\n ";return B}function i(E,D){var B="",C,A;B+='\n or here to immediately remove it from disk\n ';return B}function f(D,C){var B,A;A=q.warningmessagesmall;if(A){B=A.call(D,{hash:{},inverse:p.noop,fn:p.program(10,y,C)})}else{B=D.warningmessagesmall;B=typeof B===e?B():B}if(!q.warningmessagesmall){B=c.call(D,B,{hash:{},inverse:p.noop,fn:p.program(10,y,C)})}if(B||B===0){return B}else{return""}}function y(E,D){var B="",C,A;B+="\n ";A=q.local;if(A){C=A.call(E,{hash:{},inverse:p.noop,fn:p.program(11,x,D)})}else{C=E.local;C=typeof C===e?C():C}if(!q.local){C=c.call(E,C,{hash:{},inverse:p.noop,fn:p.program(11,x,D)})}if(C||C===0){B+=C}B+="\n";return B}function x(B,A){return"This dataset has been deleted and removed from disk."}function w(D,C){var B,A;A=q.warningmessagesmall;if(A){B=A.call(D,{hash:{},inverse:p.noop,fn:p.program(14,v,C)})}else{B=D.warningmessagesmall;B=typeof B===e?B():B}if(!q.warningmessagesmall){B=c.call(D,B,{hash:{},inverse:p.noop,fn:p.program(14,v,C)})}if(B||B===0){return B}else{return""}}function v(E,D){var B="",C,A;B+="\n ";A=q.local;if(A){C=A.call(E,{hash:{},inverse:p.noop,fn:p.program(15,u,D)})}else{C=E.local;C=typeof C===e?C():C}if(!q.local){C=c.call(E,C,{hash:{},inverse:p.noop,fn:p.program(15,u,D)})}if(C||C===0){B+=C}B+="\n ";C=E.urls;C=C==null||C===false?C:C.unhide;C=q["if"].call(E,C,{hash:{},inverse:p.noop,fn:p.program(17,t,D)});if(C||C===0){B+=C}B+="\n";return B}function u(B,A){return"This dataset has been hidden."}function t(E,D){var B="",C,A;B+='\n Click here to unhide it\n ';return B}h=s.deleted;h=q["if"].call(s,h,{hash:{},inverse:p.noop,fn:p.program(1,o,z)});if(h||h===0){r+=h}r+="\n\n";h=s.purged;h=q["if"].call(s,h,{hash:{},inverse:p.noop,fn:p.program(9,f,z)});if(h||h===0){r+=h}r+="\n\n";h=s.visible;h=q.unless.call(s,h,{hash:{},inverse:p.noop,fn:p.program(13,w,z)});if(h||h===0){r+=h}return r})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-history-annotationArea.js b/static/scripts/packed/templates/compiled/template-history-annotationArea.js deleted file mode 100644 index 8ef02fc4622..00000000000 --- a/static/scripts/packed/templates/compiled/template-history-annotationArea.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-annotationArea"]=b(function(g,n,f,m,l){f=f||g.helpers;var j="",d,i,h="function",k=this.escapeExpression,p=this,o=f.blockHelperMissing;function e(r,q){return"Annotation"}function c(r,q){return"Edit dataset annotation"}j+='\n';return j})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-history-displayApps.js b/static/scripts/packed/templates/compiled/template-history-displayApps.js deleted file mode 100644 index 2bf56cad46c..00000000000 --- a/static/scripts/packed/templates/compiled/template-history-displayApps.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-displayApps"]=b(function(h,m,g,l,k){g=g||h.helpers;var d,i="function",j=this.escapeExpression,o=this,n=g.blockHelperMissing;function f(t,s){var q="",r,p;q+="\n ";p=g.label;if(p){r=p.call(t,{hash:{}})}else{r=t.label;r=typeof r===i?r():r}q+=j(r)+"\n ";r=t.links;r=g.each.call(t,r,{hash:{},inverse:o.noop,fn:o.program(2,e,s)});if(r||r===0){q+=r}q+="\n
\n";return q}function e(t,s){var q="",r,p;q+='\n ';p=g.local;if(p){r=p.call(t,{hash:{},inverse:o.noop,fn:o.program(3,c,s)})}else{r=t.local;r=typeof r===i?r():r}if(!g.local){r=n.call(t,r,{hash:{},inverse:o.noop,fn:o.program(3,c,s)})}if(r||r===0){q+=r}q+="\n ";return q}function c(s,r){var q,p;p=g.text;if(p){q=p.call(s,{hash:{}})}else{q=s.text;q=typeof q===i?q():q}return j(q)}d=m.displayApps;d=g.each.call(m,d,{hash:{},inverse:o.noop,fn:o.program(1,f,k)});if(d||d===0){return d}else{return""}})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-history-downloadLinks.js b/static/scripts/packed/templates/compiled/template-history-downloadLinks.js deleted file mode 100644 index 2bfdacc4a34..00000000000 --- a/static/scripts/packed/templates/compiled/template-history-downloadLinks.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-downloadLinks"]=b(function(g,q,p,k,t){p=p||g.helpers;var h,e="function",d=this.escapeExpression,o=this,c=p.blockHelperMissing;function n(y,x){var v="",w,u;v+="\n";v+='\n\n\n';return v}function m(v,u){return"Download Dataset"}function l(v,u){return"Additional Files"}function j(y,x){var v="",w,u;v+='\n ';u=p.local;if(u){w=u.call(y,{hash:{},inverse:o.noop,fn:o.program(7,i,x)})}else{w=y.local;w=typeof w===e?w():w}if(!p.local){w=c.call(y,w,{hash:{},inverse:o.noop,fn:o.program(7,i,x)})}if(w||w===0){v+=w}v+=" ";u=p.file_type;if(u){w=u.call(y,{hash:{}})}else{w=y.file_type;w=typeof w===e?w():w}v+=d(w)+"\n ";return v}function i(v,u){return"Download"}function f(v,u){return"Download"}function s(y,x){var v="",w,u;v+="\n";v+='\n\n';return v}function r(v,u){return"Download"}h=q.urls;h=h==null||h===false?h:h.meta_download;h=p["if"].call(q,h,{hash:{},inverse:o.program(11,s,t),fn:o.program(1,n,t)});if(h||h===0){return h}else{return""}})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-history-failedMetaData.js b/static/scripts/packed/templates/compiled/template-history-failedMetaData.js deleted file mode 100644 index dc3f8b569bd..00000000000 --- a/static/scripts/packed/templates/compiled/template-history-failedMetaData.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-failedMetaData"]=b(function(g,m,f,l,k){f=f||g.helpers;var c,i,o=this,h="function",n=f.blockHelperMissing,j=this.escapeExpression;function e(t,s){var q="",r,p;q+="\n";p=f.local;if(p){r=p.call(t,{hash:{},inverse:o.noop,fn:o.program(2,d,s)})}else{r=t.local;r=typeof r===h?r():r}if(!f.local){r=n.call(t,r,{hash:{},inverse:o.noop,fn:o.program(2,d,s)})}if(r||r===0){q+=r}q+='\nYou may be able to set it manually or retry auto-detection.\n';return q}function d(q,p){return"An error occurred setting the metadata for this dataset."}i=f.warningmessagesmall;if(i){c=i.call(m,{hash:{},inverse:o.noop,fn:o.program(1,e,k)})}else{c=m.warningmessagesmall;c=typeof c===h?c():c}if(!f.warningmessagesmall){c=n.call(m,c,{hash:{},inverse:o.noop,fn:o.program(1,e,k)})}if(c||c===0){return c}else{return""}})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-history-hdaSummary.js b/static/scripts/packed/templates/compiled/template-history-hdaSummary.js deleted file mode 100644 index 3bfcefae012..00000000000 --- a/static/scripts/packed/templates/compiled/template-history-hdaSummary.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-hdaSummary"]=b(function(g,n,f,m,l){f=f||g.helpers;var j="",d,i,h="function",k=this.escapeExpression,p=this;function e(u,t){var r="",s,q;r+='\n ';q=f.metadata_dbkey;if(q){s=q.call(u,{hash:{}})}else{s=u.metadata_dbkey;s=typeof s===h?s():s}r+=k(s)+"\n ";return r}function c(u,t){var r="",s,q;r+='\n \n ";return r}function o(u,t){var r="",s,q;r+='\n
';q=f.misc_info;if(q){s=q.call(u,{hash:{}})}else{s=u.misc_info;s=typeof s===h?s():s}r+=k(s)+"
\n";return r}j+='
\n ';i=f.misc_blurb;if(i){d=i.call(n,{hash:{}})}else{d=n.misc_blurb;d=typeof d===h?d():d}j+=k(d)+'
\n format: ';i=f.data_type;if(i){d=i.call(n,{hash:{}})}else{d=n.data_type;d=typeof d===h?d():d}j+=k(d)+",\n database:\n ";d=n.dbkey_unknown_and_editable;d=f["if"].call(n,d,{hash:{},inverse:p.program(3,c,l),fn:p.program(1,e,l)});if(d||d===0){j+=d}j+="\n
\n";d=n.misc_info;d=f["if"].call(n,d,{hash:{},inverse:p.noop,fn:p.program(5,o,l)});if(d||d===0){j+=d}return j})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-history-tagArea.js b/static/scripts/packed/templates/compiled/template-history-tagArea.js deleted file mode 100644 index 2e0a3c98542..00000000000 --- a/static/scripts/packed/templates/compiled/template-history-tagArea.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-tagArea"]=b(function(f,l,e,k,j){e=e||f.helpers;var i="",c,h,n=this,g="function",m=e.blockHelperMissing;function d(p,o){return"Tags"}i+='\n';return i})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-history-titleLink.js b/static/scripts/packed/templates/compiled/template-history-titleLink.js deleted file mode 100644 index ad2e8c9eec2..00000000000 --- a/static/scripts/packed/templates/compiled/template-history-titleLink.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-titleLink"]=b(function(e,l,d,k,j){d=d||e.helpers;var h="",c,g,f="function",i=this.escapeExpression;h+='';g=d.hid;if(g){c=g.call(l,{hash:{}})}else{c=l.hid;c=typeof c===f?c():c}h+=i(c)+": ";g=d.name;if(g){c=g.call(l,{hash:{}})}else{c=l.name;c=typeof c===f?c():c}h+=i(c)+"";return h})})(); \ No newline at end of file diff --git a/static/scripts/packed/templates/compiled/template-history-warning-messages.js b/static/scripts/packed/templates/compiled/template-history-warning-messages.js deleted file mode 100644 index 8fda76f2022..00000000000 --- a/static/scripts/packed/templates/compiled/template-history-warning-messages.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-history-warning-messages"]=b(function(g,s,q,k,z){q=q||g.helpers;var r="",h,e="function",d=this.escapeExpression,p=this,c=q.blockHelperMissing;function o(C,B){var A;A=C.purged;A=q.unless.call(C,A,{hash:{},inverse:p.noop,fn:p.program(2,n,B)});if(A||A===0){return A}else{return""}}function n(E,D){var B="",C,A;B+="\n";A=q.warningmessagesmall;if(A){C=A.call(E,{hash:{},inverse:p.noop,fn:p.program(3,m,D)})}else{C=E.warningmessagesmall;C=typeof C===e?C():C}if(!q.warningmessagesmall){C=c.call(E,C,{hash:{},inverse:p.noop,fn:p.program(3,m,D)})}if(C||C===0){B+=C}B+="\n";return B}function m(E,D){var B="",C,A;B+="\n ";A=q.local;if(A){C=A.call(E,{hash:{},inverse:p.noop,fn:p.program(4,l,D)})}else{C=E.local;C=typeof C===e?C():C}if(!q.local){C=c.call(E,C,{hash:{},inverse:p.noop,fn:p.program(4,l,D)})}if(C||C===0){B+=C}B+="\n ";C=E.urls;C=C==null||C===false?C:C.undelete;C=q["if"].call(E,C,{hash:{},inverse:p.noop,fn:p.program(6,j,D)});if(C||C===0){B+=C}B+="\n";return B}function l(B,A){return"This dataset has been deleted."}function j(E,D){var B="",C,A;B+="\n ";B+='\n Click here to undelete it\n ';C=E.urls;C=C==null||C===false?C:C.purge;C=q["if"].call(E,C,{hash:{},inverse:p.noop,fn:p.program(7,i,D)});if(C||C===0){B+=C}B+="\n ";return B}function i(E,D){var B="",C,A;B+='\n or here to immediately remove it from disk\n ';return B}function f(D,C){var B,A;A=q.warningmessagesmall;if(A){B=A.call(D,{hash:{},inverse:p.noop,fn:p.program(10,y,C)})}else{B=D.warningmessagesmall;B=typeof B===e?B():B}if(!q.warningmessagesmall){B=c.call(D,B,{hash:{},inverse:p.noop,fn:p.program(10,y,C)})}if(B||B===0){return B}else{return""}}function y(E,D){var B="",C,A;B+="\n ";A=q.local;if(A){C=A.call(E,{hash:{},inverse:p.noop,fn:p.program(11,x,D)})}else{C=E.local;C=typeof C===e?C():C}if(!q.local){C=c.call(E,C,{hash:{},inverse:p.noop,fn:p.program(11,x,D)})}if(C||C===0){B+=C}B+="\n";return B}function x(B,A){return"This dataset has been deleted and removed from disk."}function w(D,C){var B,A;A=q.warningmessagesmall;if(A){B=A.call(D,{hash:{},inverse:p.noop,fn:p.program(14,v,C)})}else{B=D.warningmessagesmall;B=typeof B===e?B():B}if(!q.warningmessagesmall){B=c.call(D,B,{hash:{},inverse:p.noop,fn:p.program(14,v,C)})}if(B||B===0){return B}else{return""}}function v(E,D){var B="",C,A;B+="\n ";A=q.local;if(A){C=A.call(E,{hash:{},inverse:p.noop,fn:p.program(15,u,D)})}else{C=E.local;C=typeof C===e?C():C}if(!q.local){C=c.call(E,C,{hash:{},inverse:p.noop,fn:p.program(15,u,D)})}if(C||C===0){B+=C}B+="\n ";C=E.urls;C=C==null||C===false?C:C.unhide;C=q["if"].call(E,C,{hash:{},inverse:p.noop,fn:p.program(17,t,D)});if(C||C===0){B+=C}B+="\n";return B}function u(B,A){return"This dataset has been hidden."}function t(E,D){var B="",C,A;B+='\n Click here to unhide it\n ';return B}h=s.deleted;h=q["if"].call(s,h,{hash:{},inverse:p.noop,fn:p.program(1,o,z)});if(h||h===0){r+=h}r+="\n\n";h=s.purged;h=q["if"].call(s,h,{hash:{},inverse:p.noop,fn:p.program(9,f,z)});if(h||h===0){r+=h}r+="\n\n";h=s.visible;h=q.unless.call(s,h,{hash:{},inverse:p.noop,fn:p.program(13,w,z)});if(h||h===0){r+=h}return r})})(); \ No newline at end of file diff --git a/static/scripts/templates/compile_templates.py b/static/scripts/templates/compile_templates.py index 8a348306c25..511ad7bca0c 100755 --- a/static/scripts/templates/compile_templates.py +++ b/static/scripts/templates/compile_templates.py @@ -210,9 +210,11 @@ def main( options, args ): # delete multi template intermediate files print "\nCleaning up intermediate multi-template template files:" for filename in multi_template_template_filenames: - print 'removing', filename - os.remove( filename ) - + try: + print 'removing', filename + os.remove( filename ) + except Exception, exc: + print exc # ------------------------------------------------------------------------------ if __name__ == '__main__': diff --git a/static/scripts/templates/compiled/template-history-annotationArea.js b/static/scripts/templates/compiled/template-hda-annotationArea.js similarity index 95% rename from static/scripts/templates/compiled/template-history-annotationArea.js rename to static/scripts/templates/compiled/template-hda-annotationArea.js index f9e2b562648..0d135d72d99 100644 --- a/static/scripts/templates/compiled/template-history-annotationArea.js +++ b/static/scripts/templates/compiled/template-hda-annotationArea.js @@ -1,6 +1,6 @@ (function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; -templates['template-history-annotationArea'] = template(function (Handlebars,depth0,helpers,partials,data) { +templates['template-hda-annotationArea'] = template(function (Handlebars,depth0,helpers,partials,data) { helpers = helpers || Handlebars.helpers; var buffer = "", stack1, foundHelper, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing; diff --git a/static/scripts/templates/compiled/template-history-displayApps.js b/static/scripts/templates/compiled/template-hda-displayApps.js similarity index 95% rename from static/scripts/templates/compiled/template-history-displayApps.js rename to static/scripts/templates/compiled/template-hda-displayApps.js index a0d5d13ac8b..5d46dba604b 100644 --- a/static/scripts/templates/compiled/template-history-displayApps.js +++ b/static/scripts/templates/compiled/template-hda-displayApps.js @@ -1,6 +1,6 @@ (function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; -templates['template-history-displayApps'] = template(function (Handlebars,depth0,helpers,partials,data) { +templates['template-hda-displayApps'] = template(function (Handlebars,depth0,helpers,partials,data) { helpers = helpers || Handlebars.helpers; var stack1, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing; diff --git a/static/scripts/templates/compiled/template-history-downloadLinks.js b/static/scripts/templates/compiled/template-hda-downloadLinks.js similarity index 98% rename from static/scripts/templates/compiled/template-history-downloadLinks.js rename to static/scripts/templates/compiled/template-hda-downloadLinks.js index 87efdcab1e6..46d6e535011 100644 --- a/static/scripts/templates/compiled/template-history-downloadLinks.js +++ b/static/scripts/templates/compiled/template-hda-downloadLinks.js @@ -1,6 +1,6 @@ (function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; -templates['template-history-downloadLinks'] = template(function (Handlebars,depth0,helpers,partials,data) { +templates['template-hda-downloadLinks'] = template(function (Handlebars,depth0,helpers,partials,data) { helpers = helpers || Handlebars.helpers; var stack1, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing; diff --git a/static/scripts/templates/compiled/template-history-failedMetaData.js b/static/scripts/templates/compiled/template-hda-failedMetaData.js similarity index 94% rename from static/scripts/templates/compiled/template-history-failedMetaData.js rename to static/scripts/templates/compiled/template-hda-failedMetaData.js index ce0dcdb33fc..6dcacce84bd 100644 --- a/static/scripts/templates/compiled/template-history-failedMetaData.js +++ b/static/scripts/templates/compiled/template-hda-failedMetaData.js @@ -1,6 +1,6 @@ (function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; -templates['template-history-failedMetaData'] = template(function (Handlebars,depth0,helpers,partials,data) { +templates['template-hda-failedMetaData'] = template(function (Handlebars,depth0,helpers,partials,data) { helpers = helpers || Handlebars.helpers; var stack1, foundHelper, self=this, functionType="function", blockHelperMissing=helpers.blockHelperMissing, escapeExpression=this.escapeExpression; diff --git a/static/scripts/templates/compiled/template-history-hdaSummary.js b/static/scripts/templates/compiled/template-hda-hdaSummary.js similarity index 90% rename from static/scripts/templates/compiled/template-history-hdaSummary.js rename to static/scripts/templates/compiled/template-hda-hdaSummary.js index 5ec56c073b0..672fa0afe17 100644 --- a/static/scripts/templates/compiled/template-history-hdaSummary.js +++ b/static/scripts/templates/compiled/template-hda-hdaSummary.js @@ -1,13 +1,13 @@ (function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; -templates['template-history-hdaSummary'] = template(function (Handlebars,depth0,helpers,partials,data) { +templates['template-hda-hdaSummary'] = template(function (Handlebars,depth0,helpers,partials,data) { helpers = helpers || Handlebars.helpers; var buffer = "", stack1, foundHelper, functionType="function", escapeExpression=this.escapeExpression, self=this; function program1(depth0,data) { var buffer = "", stack1, foundHelper; - buffer += "\n "; + buffer += "\n
"; foundHelper = helpers.misc_info; if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); } else { stack1 = depth0.misc_info; stack1 = typeof stack1 === functionType ? stack1() : stack1; } - buffer += escapeExpression(stack1) + "
\n"; + buffer += escapeExpression(stack1) + "
\n"; return buffer;} buffer += "
\n "; diff --git a/static/scripts/templates/compiled/template-history-tagArea.js b/static/scripts/templates/compiled/template-hda-tagArea.js similarity index 90% rename from static/scripts/templates/compiled/template-history-tagArea.js rename to static/scripts/templates/compiled/template-hda-tagArea.js index 89088ceeade..0f406d569a4 100644 --- a/static/scripts/templates/compiled/template-history-tagArea.js +++ b/static/scripts/templates/compiled/template-hda-tagArea.js @@ -1,6 +1,6 @@ (function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; -templates['template-history-tagArea'] = template(function (Handlebars,depth0,helpers,partials,data) { +templates['template-hda-tagArea'] = template(function (Handlebars,depth0,helpers,partials,data) { helpers = helpers || Handlebars.helpers; var buffer = "", stack1, foundHelper, self=this, functionType="function", blockHelperMissing=helpers.blockHelperMissing; diff --git a/static/scripts/templates/compiled/template-history-titleLink.js b/static/scripts/templates/compiled/template-hda-titleLink.js similarity index 75% rename from static/scripts/templates/compiled/template-history-titleLink.js rename to static/scripts/templates/compiled/template-hda-titleLink.js index 3fb86a2ee6f..fe86702ee12 100644 --- a/static/scripts/templates/compiled/template-history-titleLink.js +++ b/static/scripts/templates/compiled/template-hda-titleLink.js @@ -1,11 +1,11 @@ (function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; -templates['template-history-titleLink'] = template(function (Handlebars,depth0,helpers,partials,data) { +templates['template-hda-titleLink'] = template(function (Handlebars,depth0,helpers,partials,data) { helpers = helpers || Handlebars.helpers; var buffer = "", stack1, foundHelper, functionType="function", escapeExpression=this.escapeExpression; - buffer += ""; + buffer += ""; foundHelper = helpers.hid; if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); } else { stack1 = depth0.hid; stack1 = typeof stack1 === functionType ? stack1() : stack1; } @@ -13,6 +13,6 @@ templates['template-history-titleLink'] = template(function (Handlebars,depth0,h foundHelper = helpers.name; if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); } else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1() : stack1; } - buffer += escapeExpression(stack1) + ""; + buffer += escapeExpression(stack1) + ""; return buffer;}); })(); \ No newline at end of file diff --git a/static/scripts/templates/compiled/template-history-warning-messages.js b/static/scripts/templates/compiled/template-hda-warning-messages.js similarity index 98% rename from static/scripts/templates/compiled/template-history-warning-messages.js rename to static/scripts/templates/compiled/template-hda-warning-messages.js index dc87227cfc0..459edc51e4f 100644 --- a/static/scripts/templates/compiled/template-history-warning-messages.js +++ b/static/scripts/templates/compiled/template-hda-warning-messages.js @@ -1,6 +1,6 @@ (function() { var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {}; -templates['template-history-warning-messages'] = template(function (Handlebars,depth0,helpers,partials,data) { +templates['template-hda-warning-messages'] = template(function (Handlebars,depth0,helpers,partials,data) { helpers = helpers || Handlebars.helpers; var buffer = "", stack1, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing; diff --git a/static/scripts/templates/hda-templates.html b/static/scripts/templates/hda-templates.html new file mode 100644 index 00000000000..c0757147247 --- /dev/null +++ b/static/scripts/templates/hda-templates.html @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/scripts/templates/history-templates.html b/static/scripts/templates/history-templates.html index 2daaafcb090..37ab78ce3f3 100644 --- a/static/scripts/templates/history-templates.html +++ b/static/scripts/templates/history-templates.html @@ -1,115 +1,11 @@ - - - - - - - - - - - - - - - -