details: http://www.bx.psu.edu/hg/galaxy/rev/d4ee51cd8bc9 changeset: 3214:d4ee51cd8bc9 user: jeremy goecks <jeremy.goecks@emory.edu> date: Thu Jan 07 14:52:07 2010 -0500 description: Fixed compatibility issues between pages and new tagging functionality. diffstat: lib/galaxy/web/controllers/page.py | 3 +- templates/grid_base.mako | 34 +++++++++++++++++---------- templates/grid_base_async.mako | 2 +- templates/page/display.mako | 2 +- templates/page/history_annotation_table.mako | 9 ++++--- templates/page/select_histories_grid.mako | 2 +- 6 files changed, 31 insertions(+), 21 deletions(-) diffs (174 lines): diff -r 5b99d58c6f54 -r d4ee51cd8bc9 lib/galaxy/web/controllers/page.py --- a/lib/galaxy/web/controllers/page.py Thu Jan 07 13:41:44 2010 -0500 +++ b/lib/galaxy/web/controllers/page.py Thu Jan 07 14:52:07 2010 -0500 @@ -112,7 +112,8 @@ # Grid definition. title = "Saved Histories" - template = "/page/select_histories_grid.mako" + template = "/page/select_histories_grid.mako" + async_template = "/page/select_histories_grid_async.mako" model_class = model.History default_filter = { "deleted" : "False" , "shared" : "All" } default_sort_key = "-update_time" diff -r 5b99d58c6f54 -r d4ee51cd8bc9 templates/grid_base.mako --- a/templates/grid_base.mako Thu Jan 07 13:41:44 2010 -0500 +++ b/templates/grid_base.mako Thu Jan 07 14:52:07 2010 -0500 @@ -775,13 +775,17 @@ </%def> ## Render grid. -<%def name="render_grid_table()"> +<%def name="render_grid_table(show_item_checkboxes=False)"> <% # Set flag to indicate whether grid has operations that operate on multiple items. multiple_item_ops_exist = False for operation in grid.operations: if operation.allow_multiple: multiple_item_ops_exist = True + + # Show checkboxes if flag is set or if multiple item ops exist. + if show_item_checkboxes or multiple_item_ops_exist: + show_item_checkboxes = True %> <form action="${url()}" method="post" onsubmit="return false;"> @@ -789,7 +793,9 @@ <table id='grid-table' class="grid"> <thead id="grid-table-header"> <tr> - <th></th> + %if show_item_checkboxes: + <th></th> + %endif %for column in grid.columns: %if column.visible: <% @@ -825,17 +831,17 @@ </tr> </thead> <tbody id="grid-table-body"> - ${render_grid_table_body_contents(multiple_item_ops_exist)} + ${render_grid_table_body_contents(show_item_checkboxes)} </tbody> <tfoot> - ${render_grid_table_footer_contents(multiple_item_ops_exist)} + ${render_grid_table_footer_contents(show_item_checkboxes)} </tfoot> </table> </form> </%def> ## Render grid table body contents. -<%def name="render_grid_table_body_contents(multiple_item_ops_exist=False)"> +<%def name="render_grid_table_body_contents(show_item_checkboxes=False)"> <% num_rows_rendered = 0 %> %if query.count() == 0: ## No results. @@ -849,11 +855,11 @@ %endif > ## Item selection column - <td style="width: 1.5em;"> - %if multiple_item_ops_exist: - <input type="checkbox" name="id" value=${trans.security.encode_id( item.id )} class="grid-row-select-checkbox" /> - %endif - </td> + %if show_item_checkboxes: + <td style="width: 1.5em;"> + <input type="checkbox" name="id" value=${trans.security.encode_id( item.id )} class="grid-row-select-checkbox" /> + </td> + %endif ## Data columns %for column in grid.columns: %if column.visible: @@ -925,7 +931,7 @@ </%def> ## Render grid table footer contents. -<%def name="render_grid_table_footer_contents(multiple_item_ops_exist=False)"> +<%def name="render_grid_table_footer_contents(show_item_checkboxes=False)"> ## Row for navigating among pages. <% # Mapping between item class and plural term for item. @@ -941,9 +947,11 @@ elif grid.model_class == Group: items_plural = "groups" %> + %if show_item_checkboxes: + <td></td> + %endif %if grid.use_paging and num_pages > 1: <tr id="page-links-row"> - <td></td> <td colspan="100"> <span id='page-link-container'> ## Page links. @@ -965,7 +973,7 @@ </tr> %endif ## Grid operations for multiple items. - %if multiple_item_ops_exist: + %if show_item_checkboxes: <tr> <td></td> <td colspan="100"> diff -r 5b99d58c6f54 -r d4ee51cd8bc9 templates/grid_base_async.mako --- a/templates/grid_base_async.mako Thu Jan 07 13:41:44 2010 -0500 +++ b/templates/grid_base_async.mako Thu Jan 07 14:52:07 2010 -0500 @@ -8,7 +8,7 @@ multiple_item_ops_exist = True %> -${render_grid_table_body_contents(multiple_item_ops_exist=multiple_item_ops_exist)} +${render_grid_table_body_contents(show_item_checkboxes=multiple_item_ops_exist)} ***** ${num_pages} ***** diff -r 5b99d58c6f54 -r d4ee51cd8bc9 templates/page/display.mako --- a/templates/page/display.mako Thu Jan 07 13:41:44 2010 -0500 +++ b/templates/page/display.mako Thu Jan 07 14:52:07 2010 -0500 @@ -194,7 +194,7 @@ %> </%def> -<%namespace file="../tagging_common.mako" import="render_tagging_element, render_community_tagging_element" /> +<%namespace file="../tagging_common.mako" import="render_individual_tagging_element, render_community_tagging_element" /> <%def name="center_panel()"> diff -r 5b99d58c6f54 -r d4ee51cd8bc9 templates/page/history_annotation_table.mako --- a/templates/page/history_annotation_table.mako Thu Jan 07 13:41:44 2010 -0500 +++ b/templates/page/history_annotation_table.mako Thu Jan 07 14:52:07 2010 -0500 @@ -1,4 +1,4 @@ -<%namespace file="../tagging_common.mako" import="render_individual_tagging_element_html" /> +<%namespace file="../tagging_common.mako" import="render_tagging_element_html" /> <%namespace file="../root/history_common.mako" import="render_dataset" /> <table> @@ -14,9 +14,10 @@ ${_('This is a deleted history.')} </div> %endif - %if trans.get_user() is not None: - Tags: ${render_individual_tagging_element_html( tags=history.tags, editable=False, use_toggle_link=False )} - %endif + ## Tags come for free with community tagging, so not sure if this is necessary. + ##%if trans.get_user() is not None: + ## Tags: ${render_tagging_element_html( tags=history.tags, editable=False, use_toggle_link=False )} + ##%endif </td> </tr> <tr> diff -r 5b99d58c6f54 -r d4ee51cd8bc9 templates/page/select_histories_grid.mako --- a/templates/page/select_histories_grid.mako Thu Jan 07 13:41:44 2010 -0500 +++ b/templates/page/select_histories_grid.mako Thu Jan 07 14:52:07 2010 -0500 @@ -4,7 +4,7 @@ ${javascripts()} ${stylesheets()} ${render_grid_header(False)} -${render_grid_table()} +${render_grid_table(show_item_checkboxes=True)} ## Initialize the grid. <script type="text/javascript">