Skip to content

Commit

Permalink
Merge remote-tracking branch 'guerler/grid_saved_viz' into dev
Browse files Browse the repository at this point in the history
Rebuild and package-lock update.
  • Loading branch information
dannon committed Jul 19, 2017
2 parents 7351252 + 3bf019b commit fe038dc
Show file tree
Hide file tree
Showing 25 changed files with 5,935 additions and 2,597 deletions.
14 changes: 5 additions & 9 deletions client/galaxy/scripts/apps/analysis.js
Expand Up @@ -10,7 +10,7 @@ var jQuery = require( 'jquery' ),
CustomBuilds = require( 'mvc/user/user-custom-builds' ),
Tours = require( 'mvc/tours' ),
GridView = require( 'mvc/grid/grid-view' ),
PageList = require( 'mvc/page/page-list' ),
GridShared = require( 'mvc/grid/grid-shared' ),
Workflows = require( 'mvc/workflow/workflow' ),
HistoryList = require( 'mvc/history/history-list' ),
WorkflowsConfigureMenu = require( 'mvc/workflow/workflow-configure-menu' ),
Expand Down Expand Up @@ -88,7 +88,7 @@ window.app = function app( options, bootstrapped ){
'(/)workflow(/)' : 'show_workflows',
'(/)workflow/run(/)' : 'show_run',
'(/)pages(/)(:action_id)' : 'show_pages',
'(/)visualizations/list_published(/)' : 'show_visualizations',
'(/)visualizations/(:action_id)' : 'show_visualizations',
'(/)workflows/list_published(/)' : 'show_workflows_published',
'(/)histories(/)(:action_id)' : 'show_histories',
'(/)datasets(/)list(/)' : 'show_datasets',
Expand Down Expand Up @@ -128,8 +128,8 @@ window.app = function app( options, bootstrapped ){
this.page.display( new UserPreferences.Forms( { form_id: form_id, user_id: Galaxy.params.id } ) );
},

show_visualizations : function() {
this.page.display( new GridView( { url_base: Galaxy.root + 'visualization/list_published', dict_format: true } ) );
show_visualizations : function( action_id ) {
this.page.display( new GridShared.View( { action_id: action_id, plural: 'Visualizations', item: 'visualization' } ) );
},

show_workflows_published : function() {
Expand All @@ -145,11 +145,7 @@ window.app = function app( options, bootstrapped ){
},

show_pages : function( action_id ) {
if ( action_id == 'list' ) {
this.page.display( new PageList.View() );
} else {
this.page.display( new GridView( { url_base: Galaxy.root + 'page/list_published', dict_format: true } ) );
}
this.page.display( new GridShared.View( { action_id: action_id, plural: 'Pages', item: 'page' } ) );
},

show_workflows : function(){
Expand Down
4 changes: 2 additions & 2 deletions client/galaxy/scripts/layout/menu.js
Expand Up @@ -93,7 +93,7 @@ var Collection = Backbone.Collection.extend({
this.add({
id : 'visualization',
title : _l('Visualization'),
url : 'visualization/list',
url : 'visualizations/list',
tooltip : _l('Visualize datasets'),
disabled : !Galaxy.user.id,
menu : [{
Expand All @@ -102,7 +102,7 @@ var Collection = Backbone.Collection.extend({
target : '_frame'
},{
title : _l('Saved Visualizations'),
url : 'visualization/list',
url : 'visualizations/list',
target : '_frame'
},{
title : _l('Interactive Environments'),
Expand Down
@@ -1,12 +1,13 @@
/** This class renders the page list. */
define( [ 'utils/utils', 'mvc/grid/grid-view' ], function( Utils, GridView ) {
/** This class renders the grid list with shared section. */
define( [ 'mvc/grid/grid-view' ], function( GridView ) {
var View = Backbone.View.extend({
initialize: function( options ) {
var self = this;
this.setElement( $( '<div/>' ) );
this.model = new Backbone.Model();
Utils.get({
url : Galaxy.root + 'page/list',
this.model = new Backbone.Model( options );
this.item = this.model.get( 'item' );
$.ajax({
url : Galaxy.root + this.item + '/' + this.model.get( 'action_id' ),
success : function( response ) {
response[ 'dict_format' ] = true;
self.model.set( response );
Expand All @@ -22,8 +23,9 @@ define( [ 'utils/utils', 'mvc/grid/grid-view' ], function( Utils, GridView ) {
},

_templateShared: function() {
var self = this;
var $tmpl = $( '<div>' +
'<h2>Pages shared with you by others</h2>' +
'<h2>' + this.model.get( 'plural' ) + ' shared with you by others</h2>' +
'</div>' );
var options = this.model.attributes;
if ( options.shared_by_others && options.shared_by_others.length > 0 ) {
Expand All @@ -33,18 +35,18 @@ define( [ 'utils/utils', 'mvc/grid/grid-view' ], function( Utils, GridView ) {
'<th>Owner</th>' +
'</tr>' +
'</table>' );
_.each( options.shared_by_others, function( page, index ) {
var display_url = Galaxy.root + 'page/display_by_username_and_slug?username=' + page.username + '&slug=' + page.slug;
_.each( options.shared_by_others, function( it, index ) {
var display_url = Galaxy.root + self.item + '/display_by_username_and_slug?username=' + it.username + '&slug=' + it.slug;
$table.append( '<tr>' +
'<td>' +
'<a href="' + display_url + '">' + _.escape( page.title ) + '</a>' +
'<a href="' + display_url + '">' + _.escape( it.title ) + '</a>' +
'</td>' +
'<td>' + _.escape( page.username ) + '</td>' +
'<td>' + _.escape( it.username ) + '</td>' +
'</tr>' );
});
$tmpl.append( $table );
} else {
$tmpl.append( 'No pages have been shared with you.' );
$tmpl.append( 'No ' + this.model.get( 'plural' ).toLowerCase() + ' have been shared with you.' );
}
return $tmpl;
}
Expand Down
2 changes: 1 addition & 1 deletion client/galaxy/scripts/viz/circster.js
Expand Up @@ -1133,7 +1133,7 @@ var Circster = Backbone.View.extend(
{
icon_class: 'cross-circle', title: 'Close', on_click: function()
{
window.location = Galaxy.root + "visualization/list";
window.location = Galaxy.root + "visualizations/list";
}
}], { tooltip_config: { placement: 'bottom' } });

Expand Down
6 changes: 3 additions & 3 deletions client/galaxy/scripts/viz/trackster.js
Expand Up @@ -390,7 +390,7 @@ var TracksterView = Backbone.View.extend( {
),
buttons : {
"Cancel": function() {
window.location = Galaxy.root + "visualization/list";
window.location = Galaxy.root + "visualizations/list";
},
"View in saved visualization": function() {
self.view_in_saved( dataset_params );
Expand All @@ -414,7 +414,7 @@ var TracksterView = Backbone.View.extend( {
body : tracks_grid.$el,
buttons : {
"Cancel": function() {
window.location = Galaxy.root + "visualization/list";
window.location = Galaxy.root + "visualizations/list";
},
"Add to visualization": function() {
$(parent.document).find('input[name=id]:checked').each(function() {
Expand Down Expand Up @@ -459,7 +459,7 @@ var TracksterView = Backbone.View.extend( {
title : "New Visualization",
body : self.template_view_new(response),
buttons : {
"Cancel": function() { window.location = Galaxy.root + "visualization/list"; },
"Cancel": function() { window.location = Galaxy.root + "visualizations/list"; },
"Create": function() { self.create_browser($("#new-title").val(), $("#new-dbkey").val()); Galaxy.modal.hide(); }
}
});
Expand Down

0 comments on commit fe038dc

Please sign in to comment.