annotate app/main/initiative/show.lua @ 525:63d6549cc00b
Delegation chain preview improved, better visualisation of current context, code cleanup
author |
bsw |
date |
Fri May 18 19:07:07 2012 +0200 (2012-05-18) |
parents |
fecd4c13054a |
children |
18cd8595459b |
rev |
line source |
bsw/jbe@19
|
1 local initiative = param.get("initiative", "table")
|
bsw/jbe@4
|
2
|
bsw/jbe@19
|
3 if not initiative then
|
bsw/jbe@19
|
4 initiative = Initiative:new_selector():add_where{ "id = ?", param.get_id()}:single_object_mode():exec()
|
bsw@10
|
5 end
|
bsw/jbe@0
|
6
|
jorges@103
|
7 app.html_title.title = initiative.name
|
jorges@103
|
8 app.html_title.subtitle = _("Initiative ##{id}", { id = initiative.id })
|
jorges@103
|
9
|
jorges@103
|
10
|
bsw@278
|
11 execute.view{
|
bsw@278
|
12 module = "issue",
|
bsw@525
|
13 view = "_head",
|
bsw@278
|
14 params = { issue = initiative.issue,
|
bsw@278
|
15 initiative = initiative }
|
bsw@278
|
16 }
|
bsw@278
|
17
|
bsw@278
|
18 if not initiative then
|
bsw@278
|
19 initiative = Initiative:by_id(param.get_id())
|
bsw@278
|
20 expanded = true
|
bsw@278
|
21 end
|
bsw@278
|
22
|
bsw@278
|
23 -- TODO performance
|
bsw@278
|
24 local initiator
|
bsw@278
|
25 if app.session.member_id then
|
bsw@278
|
26 initiator = Initiator:by_pk(initiative.id, app.session.member.id)
|
bsw@278
|
27 end
|
bsw@278
|
28
|
bsw@278
|
29 execute.view{
|
bsw@278
|
30 module = "initiative",
|
bsw@278
|
31 view = "_show",
|
bsw@278
|
32 params = {
|
bsw@278
|
33 initiative = initiative,
|
bsw@278
|
34 initiator = initiator
|
bsw/jbe@19
|
35 }
|
bsw@278
|
36 }
|