liquid_feedback_frontend
view app/main/interest/_show_box.lua @ 479:edcf827d7ac3
Added box around initiative head
| author | bsw | 
|---|---|
| date | Thu Mar 15 12:43:11 2012 +0100 (2012-03-15) | 
| parents | f8481330f4c2 | 
| children | 63d6549cc00b | 
 line source
     2 local issue = param.get("issue", "table")
     3 local initiative = param.get("initiative", "table")
     5 local interest = Interest:by_pk(issue.id, app.session.member.id)
     6 local membership = Membership:by_pk(issue.area_id, app.session.member_id)
     8 slot.select("interest", function()
     9   if interest then
    11   ui.container{
    12     content = function()
    13         ui.container{
    14           attr = { 
    15             class = "head head_active",
    16           },
    17           content = function()
    18             ui.image{
    19               static = "icons/16/eye.png"
    20             }
    21             slot.put(_"Your are interested")
    23           end
    24         }
    26         if issue.state ~= "finished" and issue.state ~= "cancelled" and issue.state ~= "voting" then
    27           ui.link{
    28             image   = { static = "icons/16/cross.png" },
    29             text    = _"Withdraw interest",
    30             module  = "interest",
    31             action  = "update",
    32             params  = { issue_id = issue.id, delete = true },
    33             routing = { default = { mode = "redirect", module = initiative and "initiative" or "issue", view = "show", id = initiative and initiative.id or issue.id } }
    34           }
    35         end
    36       end
    37     }
    38   elseif app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) then
    39     if not issue.closed and not issue.fully_frozen then
    40       ui.link{
    41         image   = { static = "icons/16/user_add.png" },
    42         text    = _"Add my interest",
    43         module  = "interest",
    44         action  = "update",
    45         params  = { issue_id = issue.id },
    46         routing = { default = { mode = "redirect", module = initiative and "initiative" or "issue", view = "show", id = initiative and initiative.id or issue.id } }
    47       }
    48     end
    49   end
    50 end)
