Task #7394 (closed)
context for every template
Reported by: | wmoore | Owned by: | wmoore |
---|---|---|---|
Priority: | major | Milestone: | OMERO-4.4 |
Component: | Web | Version: | n.a. |
Keywords: | n.a. | Cc: | atarkowska, cxallan |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | n.a. |
Description (last modified by wmoore)
For lookups that are not expensive, E.g. eventContext etc we should provide to every template, using decorators probably.
First, lets document what is currently provided to every/many templates:
- 'nav': session.requestnav?, used for several template components, E.g.:
{'menu': u'userdata', 'tab_links': [(u'Webclient', '/webclient/userdata/', u'webclient', True), (u'Admin', '/webadmin/', u'webadmin', False)], 'blitz': u'localhost:4064', 'callback': {}, 'experimenter': None, 'error': None, 'basket': 0, 'view': u'tree'}
- 'eContext':controller.eContext
E.g.
{'isEditable': True, 'isReadOnly': False, 'advice': None, 'allGroups': [<ExperimenterGroupWrapper id=103>, <ExperimenterGroupWrapper id=3>, <ExperimenterGroupWrapper id=0>], 'user': <ExperimenterWrapper id=2>, 'context': object #0 (::omero::sys::EventContext) { shareId = -1 sessionId = 16713 sessionUuid = a5652871-b1d6-47aa-8c52-a232ecc0db4c userId = 2 userName = will groupId = 3 groupName = Swedlow lab isAdmin = True eventId = -1 eventType = User memberOfGroups = { [0] = 0 [1] = 103 [2] = 3 } leaderOfGroups = { [0] = 103 } groupPermissions = object #1 (::omero::model::Permissions) { _perm1 = -7 } }, 'memberOfGroups': [<ExperimenterGroupWrapper id=103>, <ExperimenterGroupWrapper id=3>, <ExperimenterGroupWrapper id=0>], 'isLeader': False, 'image_limit': 200}
This is augmented in some places with:
eContext.breadcrumb = ['<a href="/webclient/load_history/2011/12/13/">History</a>', 'Tuesday, 13 December 2011']
- 'form_active_group'. Used in the top level pages generated by the load_template view. Might be nice to separate this into it's own decorator, so that it can be added to any page/view that needed it.
form_active_group = ActiveGroupForm(initial={'activeGroup':manager.eContext['context'].groupId, 'mygroups': manager.eContext['allGroups'], 'url':url})
Change History (13)
comment:1 Changed 12 years ago by wmoore
- Description modified (diff)
comment:2 Changed 12 years ago by wmoore
- Description modified (diff)
comment:3 Changed 12 years ago by wmoore
- Description modified (diff)
comment:4 Changed 12 years ago by wmoore
- Sprint changed from 2012-01-03 (5) to 2012-01-31 (7)
comment:5 Changed 12 years ago by jmoore
- Sprint changed from 2012-01-31 (7) to 2012-02-14 (8)
Moved from sprint 2012-01-31 (7)
comment:6 Changed 12 years ago by jburel
- Sprint changed from 2012-02-14 (8) to 2012-02-28 (9)
Moved from sprint 2012-02-14 (8)
comment:7 Changed 12 years ago by jburel
- Sprint changed from 2012-02-28 (9) to 2012-03-13 (10)
Moved from sprint 2012-02-28 (9)
comment:8 Changed 12 years ago by jburel
- Sprint changed from 2012-03-13 (10) to 2012-03-27 (11)
Moved from sprint 2012-03-13 (10)
comment:9 Changed 12 years ago by wmoore
- Sprint 2012-03-27 (11) deleted
Will return to this once new decorators are done, since this work will include decorator changes.
comment:10 Changed 12 years ago by wmoore
- Resolution set to fixed
- Status changed from new to closed
This work is done in branch https://github.com/will-moore/openmicroscopy/tree/render_decorator_7394
Closing...
comment:11 Changed 12 years ago by Will Moore <will@…>
(In [162b52301b943dc4cb401426f4b4019a98d2bb27/ome.git] on branch develop) New class-based omeroweb.decorator: @render_response(). See #7394
comment:12 Changed 12 years ago by Will Moore <will@…>
(In [29ff1e4660e76dbdfa4cbc8d6094383c0369a813/ome.git] on branch develop) Blitz Gateway getUser() lazy loads when needed. See #7394
comment:13 Changed 12 years ago by Will Moore <will@…>
(In [6a285bf89376b45154c075d245effcef000f1313/ome.git] on branch develop) Removing nav.menu usage from webclient. See #7394
Need to decide how much of this context to implement in the new decorators.