[hg] galaxy 3530: Add functionality for inline editing of datase...
details: http://www.bx.psu.edu/hg/galaxy/rev/6d079d53f9db changeset: 3530:6d079d53f9db user: jeremy goecks <jeremy.goecks@emory.edu> date: Mon Mar 15 11:31:14 2010 -0400 description: Add functionality for inline editing of dataset tags and annotation in history panel (icons are currently opposite save/rerun icons). Various style and template fixes as well. diffstat: lib/galaxy/web/base/controller.py | 11 +- lib/galaxy/web/controllers/dataset.py | 31 ++++- lib/galaxy/web/controllers/page.py | 2 +- lib/galaxy/web/controllers/tag.py | 19 ++- lib/galaxy/web/framework/helpers/grids.py | 4 +- static/june_2007_style/autocomplete_tagging.css.tmpl | 5 + static/june_2007_style/base.css.tmpl | 9 +- static/june_2007_style/blue/autocomplete_tagging.css | 3 +- static/june_2007_style/blue/base.css | 3 +- templates/dataset/display.mako | 2 +- templates/dataset/embed.mako | 6 +- templates/display_base.mako | 2 +- templates/embed_base.mako | 20 ++- templates/grid_base_async.mako | 2 +- templates/root/history.mako | 110 ++++++++++++++++-- templates/root/history_common.mako | 18 ++- templates/tagging_common.mako | 6 +- 17 files changed, 203 insertions(+), 50 deletions(-) diffs (553 lines): diff -r 96ec861b4b6e -r 6d079d53f9db lib/galaxy/web/base/controller.py --- a/lib/galaxy/web/base/controller.py Sun Mar 14 11:49:44 2010 -0400 +++ b/lib/galaxy/web/base/controller.py Mon Mar 15 11:31:14 2010 -0400 @@ -62,7 +62,7 @@ def get_item_annotation_obj( self, db_session, user, item ): """ Returns a user's annotation object for an item. """ - # Get annotation association. TODO: we could replace this eval() with a long if/else stmt, but this is more general without sacrificing + # Get annotation association. try: annotation_assoc_class = eval( "model.%sAnnotationAssociation" % item.__class__.__name__ ) except: @@ -126,7 +126,7 @@ class UsesHistoryDatasetAssociation: """ Mixin for controllers that use HistoryDatasetAssociation objects. """ - def get_dataset( self, trans, dataset_id, check_accessible=True ): + def get_dataset( self, trans, dataset_id, check_ownership=True, check_accessible=False ): """ Get an HDA object by id. """ # DEPRECATION: We still support unencoded ids for backward compatibility try: @@ -136,6 +136,13 @@ data = trans.sa_session.query( model.HistoryDatasetAssociation ).get( dataset_id ) if not data: raise paste.httpexceptions.HTTPRequestRangeNotSatisfiable( "Invalid dataset id: %s." % str( dataset_id ) ) + if check_ownership: + # Verify ownership. + user = trans.get_user() + if not user: + error( "Must be logged in to manage Galaxy items" ) + if data.history.user != user: + error( "%s is not owned by current user" % data.__class__.__name__ ) if check_accessible: current_user_roles = trans.get_current_user_roles() if trans.app.security_agent.can_access_dataset( current_user_roles, data.dataset ): diff -r 96ec861b4b6e -r 6d079d53f9db lib/galaxy/web/controllers/dataset.py --- a/lib/galaxy/web/controllers/dataset.py Sun Mar 14 11:49:44 2010 -0400 +++ b/lib/galaxy/web/controllers/dataset.py Mon Mar 15 11:31:14 2010 -0400 @@ -5,6 +5,7 @@ from galaxy import util, datatypes, jobs, web, model from cgi import escape, FieldStorage from galaxy.datatypes.display_applications.util import encode_dataset_user, decode_dataset_user +from galaxy.util.sanitize_html import sanitize_html from email.MIMEText import MIMEText import pkg_resources; @@ -444,16 +445,14 @@ @web.require_login( "use Galaxy datasets" ) def get_name_and_link_async( self, trans, id=None ): """ Returns dataset's name and link. """ - dataset = self.get_dataset( trans, id ) + dataset = self.get_dataset( trans, id, False, True ) return_dict = { "name" : dataset.name, "link" : url_for( action="display_by_username_and_slug", username=dataset.history.user.username, slug=trans.security.encode_id( dataset.id ) ) } return return_dict @web.expose def get_embed_html_async( self, trans, id ): """ Returns HTML for embedding a dataset in a page. """ - - # TODO: user should be able to embed any item he has access to. see display_by_username_and_slug for security code. - dataset = self.get_dataset( trans, id ) + dataset = self.get_dataset( trans, id, False, True ) if dataset: return "Embedded Dataset '%s'" % dataset.name @@ -466,7 +465,7 @@ @web.expose def display_by_username_and_slug( self, trans, username, slug, preview=True ): """ Display dataset by username and slug; because datasets do not yet have slugs, the slug is the dataset's id. """ - dataset = self.get_dataset( trans, slug ) + dataset = self.get_dataset( trans, slug, False, True ) if dataset: truncated, dataset_data = self.get_data( dataset, preview ) dataset.annotation = self.get_item_annotation_str( trans.sa_session, dataset.history.user, dataset ) @@ -478,7 +477,7 @@ def get_item_content_async( self, trans, id ): """ Returns item content in HTML format. """ - dataset = self.get_dataset( trans, id ) + dataset = self.get_dataset( trans, id, False, True ) if dataset is None: raise web.httpexceptions.HTTPNotFound() truncated, dataset_data = self.get_data( dataset, preview=True ) @@ -486,6 +485,24 @@ dataset.annotation = self.get_item_annotation_str( trans.sa_session, trans.get_user(), dataset ) return trans.stream_template_mako( "/dataset/item_content.mako", item=dataset, item_data=dataset_data, truncated=truncated ) + @web.expose + def annotate_async( self, trans, id, new_annotation=None, **kwargs ): + dataset = self.get_dataset( trans, id, False, True ) + if not dataset: + web.httpexceptions.HTTPNotFound() + if dataset and new_annotation: + # Sanitize annotation before adding it. + new_annotation = sanitize_html( new_annotation, 'utf-8', 'text/html' ) + self.add_item_annotation( trans, dataset, new_annotation ) + trans.sa_session.flush() + return new_annotation + + @web.expose + def get_annotation_async( self, trans, id ): + dataset = self.get_dataset( trans, id, False, True ) + if not dataset: + web.httpexceptions.HTTPNotFound() + return self.get_item_annotation_str( trans.sa_session, trans.get_user(), dataset ) @web.expose def display_at( self, trans, dataset_id, filename=None, **kwd ): @@ -704,7 +721,7 @@ if user != history.user: error_msg = error_msg + "You do not have permission to add datasets to %i requested histories. " % ( len( target_histories ) ) for dataset_id in dataset_ids: - data = self.get_dataset( trans, dataset_id ) + data = self.get_dataset( trans, dataset_id, False, True ) if data is None: error_msg = error_msg + "You tried to copy a dataset that does not exist or that you do not have access to. " invalid_datasets += 1 diff -r 96ec861b4b6e -r 6d079d53f9db lib/galaxy/web/controllers/page.py --- a/lib/galaxy/web/controllers/page.py Sun Mar 14 11:49:44 2010 -0400 +++ b/lib/galaxy/web/controllers/page.py Mon Mar 15 11:31:14 2010 -0400 @@ -674,7 +674,7 @@ datasets = self.get_history_datasets( trans, history ) return trans.fill_template( "history/embed.mako", item=history, item_data=datasets ) elif item_class == model.HistoryDatasetAssociation: - dataset = self.get_dataset( trans, item_id ) + dataset = self.get_dataset( trans, item_id, False, True ) dataset.annotation = self.get_item_annotation_str( trans.sa_session, dataset.history.user, dataset ) if dataset: data = self.get_data( dataset ) diff -r 96ec861b4b6e -r 6d079d53f9db lib/galaxy/web/controllers/tag.py --- a/lib/galaxy/web/controllers/tag.py Sun Mar 14 11:49:44 2010 -0400 +++ b/lib/galaxy/web/controllers/tag.py Mon Mar 15 11:31:14 2010 -0400 @@ -11,12 +11,21 @@ def __init__(self, app): BaseController.__init__(self, app) - - # Set up tag handler to recognize the following items: History, HistoryDatasetAssociation, Page, ... self.tag_handler = TagHandler() + + @web.expose + @web.require_login( "edit item tags" ) + def get_tagging_elt_async( self, trans, item_id, item_class, elt_context="" ): + """ Returns HTML for editing an item's tags. """ + item = self._get_item( trans, item_class, trans.security.decode_id( item_id ) ) + if not item: + return trans.show_error_message( "No item of class %s with id % " % ( item_class, item_id ) ) + user = trans.get_user() + return trans.fill_template( "/tagging_common.mako", tag_type="individual", user=trans.get_user(), tagged_item=item, elt_context=elt_context, + in_form=False, input_size="22", tag_click_fn="default_tag_click_fn", use_toggle_link=False ) @web.expose - @web.require_login( "Add tag to an item." ) + @web.require_login( "add tag to an item" ) def add_tag_async( self, trans, item_id=None, item_class=None, new_tag=None, context=None ): """ Add tag to an item. """ @@ -28,10 +37,10 @@ # Log. params = dict( item_id=item.id, item_class=item_class, tag=new_tag) - trans.log_action( user, unicode( "tag"), context, params ) + trans.log_action( user, unicode( "tag" ), context, params ) @web.expose - @web.require_login( "Remove tag from an item." ) + @web.require_login( "remove tag from an item" ) def remove_tag_async( self, trans, item_id=None, item_class=None, tag_name=None, context=None ): """ Remove tag from an item. """ diff -r 96ec861b4b6e -r 6d079d53f9db lib/galaxy/web/framework/helpers/grids.py --- a/lib/galaxy/web/framework/helpers/grids.py Sun Mar 14 11:49:44 2010 -0400 +++ b/lib/galaxy/web/framework/helpers/grids.py Mon Mar 15 11:31:14 2010 -0400 @@ -389,7 +389,7 @@ self.grid_name = grid_name def get_value( self, trans, grid, item ): return trans.fill_template( "/tagging_common.mako", tag_type="community", trans=trans, user=trans.get_user(), tagged_item=item, elt_context=self.grid_name, - in_form=True, input_size="20", tag_click_fn="add_tag_to_grid_filter" ) + in_form=True, input_size="20", tag_click_fn="add_tag_to_grid_filter", use_toggle_link=True ) def filter( self, db_session, user, query, column_filter ): """ Modify query to filter model_class by tag. Multiple filters are ANDed. """ if column_filter == "All": @@ -418,7 +418,7 @@ """ Column that supports individual tags. """ def get_value( self, trans, grid, item ): return trans.fill_template( "/tagging_common.mako", tag_type="individual", trans=trans, user=trans.get_user(), tagged_item=item, elt_context=self.grid_name, - in_form=True, input_size="20", tag_click_fn="add_tag_to_grid_filter" ) + in_form=True, input_size="20", tag_click_fn="add_tag_to_grid_filter", use_toggle_link=True ) def get_filter( self, user, column_filter ): # Parse filter to extract multiple tags. tag_handler = TagHandler() diff -r 96ec861b4b6e -r 6d079d53f9db static/june_2007_style/autocomplete_tagging.css.tmpl --- a/static/june_2007_style/autocomplete_tagging.css.tmpl Sun Mar 14 11:49:44 2010 -0400 +++ b/static/june_2007_style/autocomplete_tagging.css.tmpl Mon Mar 15 11:31:14 2010 -0400 @@ -74,6 +74,11 @@ cursor: pointer; } +.individual-tag-area:hover +{ + border:dotted #999999 1px; +} + .active-tag-area { background-color: white; } diff -r 96ec861b4b6e -r 6d079d53f9db static/june_2007_style/base.css.tmpl --- a/static/june_2007_style/base.css.tmpl Sun Mar 14 11:49:44 2010 -0400 +++ b/static/june_2007_style/base.css.tmpl Mon Mar 15 11:31:14 2010 -0400 @@ -835,8 +835,7 @@ cursor:pointer; } -.editable-text:hover{ - background-image:url(); - background-repeat:no-repeat; - background-position:right; -} +.editable-text:hover { + cursor: text; + border: dotted #999999 1px; +} \ No newline at end of file diff -r 96ec861b4b6e -r 6d079d53f9db static/june_2007_style/blue/autocomplete_tagging.css --- a/static/june_2007_style/blue/autocomplete_tagging.css Sun Mar 14 11:49:44 2010 -0400 +++ b/static/june_2007_style/blue/autocomplete_tagging.css Mon Mar 15 11:31:14 2010 -0400 @@ -7,7 +7,8 @@ .ac_over{background-color:#0A246A;color:white;} .ac_header{font-style:normal;color:gray;border-bottom:0.1em solid gray;} .tag-area{width:100%;} -.individual-tag-area{border:solid 1px #eee;cursor:pointer;} +.individual-tag-area{cursor:pointer;} +.individual-tag-area:hover{border:dotted #999999 1px;} .active-tag-area{background-color:white;} .toggle-link{font-weight:normal;padding:0.3em;margin-bottom:1em;width:100%;padding:0.2em 0em 0.2em 0em;} .tag-button{width:auto;color:#444;text-decoration:none;display:inline-block;cursor:pointer;margin:0.2em;border:solid #bbb 1px;padding:0.1em 0.5em 0.1em 0.5em;-moz-border-radius:.5em;-webkit-border-radius:.5em;border-radius:.5em;background:#eee;} diff -r 96ec861b4b6e -r 6d079d53f9db static/june_2007_style/blue/base.css --- a/static/june_2007_style/blue/base.css Sun Mar 14 11:49:44 2010 -0400 +++ b/static/june_2007_style/blue/base.css Mon Mar 15 11:31:14 2010 -0400 @@ -145,4 +145,5 @@ .tipsy-east{background-position:right center;} .tipsy-west{background-position:left center;} .editable-text{cursor:pointer;} -.editable-text:hover{background-image:url();background-repeat:no-repeat;background-position:right;} +.editable-text:hover{cursor: text;border: dotted #999999 1px;} + diff -r 96ec861b4b6e -r 6d079d53f9db templates/dataset/display.mako --- a/templates/dataset/display.mako Sun Mar 14 11:49:44 2010 -0400 +++ b/templates/dataset/display.mako Mon Mar 15 11:31:14 2010 -0400 @@ -22,7 +22,7 @@ </%def> <%def name="render_item_links( data )"> - ## Provide links to save data and TODO: import dataset. + ## Provide links to save data and import dataset. <a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk tooltip" title="Save dataset"></a> <a href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}" class="icon-button import tooltip" title="Import dataset"></a> </%def> diff -r 96ec861b4b6e -r 6d079d53f9db templates/dataset/embed.mako --- a/templates/dataset/embed.mako Sun Mar 14 11:49:44 2010 -0400 +++ b/templates/dataset/embed.mako Mon Mar 15 11:31:14 2010 -0400 @@ -3,8 +3,12 @@ from galaxy.web.framework.helpers import iff %> -<%def name="render_item_specific_title_links( dataset )"> +<%def name="render_item_links( dataset )"> <a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( dataset.id ), to_ext=dataset.ext )}" title="Save dataset" class="icon-button disk tooltip"></a> + ## Links for importing and viewing an item. + <a href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( item.id ) )}" title="Import dataset" class="icon-button import tooltip"></a> + <a class="icon-button go-to-full-screen tooltip" href="${h.url_for( controller='/dataset', action='display_by_username_and_slug', username=dataset.history.user.username, slug=trans.security.encode_id( dataset.id ) )}" title="Go to dataset"></a> + </%def> <%def name="render_summary_content( dataset, data )"> diff -r 96ec861b4b6e -r 6d079d53f9db templates/display_base.mako --- a/templates/display_base.mako Sun Mar 14 11:49:44 2010 -0400 +++ b/templates/display_base.mako Mon Mar 15 11:31:14 2010 -0400 @@ -25,7 +25,7 @@ self.has_left_panel=False self.has_right_panel=True self.message_box_visible=False - self.active_view="user" + self.active_view="" self.overlay_visible=False %> </%def> diff -r 96ec861b4b6e -r 6d079d53f9db templates/embed_base.mako --- a/templates/embed_base.mako Sun Mar 14 11:49:44 2010 -0400 +++ b/templates/embed_base.mako Mon Mar 15 11:31:14 2010 -0400 @@ -18,8 +18,19 @@ </div> </div> -## Render item-specific title links. -<%def name="render_item_specific_title_links( item )"> +## Render item links. +<%def name="render_item_links( item )"> + <% + item_display_name = get_class_display_name( item.__class__ ).lower() + item_controller = "/%s" % get_controller_name( item ) + item_user = get_item_user( item ) + item_slug = get_item_slug( item ) + display_href = h.url_for( controller=item_controller, action='display_by_username_and_slug', username=item_user.username, slug=item_slug ) + %> + + ## Links for importing and viewing an item. + <a href="${h.url_for( controller=item_controller, action='imp', id=trans.security.encode_id( item.id ) )}" title="Import ${item_display_name}" class="icon-button import tooltip"></a> + <a class="icon-button go-to-full-screen tooltip" href="${display_href}" title="Go to ${item_display_name}"></a> </%def> <%def name="render_title( item )"> @@ -36,10 +47,7 @@ <a class="toggle-contract icon-button tooltip" href="${display_href}" title="Hide ${item_display_name} content"></a> </div> <div style="float: right"> - ${self.render_item_specific_title_links( item )} - ## Links applicable for all items. - <a href="${h.url_for( controller=item_controller, action='imp', id=trans.security.encode_id( item.id ) )}" title="Import ${item_display_name}" class="icon-button import tooltip"></a> - <a class="icon-button go-to-full-screen tooltip" href="${display_href}" title="Go to ${item_display_name}"></a> + ${self.render_item_links( item )} </div> <h4><a class="toggle-embed tooltip" href="${display_href}" title="Show or hide ${item_display_name} content">Galaxy ${get_class_display_name( item.__class__ )} | ${get_item_name( item )}</a></h4> %if hasattr( item, "annotation") and item.annotation: diff -r 96ec861b4b6e -r 6d079d53f9db templates/grid_base_async.mako --- a/templates/grid_base_async.mako Sun Mar 14 11:49:44 2010 -0400 +++ b/templates/grid_base_async.mako Mon Mar 15 11:31:14 2010 -0400 @@ -13,4 +13,4 @@ ***** ${num_pages} ***** -${render_message( grid )} \ No newline at end of file +${render_message( message, message_type )} \ No newline at end of file diff -r 96ec861b4b6e -r 6d079d53f9db templates/root/history.mako --- a/templates/root/history.mako Sun Mar 14 11:49:44 2010 -0400 +++ b/templates/root/history.mako Mon Mar 15 11:31:14 2010 -0400 @@ -42,10 +42,10 @@ $.jStore.remove("history_expand_state"); }).show(); - // Rename management. + // History rename functionality. async_save_text("history-name-container", "history-name", "${h.url_for( controller="/history", action="rename_async", id=trans.security.encode_id(history.id) )}", "new_name", 18); - // Tag management. + // History tagging functionality. var historyTagArea = $('#history-tag-area'); $('#history-tag').click( function() { @@ -57,7 +57,7 @@ return false; }); - // Annotation management. + // History annotation functionality. var historyAnnotationArea = $('#history-annotation-area'); $('#history-annotate').click( function() { if ( historyAnnotationArea.is( ":hidden" ) ) { @@ -104,7 +104,8 @@ }) } } -// Add show/hide link and delete link to a history item +// (a) Add show/hide link and delete link to a history item; +// (b) handle tagging and annotation using jquery. function setupHistoryItem( query ) { query.each( function() { var id = this.id; @@ -180,6 +181,99 @@ return false; }); }); + + // Tag handling. + $(this).find( "a.icon-button.tags").each( function() + { + // Use links parameters but custom URL as ajax URL. + $(this).click( function() { + // Get tag area, tag element. + var history_item = $(this).parents(".historyItem"); + var tag_area = history_item.find(".tag-area"); + var tag_elt = history_item.find(".tag-elt"); + + // Show or hide tag area; if showing tag area and it's empty, fill it. + if ( tag_area.is( ":hidden" ) ) + { + if (tag_elt.html() == "" ) + { + // Need to fill tag element. + var href_parms = $(this).attr("href").split("?")[1]; + var ajax_url = "${h.url_for( controller='tag', action='get_tagging_elt_async' )}?" + href_parms; + $.ajax({ + url: ajax_url, + error: function() { alert( "Tagging failed" ) }, + success: function(tag_elt_html) { + tag_elt.html(tag_elt_html); + tag_elt.find(".tooltip").tipsy( { gravity: 's' } ); + tag_area.slideDown("fast"); + } + }); + } + else + { + // Tag element is filled; show. + tag_area.slideDown("fast"); + } + } + else + { + // Hide. + tag_area.slideUp("fast"); + } + return false; + }); + }); + + // Annotation handling. + $(this).find( "a.icon-button.annotate").each( function() + { + // Use links parameters but custom URL as ajax URL. + $(this).click( function() { + // Get tag area, tag element. + var history_item = $(this).parents(".historyItem"); + var annotation_area = history_item.find(".annotation-area"); + var annotation_elt = history_item.find(".annotation-elt"); + + // Show or hide annotation area; if showing annotation area and it's empty, fill it. + if ( annotation_area.is( ":hidden" ) ) + { + if (annotation_elt.html() == "" ) + { + // Need to fill annotation element. + var href_parms = $(this).attr("href").split("?")[1]; + var ajax_url = "${h.url_for( controller='dataset', action='get_annotation_async' )}?" + href_parms; + $.ajax({ + url: ajax_url, + error: function() { alert( "Annotations failed" ) }, + success: function(annotation) { + if (annotation == "") + annotation = "<i>Describe or add notes to dataset</i>"; + annotation_elt.html(annotation); + annotation_area.find(".tooltip").tipsy( { gravity: 's' } ); + async_save_text( + annotation_elt.attr("id"), annotation_elt.attr("id"), + "${h.url_for( controller="/dataset", action="annotate_async")}?" + href_parms, + "new_annotation", 18, true, 4); + annotation_area.slideDown("fast"); + } + }); + } + else + { + // Annotation element is filled; show. + annotation_area.slideDown("fast"); + } + } + else + { + // Hide. + annotation_area.slideUp("fast"); + } + return false; + }); + }); + }); }; // Looks for changes in dataset state using an async request. Keeps @@ -279,13 +373,6 @@ padding: 3px; margin: -4px; } -.editable-text:hover { - cursor: text; - border: dotted #999999 1px; -} -.tag-area { - border: none; -} </style> <noscript> @@ -299,7 +386,6 @@ </head> <body class="historyPage"> - <div id="top-links" class="historyLinks"> <a title="${_('refresh')}" class="icon-button arrow-circle tooltip" href="${h.url_for('history', show_deleted=show_deleted)}"></a> diff -r 96ec861b4b6e -r 6d079d53f9db templates/root/history_common.mako --- a/templates/root/history_common.mako Sun Mar 14 11:49:44 2010 -0400 +++ b/templates/root/history_common.mako Mon Mar 15 11:31:14 2010 -0400 @@ -86,10 +86,26 @@ </div> <div class="info">${_('Info: ')}${data.display_info()}</div> <div> + <% dataset_id=trans.security.encode_id( data.id ) %> %if data.has_data: - <a href="${h.url_for( controller='dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" title="Save" class="icon-button disk tooltip"></a> + <a href="${h.url_for( controller='dataset', action='display', dataset_id=dataset_id, to_ext=data.ext )}" title="Save" class="icon-button disk tooltip"></a> %if user_owns_dataset: <a href="${h.url_for( controller='tool_runner', action='rerun', id=data.id )}" target="galaxy_main" title="Run this job again" class="icon-button arrow-circle tooltip"></a> + %if trans.user: + <div style="float: right"> + <a href="${h.url_for( controller='tag', action='retag', item_class=data.__class__.__name__, item_id=dataset_id )}" target="galaxy_main" title="Edit dataset tags" class="icon-button tags tooltip"></a> + <a href="${h.url_for( controller='dataset', action='annotate', id=dataset_id )}" target="galaxy_main" title="Edit dataset annotation" class="icon-button annotate tooltip"></a> + </div> + <div style="clear: both"></div> + <div class="tag-area" style="display: none"> + <strong>Tags:</strong> + <div class="tag-elt"></div> + </div> + <div id="${dataset_id}-annotation-area" class="annotation-area" style="display: none"> + <strong>Annotation:</strong> + <div id="${dataset_id}-annotation-elt" style="margin: 1px 0px 1px 0px" class="annotation-elt tooltip editable-text" title="Edit dataset annotation"></div> + </div> + %endif %endif <div style="clear: both"></div> %for display_app in data.datatype.get_display_types(): diff -r 96ec861b4b6e -r 6d079d53f9db templates/tagging_common.mako --- a/templates/tagging_common.mako Sun Mar 14 11:49:44 2010 -0400 +++ b/templates/tagging_common.mako Mon Mar 15 11:31:14 2010 -0400 @@ -13,7 +13,7 @@ ## Render a tagging element if there is a tagged_item. %if tagged_item is not None: %if tag_type == "individual": - ${render_individual_tagging_element(user=user, tagged_item=tagged_item, elt_context=elt_context, in_form=in_form, input_size=input_size, tag_click_fn=tag_click_fn)} + ${render_individual_tagging_element( user=user, tagged_item=tagged_item, elt_context=elt_context, in_form=in_form, input_size=input_size, tag_click_fn=tag_click_fn, use_toggle_link=use_toggle_link )} %elif tag_type == "community": ${render_community_tagging_element(tagged_item=tagged_item, elt_context=elt_context, tag_click_fn=tag_click_fn)} %endif @@ -123,7 +123,7 @@ // // Set up autocomplete tagger. // - + // // Default function get text to display on the toggle link. // @@ -193,7 +193,7 @@ ajax_delete_tag_url: "${h.url_for( controller='/tag', action='remove_tag_async', item_id=tagged_item_id, item_class=tagged_item.__class__.__name__, context=elt_context )}", delete_tag_img: "${h.url_for('/static/images/delete_tag_icon_gray.png')}", delete_tag_img_rollover: "${h.url_for('/static/images/delete_tag_icon_white.png')}", - use_toggle_link: ${iff( use_toggle_link, 'true', 'false' )}, + use_toggle_link: ${iff( use_toggle_link, 'true', 'false' )} }; $('#${elt_id}').autocomplete_tagging(options);
participants (1)
-
Greg Von Kuster