1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/d7846ad65544/ changeset: d7846ad65544 user: dannon date: 2012-02-01 17:45:53 summary: Workflows: Add the ability to view your own workflows in plain display mode as if you had shared it. affected #: 3 files
diff -r 3097eedaf60b515fceae5d26639f8f4621099040 -r d7846ad655441f7739a903dac4906c3a6c262354 lib/galaxy/web/controllers/workflow.py --- a/lib/galaxy/web/controllers/workflow.py +++ b/lib/galaxy/web/controllers/workflow.py @@ -222,6 +222,35 @@ user_item_rating = user_item_rating, ave_item_rating=ave_item_rating, num_ratings=num_ratings )
@web.expose + def display_by_id( self, trans, id ): + """ Display workflow based on a username and slug. """ + # Get workflow. + stored_workflow = self.get_stored_workflow( trans, id ) + if stored_workflow is None: + raise web.httpexceptions.HTTPNotFound() + # Security check raises error if user cannot access workflow. + self.security_check( trans, stored_workflow, False, True) + + # Get data for workflow's steps. + self.get_stored_workflow_steps( trans, stored_workflow ) + # Get annotations. + stored_workflow.annotation = self.get_item_annotation_str( trans.sa_session, stored_workflow.user, stored_workflow ) + for step in stored_workflow.latest_workflow.steps: + step.annotation = self.get_item_annotation_str( trans.sa_session, stored_workflow.user, step ) + + # Get rating data. + user_item_rating = 0 + if trans.get_user(): + user_item_rating = self.get_user_item_rating( trans.sa_session, trans.get_user(), stored_workflow ) + if user_item_rating: + user_item_rating = user_item_rating.rating + else: + user_item_rating = 0 + ave_item_rating, num_ratings = self.get_ave_item_rating_data( trans.sa_session, stored_workflow ) + return trans.fill_template_mako( "workflow/display.mako", item=stored_workflow, item_data=stored_workflow.latest_workflow.steps, + user_item_rating = user_item_rating, ave_item_rating=ave_item_rating, num_ratings=num_ratings ) + + @web.expose def get_item_content_async( self, trans, id ): """ Returns item content in HTML format. """
diff -r 3097eedaf60b515fceae5d26639f8f4621099040 -r d7846ad655441f7739a903dac4906c3a6c262354 templates/workflow/display.mako --- a/templates/workflow/display.mako +++ b/templates/workflow/display.mako @@ -63,12 +63,14 @@
<%def name="render_item_links( workflow )"> + %if workflow.importable: <a href="${h.url_for( controller='/workflow', action='imp', id=trans.security.encode_id(workflow.id) )}" class="icon-button import" ## Needed to overwide initial width so that link is floated left appropriately. style="width: 100%" title="Import workflow">Import workflow</a> + %endif </%def><%def name="render_item( workflow, steps )">
diff -r 3097eedaf60b515fceae5d26639f8f4621099040 -r d7846ad655441f7739a903dac4906c3a6c262354 templates/workflow/list.mako --- a/templates/workflow/list.mako +++ b/templates/workflow/list.mako @@ -69,6 +69,7 @@ <a class="action-button" href="${h.url_for( controller='workflow', action='export', id=trans.security.encode_id( workflow.id ) )}">Download or Export</a><a class="action-button" href="${h.url_for( controller='workflow', action='clone', id=trans.security.encode_id( workflow.id ) )}">Clone</a><a class="action-button" href="${h.url_for( controller='workflow', action='rename', id=trans.security.encode_id( workflow.id ) )}">Rename</a> + <a class="action-button" href="${h.url_for( controller='workflow', action='display_by_id', id=trans.security.encode_id( workflow.id ) )}" target="_top">View</a><a class="action-button" confirm="Are you sure you want to delete workflow '${h.to_unicode( workflow.name ) | h}'?" href="${h.url_for( controller='workflow', action='delete', id=trans.security.encode_id( workflow.id ) )}">Delete</a></div></td> @@ -118,4 +119,4 @@ </a></div></div> -</%def> \ No newline at end of file +</%def>
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.
galaxy-commits@lists.galaxyproject.org