Skip to content

Commit

Permalink
Add shared by other, load rendering through model
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Jun 6, 2017
1 parent 3208325 commit abe3b1e
Show file tree
Hide file tree
Showing 10 changed files with 56,592 additions and 47 deletions.
16 changes: 13 additions & 3 deletions client/galaxy/scripts/mvc/page/page-list.js
@@ -1,13 +1,23 @@
/** This class renders the page list. */
define( [ 'mvc/grid/grid-view' ], function( GridView ) {
define( [ 'utils/utils', 'mvc/grid/grid-view' ], function( Utils, GridView ) {
var View = Backbone.View.extend({
initialize: function( options ) {
var self = this;
this.setElement( $( '<div/>' ) );
grid = new GridView( { url_base: Galaxy.root + 'page/list', dict_format: true } );
this.$el.append( grid.$el );
this.model = new Backbone.Model();
Utils.get({
url : Galaxy.root + 'page/list',
success : function( response ) {
response[ 'dict_format' ] = true;
self.model.set( response );
self.render();
}
});
},

render: function() {
grid = new GridView( this.model.attributes );
this.$el.empty().append( grid.$el );
}
});

Expand Down
6 changes: 5 additions & 1 deletion lib/galaxy/webapps/galaxy/controllers/page.py
Expand Up @@ -337,7 +337,11 @@ def list( self, trans, *args, **kwargs ):
.all()

# Render grid wrapped in panels
return grid # shared_by_others }
grid[ 'shared_by_others' ] = [ {
'username' : p.page.user.username,
'slug' : p.page.slug,
'title' : p.page.title } for p in shared_by_others ]
return grid

@web.expose
@web.json
Expand Down
200 changes: 199 additions & 1 deletion static/scripts/bundled/admin.bundled.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/scripts/bundled/admin.bundled.js.map

Large diffs are not rendered by default.

23,938 changes: 23,922 additions & 16 deletions static/scripts/bundled/analysis.bundled.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/analysis.bundled.js.map

Large diffs are not rendered by default.

0 comments on commit abe3b1e

Please sign in to comment.