<%! from galaxy.web.framework.helpers.grids import TextColumn, StateColumn, GridColumnFilter from galaxy.web.framework.helpers import iff %> ## Render a filter UI for a grid column. Filter is rendered as a table row. <%def name="render_grid_column_filter( grid, column )"> <% column_label = column.label if column.filterable == "advanced": column_label = column_label.lower() %> %if column.filterable == "advanced": ${column_label}: %endif %if isinstance(column, TextColumn):
## Carry forward filtering criteria with hidden inputs. %for temp_column in grid.columns: %if temp_column.key in cur_filter_dict: <% value = cur_filter_dict[ temp_column.key ] %> %if value != "All": <% if isinstance( temp_column, TextColumn ): value = h.to_json_string( value ) %> %endif %endif %endfor ## Print current filtering criteria and links to delete. %if column.key in cur_filter_dict: <% column_filter = cur_filter_dict[column.key] %> %if isinstance( column_filter, basestring ): %if column_filter != "All": ${cur_filter_dict[column.key]} <% filter_all = GridColumnFilter( "", { column.key : "All" } ) %> %endif %elif isinstance( column_filter, list ): %for i, filter in enumerate( column_filter ): %if i > 0: , %endif ${filter} <% new_filter = list( column_filter ) del new_filter[ i ] new_column_filter = GridColumnFilter( "", { column.key : h.to_json_string( new_filter ) } ) %> %endfor %endif %endif ## Print input field for column. <% value = iff( column.filterable == "standard", column.label.lower(), "") %>