annotate app/main/interest/_show_box.lua @ 565:06a6d9b661d7
Going to version v2.beta10
 | author | 
 bsw | 
 | date | 
 Tue Jun 19 22:46:02 2012 +0200 (2012-06-19) | 
 | parents | 
 c1dc3b14a4f3  | 
 | children | 
  | 
 
 | rev | 
   line source | 
| 
bsw/jbe@0
 | 
     1 
 | 
| 
bsw/jbe@0
 | 
     2 local issue = param.get("issue", "table")
 | 
| 
bsw@339
 | 
     3 local initiative = param.get("initiative", "table")
 | 
| 
bsw/jbe@0
 | 
     4 
 | 
| 
bsw@551
 | 
     5 if issue.member_info.own_participation then
 | 
| 
bsw/jbe@0
 | 
     6 
 | 
| 
bsw@529
 | 
     7   if issue.closed then
 | 
| 
bsw@529
 | 
     8     ui.tag{ content = _"You were interested" }
 | 
| 
bsw@529
 | 
     9   else
 | 
| 
bsw@529
 | 
    10     ui.tag{ content = _"You are interested" }
 | 
| 
bsw@529
 | 
    11   end
 | 
| 
bsw@525
 | 
    12   slot.put(" ")
 | 
| 
bsw@277
 | 
    13 
 | 
| 
bsw@525
 | 
    14   if issue.state ~= "finished" and issue.state ~= "cancelled" and issue.state ~= "voting" then
 | 
| 
bsw@525
 | 
    15     slot.put("(")
 | 
| 
bsw@525
 | 
    16     ui.link{
 | 
| 
bsw@525
 | 
    17       text    = _"Withdraw",
 | 
| 
bsw@525
 | 
    18       module  = "interest",
 | 
| 
bsw@525
 | 
    19       action  = "update",
 | 
| 
bsw@525
 | 
    20       params  = { issue_id = issue.id, delete = true },
 | 
| 
bsw@528
 | 
    21       routing = {
 | 
| 
bsw@528
 | 
    22         default = {
 | 
| 
bsw@528
 | 
    23           mode = "redirect",
 | 
| 
bsw@528
 | 
    24           module = request.get_module(),
 | 
| 
bsw@528
 | 
    25           view = request.get_view(),
 | 
| 
bsw@528
 | 
    26           id = param.get_id_cgi(),
 | 
| 
bsw@528
 | 
    27           params = param.get_all_cgi()
 | 
| 
bsw@528
 | 
    28         }
 | 
| 
bsw@528
 | 
    29       }
 | 
| 
bsw/jbe@4
 | 
    30     }
 | 
| 
bsw@525
 | 
    31     slot.put(") ")
 | 
| 
bsw@16
 | 
    32   end
 | 
| 
bsw@525
 | 
    33 elseif app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) then
 | 
| 
bsw@525
 | 
    34   if not issue.closed and not issue.fully_frozen then
 | 
| 
bsw@525
 | 
    35     ui.link{
 | 
| 
bsw@525
 | 
    36       text    = _"Add my interest",
 | 
| 
bsw@525
 | 
    37       module  = "interest",
 | 
| 
bsw@525
 | 
    38       action  = "update",
 | 
| 
bsw@525
 | 
    39       params  = { issue_id = issue.id },
 | 
| 
bsw@528
 | 
    40       routing = {
 | 
| 
bsw@528
 | 
    41         default = {
 | 
| 
bsw@528
 | 
    42           mode = "redirect",
 | 
| 
bsw@528
 | 
    43           module = request.get_module(),
 | 
| 
bsw@528
 | 
    44           view = request.get_view(),
 | 
| 
bsw@528
 | 
    45           id = param.get_id_cgi(),
 | 
| 
bsw@528
 | 
    46           params = param.get_all_cgi()
 | 
| 
bsw@528
 | 
    47         }
 | 
| 
bsw@528
 | 
    48       }
 | 
| 
bsw@525
 | 
    49     }
 | 
| 
bsw@525
 | 
    50     slot.put(" ")
 | 
| 
bsw@525
 | 
    51   end
 | 
| 
bsw@525
 | 
    52 end
 |