commit/galaxy-central: jgoecks: Some grid framework fixes.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/1c5aa1094c41/ changeset: 1c5aa1094c41 user: jgoecks date: 2012-11-27 00:25:52 summary: Some grid framework fixes. affected #: 5 files diff -r 8420c9a0f7308bbbd79c0a0db29dab063ff9070a -r 1c5aa1094c417760f0c48225f5a3dd8b71245b0e lib/galaxy/web/framework/helpers/grids.py --- a/lib/galaxy/web/framework/helpers/grids.py +++ b/lib/galaxy/web/framework/helpers/grids.py @@ -20,6 +20,7 @@ title = "" exposed = True model_class = None + show_item_checkboxes = False template = "grid_base.mako" async_template = "grid_base_async.mako" use_async = False @@ -273,7 +274,8 @@ message = message, use_panels=self.use_panels, webapp=webapp, - show_item_checkboxes = ( kwargs.get( 'show_item_checkboxes', '' ) in ['True', 'true'] ), + show_item_checkboxes = ( self.show_item_checkboxes or + kwargs.get( 'show_item_checkboxes', '' ) in [ 'True', 'true' ] ), # Pass back kwargs so that grid template can set and use args without # grid explicitly having to pass them. kwargs=kwargs ) diff -r 8420c9a0f7308bbbd79c0a0db29dab063ff9070a -r 1c5aa1094c417760f0c48225f5a3dd8b71245b0e lib/galaxy/webapps/galaxy/controllers/page.py --- a/lib/galaxy/webapps/galaxy/controllers/page.py +++ b/lib/galaxy/webapps/galaxy/controllers/page.py @@ -91,6 +91,7 @@ return item.name # Grid definition. + show_item_checkboxes = True template = "/page/select_items_grid.mako" async_template = "/page/select_items_grid_async.mako" default_filter = { "deleted" : "False" , "sharing" : "All" } diff -r 8420c9a0f7308bbbd79c0a0db29dab063ff9070a -r 1c5aa1094c417760f0c48225f5a3dd8b71245b0e templates/grid_base.mako --- a/templates/grid_base.mako +++ b/templates/grid_base.mako @@ -564,10 +564,13 @@ // HACK: use a simple string to separate the elements in the // response: (1) table body; (2) number of pages in table; and (3) message. var parsed_response_text = response_text.split("*****"); + console.log(parsed_response_text); // Update grid body and footer. $('#grid-table-body').html(parsed_response_text[0]); - $('#grid-table-footer').html(parsed_response_text[1]); + // FIXME: this does not work at all; what's needed is a function + // that updates page links when number of pages changes. + //$('#grid-table-footer').html(parsed_response_text[1]); // Trigger custom event to indicate grid body has changed. $('#grid-table-body').trigger('update'); @@ -906,7 +909,7 @@ %> Page: % if min_page > 1: - <span class='page-link'><a href="${url( page=1 )}" page_num="1">1</a></span> ... + <span class='page-link' id="page-link-1"><a href="${url( page=1 )}" page_num="1">1</a></span> ... % endif %for page_index in range(min_page, max_page + 1): %if page_index == cur_page_num: @@ -918,7 +921,7 @@ %endfor %if max_page < num_pages: ... - <span class='page-link'><a href="${url( page=num_pages )}" page_num="${num_pages}">${num_pages}</a></span> + <span class='page-link' id="page-link-${num_pages}"><a href="${url( page=num_pages )}" page_num="${num_pages}">${num_pages}</a></span> %endif </span> diff -r 8420c9a0f7308bbbd79c0a0db29dab063ff9070a -r 1c5aa1094c417760f0c48225f5a3dd8b71245b0e templates/page/select_items_grid.mako --- a/templates/page/select_items_grid.mako +++ b/templates/page/select_items_grid.mako @@ -1,7 +1,7 @@ ## Template generates a grid that enables user to select items. <%namespace file="../grid_base.mako" import="*" /> -${javascripts()} +${grid_javascripts()} ${stylesheets()} ${render_grid_header( grid, False )} ${render_grid_table( grid, show_item_checkboxes=True )} diff -r 8420c9a0f7308bbbd79c0a0db29dab063ff9070a -r 1c5aa1094c417760f0c48225f5a3dd8b71245b0e templates/page/select_items_grid_async.mako --- a/templates/page/select_items_grid_async.mako +++ b/templates/page/select_items_grid_async.mako @@ -2,7 +2,7 @@ <%namespace file="/display_common.mako" import="render_message" /> ## Always show item checkboxes so that users can select items. -${render_grid_table_body_contents( grid, show_item_checkboxes=True )} +${render_grid_table_body_contents( grid, show_item_checkboxes=show_item_checkboxes )} ***** ${num_pages} ***** Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket