'Imports a workflow shared by other users.'

@web.expose
@web.require_login('to    import    a    workflow', use_panels=True)
def imp(self, trans, id, **kwargs):

    referer = trans.request.referer
    if referer:
        referer_message = ("<a    href='%s'>return    to    the    previous    page</a>" % escape(referer))
    else:
        referer_message = ("<a    href='%s'>go    to    Galaxy's    start    page</a>" % url_for('/'))
    stored = self.get_stored_workflow(trans, id, check_ownership=False)
    if (stored.importable is False):
        return trans.show_error_message(('The    owner    of    this    workflow    has    disabled    imports    via    this    link.<br>You    can    %s' % referer_message), use_panels=True)
    elif stored.deleted:
        return trans.show_error_message(("You    can't    import    this    workflow    because    it    has    been    deleted.<br>You    can    %s" % referer_message), use_panels=True)
    self._import_shared_workflow(trans, stored)
    return trans.show_ok_message(message=('Workflow    "%s"    has    been    imported.    <br>You    can    <a    href="%s">start    using    this    workflow</a>    or    %s.' % (stored.name, web.url_for(controller='workflow'), referer_message)), use_panels=True)
