def context(self, app): return dict( name=app.name, description=app.description or "---", link=reverse('application', app_id=app.guid), open_update_dialog=reverse_api( 'application:update_form_show', application_id=app.guid, command='update'), open_delete_dialog=reverse_api( 'application:update_form_show', application_id=app.guid, command='delete'), )
def context(self, widget): return dict( id=widget.guid, name=widget.name, source=widget.source[:30], link=reverse('widget', widget_id=widget.guid), open_update_dialog=reverse_api('widget:update_form_show', widget_id=widget.guid, command='update'), open_delete_dialog=reverse_api('widget:update_form_show', widget_id=widget.guid, command='delete'), )
def context(self, workspace): return dict( id=workspace.guid, name=workspace.name, description=workspace.description, link=reverse('workspace', workspace_id=workspace.guid), open_update_dialog=reverse_api('workspace:update_form_show', workspace_id=workspace.guid, command='update'), open_delete_dialog=reverse_api('workspace:update_form_show', workspace_id=workspace.guid, command='delete'), )
try: import localization from widget_localization import LocalizationWidget from models import Application from urls import reverse lang = localization.get_lang() if not 'id' in request.arguments: response.redirect(reverse('main')) app_id = request.arguments.get('id') app = Application.get(guid=app_id) if not app: response.redirect(reverse('main')) self.title = u"App : {}".format(app.name) except Exception, ex: from app_settings import settings from vdom_debug import p_ex if settings.TEST_MODE: p_ex() self.growl.title = lang['error'] self.growl.text = lang['unknown_error'] self.growl.active = "1"
from templates import BreadcrumbTemplate from models import Workspace, Application, Widget from urls import reverse from vdom_debug import p try: script_name = request.environment.get('SCRIPT_NAME', '') pages = [dict(name='Home', is_active=True)] if script_name.startswith('/workspace'): workspace_id = request.arguments.get('id', '') workspace = Workspace.get(guid=workspace_id) if workspace: pages = [ dict(name='Home', link=reverse('main')), dict(name=workspace.name, is_active=True), ] elif script_name.startswith('/application'): app_id = request.arguments.get('id', '') app = Application.get(guid=app_id) if app: pages = [ dict(name='Home', link=reverse('main')), dict(name=app.workspace.name, link=reverse('workspace', workspace_id=app.workspace_id)), dict(name=app.name, is_active=True), ] elif script_name.startswith('/widget'):