liquid_feedback_frontend
view app/main/initiative/show_static.lua @ 112:29519f2f9929
static links allow only one tab opened at the same time
| author | jorges | 
|---|---|
| date | Sun Sep 19 16:00:38 2010 +0200 (2010-09-19) | 
| parents | bf885faf3452 | 
| children | d87097d3b6ec | 
 line source
     1 local initiative = param.get("initiative", "table")
     3 if not initiative then
     4   initiative = Initiative:new_selector():add_where{ "id = ?", param.get_id()}:single_object_mode():exec()
     5 end
     7 slot.select("actions", function()
     8   ui.link{
     9     content = function()
    10       ui.image{ static = "icons/16/script.png" }
    11       slot.put(_"Show alternative initiatives")
    12     end,
    13     module = "issue",
    14     view = "show",
    15     id = initiative.issue.id
    16   }
    17 end)
    19 execute.view{
    20   module = "issue",
    21   view = "_show_head",
    22   params = { issue = initiative.issue,
    23              initiative = initiative }
    24 }
    26 --slot.put_into("html_head", '<link rel="alternate" type="application/rss+xml" title="RSS" href="../show/' .. tostring(initiative.id) .. '.rss" />')
    28 if app.session.member_id then
    29   slot.select("actions", function()
    30     if not initiative.issue.fully_frozen and not initiative.issue.closed then
    31       ui.link{
    32         image  = { static = "icons/16/script_add.png" },
    33         attr   = { class = "action" },
    34         text   = _"Create alternative initiative",
    35         module = "initiative",
    36         view   = "new",
    37         params = { issue_id = initiative.issue.id }
    38       }
    39     end
    40   end)
    41 end
    43 slot.put_into("sub_title", encode.html(_("Initiative: '#{name}'", { name = initiative.name }) ))
    45 execute.view{
    46   module = "initiative",
    47   view = "show_partial",
    48   params = {
    49     initiative = initiative,
    50     expanded = true
    51   }
    52 }
