| rev | 
   line source | 
| 
bsw/jbe@4
 | 
     1 local issue = param.get("issue", "table")
 | 
| 
bsw/jbe@4
 | 
     2 
 | 
| 
bsw/jbe@4
 | 
     3 slot.put_into("html_head", '<link rel="alternate" type="application/rss+xml" title="RSS" href="../show/' .. tostring(issue.id) .. '.rss" />')
 | 
| 
bsw/jbe@4
 | 
     4 
 | 
| 
bsw/jbe@4
 | 
     5 slot.select("path", function()
 | 
| 
bsw/jbe@4
 | 
     6   ui.link{
 | 
| 
bsw/jbe@4
 | 
     7     content = _"Area '#{name}'":gsub("#{name}", issue.area.name),
 | 
| 
bsw/jbe@4
 | 
     8     module = "area",
 | 
| 
bsw/jbe@4
 | 
     9     view = "show",
 | 
| 
bsw/jbe@4
 | 
    10     id = issue.area.id
 | 
| 
bsw/jbe@4
 | 
    11   }
 | 
| 
bsw/jbe@4
 | 
    12 end)
 | 
| 
bsw/jbe@4
 | 
    13 
 | 
| 
bsw/jbe@5
 | 
    14 slot.select("title", function()
 | 
| 
bsw/jbe@5
 | 
    15   ui.link{
 | 
| 
bsw/jbe@5
 | 
    16     content = _"Issue ##{id} (#{policy_name})":gsub("#{id}", issue.id):gsub("#{policy_name}", issue.policy.name),
 | 
| 
bsw/jbe@5
 | 
    17     module = "issue",
 | 
| 
bsw/jbe@5
 | 
    18     view = "show",
 | 
| 
bsw/jbe@5
 | 
    19     id = issue.id
 | 
| 
bsw/jbe@5
 | 
    20   }
 | 
| 
bsw/jbe@5
 | 
    21 end)
 | 
| 
bsw/jbe@5
 | 
    22 
 | 
| 
bsw/jbe@4
 | 
    23 
 | 
| 
bsw/jbe@4
 | 
    24 slot.select("actions", function()
 | 
| 
bsw/jbe@5
 | 
    25 
 | 
| 
bsw/jbe@5
 | 
    26   if issue.state == 'voting' then
 | 
| 
bsw/jbe@5
 | 
    27     ui.link{
 | 
| 
bsw/jbe@5
 | 
    28       content = function()
 | 
| 
bsw/jbe@5
 | 
    29         ui.image{ static = "icons/16/email_open.png" }
 | 
| 
bsw/jbe@5
 | 
    30         slot.put(_"Vote now")
 | 
| 
bsw/jbe@5
 | 
    31       end,
 | 
| 
bsw/jbe@5
 | 
    32       module = "vote",
 | 
| 
bsw/jbe@5
 | 
    33       view = "list",
 | 
| 
bsw/jbe@5
 | 
    34       params = { issue_id = issue.id }
 | 
| 
bsw/jbe@5
 | 
    35     }
 | 
| 
bsw/jbe@5
 | 
    36   end
 | 
| 
bsw/jbe@5
 | 
    37 
 | 
| 
bsw/jbe@4
 | 
    38   execute.view{
 | 
| 
bsw/jbe@4
 | 
    39     module = "interest",
 | 
| 
bsw/jbe@4
 | 
    40     view = "_show_box",
 | 
| 
bsw/jbe@4
 | 
    41     params = { issue = issue }
 | 
| 
bsw/jbe@4
 | 
    42   }
 | 
| 
bsw/jbe@4
 | 
    43 
 | 
| 
bsw/jbe@5
 | 
    44   if not issue.closed then
 | 
| 
bsw/jbe@5
 | 
    45     execute.view{
 | 
| 
bsw/jbe@5
 | 
    46       module = "delegation",
 | 
| 
bsw/jbe@5
 | 
    47       view = "_show_box",
 | 
| 
bsw/jbe@5
 | 
    48       params = { issue_id = issue.id }
 | 
| 
bsw/jbe@5
 | 
    49     }
 | 
| 
bsw/jbe@5
 | 
    50   end
 | 
| 
bsw@7
 | 
    51 
 | 
| 
bsw@16
 | 
    52   execute.view{
 | 
| 
bsw@16
 | 
    53     module = "issue",
 | 
| 
bsw@16
 | 
    54     view = "_show_vote_later_box",
 | 
| 
bsw@16
 | 
    55     params = { issue = issue }
 | 
| 
bsw@16
 | 
    56   }
 | 
| 
bsw/jbe@4
 | 
    57 
 | 
| 
bsw@10
 | 
    58   if config.issue_discussion_url_func then
 | 
| 
bsw@10
 | 
    59     local url = config.issue_discussion_url_func(issue)
 | 
| 
bsw@10
 | 
    60     ui.link{
 | 
| 
bsw@10
 | 
    61       attr = { target = "_blank" },
 | 
| 
bsw@10
 | 
    62       external = url,
 | 
| 
bsw@10
 | 
    63       content = function()
 | 
| 
bsw@10
 | 
    64         ui.image{ static = "icons/16/comments.png" }
 | 
| 
bsw@10
 | 
    65         slot.put(_"Discussion on issue")
 | 
| 
bsw@10
 | 
    66       end,
 | 
| 
bsw@10
 | 
    67     }
 | 
| 
bsw@10
 | 
    68   end
 | 
| 
bsw/jbe@4
 | 
    69 end)
 | 
| 
bsw/jbe@4
 | 
    70 
 | 
| 
bsw/jbe@4
 | 
    71 
 | 
| 
bsw/jbe@4
 | 
    72 execute.view{
 | 
| 
bsw/jbe@4
 | 
    73   module = "issue",
 | 
| 
bsw/jbe@4
 | 
    74   view = "_show_box",
 | 
| 
bsw/jbe@4
 | 
    75   params = { issue = issue }
 | 
| 
bsw/jbe@4
 | 
    76 }
 | 
| 
bsw/jbe@4
 | 
    77 
 | 
| 
bsw/jbe@4
 | 
    78 --  ui.twitter("http://example.com/t" .. tostring(issue.id))
 | 
| 
bsw/jbe@6
 | 
    79 
 | 
| 
bsw/jbe@6
 | 
    80 
 | 
| 
bsw/jbe@6
 | 
    81 if issue.state == 'voting' then
 | 
| 
bsw/jbe@6
 | 
    82   ui.container{
 | 
| 
bsw/jbe@6
 | 
    83     attr = { class = "voting_active_info" },
 | 
| 
bsw/jbe@6
 | 
    84     content = function()
 | 
| 
bsw/jbe@6
 | 
    85       slot.put(_"Voting for this issue is currently running!")
 | 
| 
bsw/jbe@6
 | 
    86       slot.put(" ")
 | 
| 
bsw/jbe@6
 | 
    87       ui.link{
 | 
| 
bsw/jbe@6
 | 
    88         content = function()
 | 
| 
bsw/jbe@6
 | 
    89           slot.put(_"Vote now")
 | 
| 
bsw/jbe@6
 | 
    90         end,
 | 
| 
bsw/jbe@6
 | 
    91         module = "vote",
 | 
| 
bsw/jbe@6
 | 
    92         view = "list",
 | 
| 
bsw/jbe@6
 | 
    93         params = { issue_id = issue.id }
 | 
| 
bsw/jbe@6
 | 
    94       }
 | 
| 
bsw/jbe@6
 | 
    95     end
 | 
| 
bsw/jbe@6
 | 
    96   }
 | 
| 
bsw/jbe@6
 | 
    97   slot.put("<br />")
 | 
| 
bsw/jbe@6
 | 
    98 end
 | 
| 
bsw/jbe@6
 | 
    99 
 |