liquid_feedback_frontend
view app/main/interest/_show_box.lua @ 222:41bb8f0b2c9a
Fixed syntax error
| author | bsw | 
|---|---|
| date | Sun Mar 13 17:01:48 2011 +0100 (2011-03-13) | 
| parents | 3f179402127f | 
| children | ec86db506312 | 
 line source
     2 local issue = param.get("issue", "table")
     4 local interest = Interest:by_pk(issue.id, app.session.member.id)
     5 local membership = Membership:by_pk(issue.area_id, app.session.member_id)
     7 if interest then
     8   slot.select("actions", function()
    10   ui.container{
    11     attr = { class = "interest vote_info"},
    12     content = function()
    13         ui.container{
    14           attr = { 
    15             class = "head head_active" .. (interest.autoreject and " head_autoreject" or ""),
    16             onclick = "document.getElementById('interest_content').style.display = 'block';"
    17           },
    18           content = function()
    19             ui.image{
    20               static = "icons/16/eye.png"
    21             }
    22             slot.put(_"Your are interested")
    24             if interest.autoreject == true or
    25               (interest.autoreject == nil and membership and membership.autoreject == true)
    26             then
    27               ui.image{
    28                 static = "icons/16/thumb_down_red.png"
    29               }
    30             end
    32             if interest.autoreject == false then
    33               ui.image{
    34                 static = "icons/16/thumb_down_red_crossed.png"
    35               }
    36             end
    38             ui.image{
    39               static = "icons/16/dropdown.png"
    40             }
    41           end
    42         }
    44         ui.container{
    45           attr = { class = "content", id = "interest_content" },
    46           content = function()
    47             ui.container{
    48               attr = {
    49                 class = "close",
    50                 style = "cursor: pointer;",
    51                 onclick = "document.getElementById('interest_content').style.display = 'none';"
    52               },
    53               content = function()
    54                 ui.image{ static = "icons/16/cross.png" }
    55               end
    56             }
    57             if issue.state ~= "finished" and issue.state ~= "cancelled" and issue.state ~= "voting" then
    58               ui.link{
    59                 text    = _"Remove my interest",
    60                 module  = "interest",
    61                 action  = "update",
    62                 params  = { issue_id = issue.id, delete = true },
    63                 routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    64               }
    65               slot.put("<br />")
    66               slot.put("<br />")
    67             end
    68             if interest.autoreject == nil then
    69               if membership then
    70                 if membership.autoreject then
    71                   ui.field.text{ value = _"Autoreject is inherited from area. (Currently turned on)" }
    72                 else
    73                   ui.field.text{ value = _"Autoreject is inherited from area. (Currently turned off)" }
    74                 end
    75               else
    76                 ui.field.text{ value = _"Autoreject is inherited from area. (No member of this area)" }
    77               end
    78               slot.put("<br />")
    79               if issue.state ~= "finished" and issue.state ~= "cancelled" then
    80                 ui.link{
    81                   text    = _"Turn on autoreject for issue",
    82                   module  = "interest",
    83                   action  = "update",
    84                   params  = { issue_id = issue.id, autoreject = true },
    85                   routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    86                 }
    87                 ui.link{
    88                   text    = _"Turn off autoreject for issue",
    89                   module  = "interest",
    90                   action  = "update",
    91                   params  = { issue_id = issue.id, autoreject = false },
    92                   routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    93                 }
    94               end
    95             elseif interest.autoreject == true then
    96               ui.field.text{ value = _"Autoreject for this issue is turned on." }
    97               slot.put("<br />")
    98               if issue.state ~= "finished" and issue.state ~= "cancelled" then
    99                 ui.link{
   100                   text    = _"Inherit autoreject from area",
   101                   module  = "interest",
   102                   action  = "update",
   103                   params  = { issue_id = issue.id, autoreject = nil },
   104                   routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
   105                 }
   106                 ui.link{
   107                   text    = _"Turn off autoreject for issue",
   108                   module  = "interest",
   109                   action  = "update",
   110                   params  = { issue_id = issue.id, autoreject = false },
   111                   routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
   112                 }
   113               end
   114             elseif interest.autoreject == false then
   115               ui.field.text{ value = _"Autoreject for this issue is turned off." }
   116               slot.put("<br />")
   117               if issue.state ~= "finished" and issue.state ~= "cancelled" then
   118                 ui.link{
   119                   text    = _"Inherit autoreject from area",
   120                   module  = "interest",
   121                   action  = "update",
   122                   params  = { issue_id = issue.id, autoreject = nil },
   123                   routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
   124                 }
   125                 ui.link{
   126                   text    = _"Turn on autoreject for issue",
   127                   module  = "interest",
   128                   action  = "update",
   129                   params  = { issue_id = issue.id, autoreject = true },
   130                   routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
   131                 }
   132               end
   133             end
   134           end
   135         }
   136       end
   137     }
   138   end)
   139 else
   140   if not issue.closed and not issue.fully_frozen then
   141     ui.link{
   142       image   = { static = "icons/16/user_add.png" },
   143       text    = _"Add my interest",
   144       module  = "interest",
   145       action  = "update",
   146       params  = { issue_id = issue.id },
   147       routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
   148     }
   149   end
   150 end
