liquid_feedback_frontend
view app/main/interest/_show_box.lua @ 3:768faea1096d
Version alpha4
Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.
Initiatives may provide a link to an external discussion platform
Direct link on every initiative page to create an alternative initiative
Bugfix: No error when clicking "neutral", when "neutral" is currently selected
Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.
Initiatives may provide a link to an external discussion platform
Direct link on every initiative page to create an alternative initiative
Bugfix: No error when clicking "neutral", when "neutral" is currently selected
| author | bsw | 
|---|---|
| date | Mon Nov 30 12:00:00 2009 +0100 (2009-11-30) | 
| parents | 3bfb2fcf7ab9 | 
| children | 80c215dbf076 | 
 line source
     2 local issue = param.get("issue", "table")
     5 slot.select("interest", function()
     6   local interest = Interest:by_pk(issue.id, app.session.member.id)
     8   ui.container{
     9     attr = { 
    10       class = "head",
    11       onclick = "document.getElementById('interest_content').style.display = 'block';"
    12     },
    13     content = function()
    14       if interest then
    15         ui.field.text{ value = _"You are interested. [more]" }
    16       else
    17         ui.field.text{ value = _"You are not interested. [more]" }
    18       end
    19     end
    20   }
    22   ui.container{
    23     attr = { class = "content", id = "interest_content" },
    24     content = function()
    25       ui.container{
    26         attr = {
    27           class = "close",
    28           style = "cursor: pointer;",
    29           onclick = "document.getElementById('interest_content').style.display = 'none';"
    30         },
    31         content = _"X"
    32       }
    33       if interest then
    34         ui.link{
    35           content = _"Remove my interest",
    36           module = "interest",
    37           action = "update",
    38           params = { issue_id = issue.id, delete = true },
    39           routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    40         }
    41         slot.put("<br />")
    42         slot.put("<br />")
    43         if interest.autoreject then
    44           ui.field.text{ value = _"Autoreject is on." }
    45           ui.link{
    46             content = _"Remove autoreject",
    47             module = "interest",
    48             action = "update",
    49             params = { issue_id = issue.id, autoreject = false },
    50             routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    51           }
    52         else
    53           ui.field.text{ value = _"Autoreject is off." }
    54           ui.link{
    55             content = _"Set autoreject",
    56             module = "interest",
    57             action = "update",
    58             params = { issue_id = issue.id, autoreject = true },
    59             routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    60           }
    61         end
    62       else
    63         ui.link{
    64           content = _"Add my interest to this issue",
    65           module = "interest",
    66           action = "update",
    67           params = { issue_id = issue.id },
    68           routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } }
    69         }
    70       end
    71     end
    72   }
    73 end)
