def __init__(self, request): BaseViewer.__init__(self, request) self.context = None if 'context' in self.request.matchdict: self.context = self.request.matchdict['context'] prepare_main_data(self.request) self.dbsession = self.request.db self.manager = ModelManager(self.dbsession) # make left menu entries = [] url = self.url(context='main', id='calendar') entries.append(('Main View', url)) url = self.url(context='dbmeetings', id=None) entries.append(('Meetings', url)) url = self.url(context='items', id=None) url = self.url(context='viewdepts', id=None) entries.append(('View Departments', url)) url = self.url(context='viewpeople', id=None) entries.append(('View People', url)) url = self.url(context='tagitems', id=None) entries.append(('Tag Items', url)) url = self.url(context='viewtags', id=None) entries.append(('View Tags', url)) if self.context in ['viewfeed']: url = self.url(context='deletefeed', feed=self.request.matchdict['feed']) entries.append(('Delete Feed', url)) header = 'Hubby Menu' menu = BaseMenu() menu.set_new_entries(entries, header=header) self.layout.options_menus = dict(actions=menu) # make dispatch table self._cntxt_meth = dict( main=self.main_calendar_view, dbmeetings=self.view_db_meetings, viewmeeting=self.view_meeting, viewdepts=self.view_departments, viewpeople=self.view_people, viewdepartment=self.view_dept_meetings, tagitems=self.view_tag_items, viewtags=self.view_tags, viewtaggeditem=self.view_items_with_tag, ) # dispatch context request if self.context in self._cntxt_meth: self._cntxt_meth[self.context]() else: msg = 'Undefined Context: %s' % self.context self.layout.content = '<b>%s</b>' % msg
def __init__(self, request): BaseViewer.__init__(self, request) prepare_main_layout(self.request) self.layout.resources.fancybox.need() self.layout.resources.fullcalendar.need() template = "trumpet:templates/consult/main-view.mako" env = dict() content = self.render(template, env) from haberdashery.resources import maincalendar maincalendar.need() self.layout.content = content
def __init__(self, request): BaseViewer.__init__(self, request) self.context = None if 'context' in self.request.matchdict: self.context = self.request.matchdict['context'] self.db = self.request.db self.manager = ModelManager(self.db) # make dispatch table self._cntxt_meth = dict( itemactions=self.get_item_actions, ) # dispatch context request if self.context in self._cntxt_meth: self._cntxt_meth[self.context]() else: msg = 'Undefined Context: %s' % self.context self.layout.content = '<b>%s</b>' % msg
def __init__(self, request): BaseViewer.__init__(self, request) prepare_main_layout(self.request) self.clients = ClientManager(self.request.db) self.contacts = ContactManager(self.request.db) self._dispatch_table = dict( list=self.list_clients, add=self.add_client, delete=self.delete_client, confirmdelete=self.confirm_delete_client, editclient=self.edit_client, viewclient=self.view_client,) self.context = self.request.matchdict['context'] self._view = self.context menu = BaseMenu() menu.set_header('Actions') url = self.url(context='add', id='somebody') menu.append_new_entry("Add Client", url) self.layout.options_menus = dict(actions=menu) self.dispatch()
def __init__(self, request): BaseViewer.__init__(self, request) prepare_main_layout(self.request)