'View a history. If a history is importable, then it is viewable by any user.'

@web.expose
def view(self, trans, id=None, show_deleted=False, show_hidden=False, use_panels=True):

    show_deleted = galaxy.util.string_as_bool(show_deleted)
    show_hidden = galaxy.util.string_as_bool(show_hidden)
    use_panels = galaxy.util.string_as_bool(use_panels)
    history_dictionary = {}
    user_is_owner = False
    try:
        if id:
            history_to_view = self.history_manager.get_accessible(self.decode_id(id), trans.user, current_history=trans.history)
            user_is_owner = (history_to_view.user == trans.user)
            history_is_current = (history_to_view == trans.history)
        else:
            history_to_view = trans.history
            user_is_owner = True
            history_is_current = True
        history_dictionary = self.history_serializer.serialize_to_view(history_to_view, view='dev-detailed', user=trans.user, trans=trans)
    except Exception as exc:
        user_id = (str(trans.user.id) if trans.user else '(anonymous)')
        log.exception('Error    bootstrapping    history    for    user    %s', user_id)
        if isinstance(exc, exceptions.ItemAccessibilityException):
            error_msg = 'You    do    not    have    permission    to    view    this    history.'
        else:
            error_msg = ('An    error    occurred    getting    the    history    data    from    the    server.    ' + 'Please    contact    a    Galaxy    administrator    if    the    problem    persists.')
        return trans.show_error_message(error_msg, use_panels=use_panels)
    return trans.fill_template_mako('history/view.mako', history=history_dictionary, user_is_owner=user_is_owner, history_is_current=history_is_current, show_deleted=show_deleted, show_hidden=show_hidden, use_panels=use_panels)
