annotate app/main/initiative/show.lua @ 356:7ee7ec1b10fc
Fix link to area list in navigation (single unit mode)
 | author | 
 bsw | 
 | date | 
 Wed Feb 29 20:31:21 2012 +0100 (2012-02-29) | 
 | parents | 
 fecd4c13054a  | 
 | children | 
 63d6549cc00b  | 
 
 | 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@278
 | 
    13   view = "_show_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 }
 |