| rev | 
   line source | 
| 
bsw/jbe@0
 | 
     1 local issue = Issue:by_id(param.get_id())
 | 
| 
bsw/jbe@0
 | 
     2 
 | 
| 
bsw/jbe@0
 | 
     3 slot.put_into("html_head", '<link rel="alternate" type="application/rss+xml" title="RSS" href="../show/' .. tostring(issue.id) .. '.rss" />')
 | 
| 
bsw/jbe@0
 | 
     4 
 | 
| 
bsw/jbe@0
 | 
     5 slot.select("path", function()
 | 
| 
bsw/jbe@0
 | 
     6   ui.link{
 | 
| 
bsw/jbe@0
 | 
     7     content = _"Area '#{name}'":gsub("#{name}", issue.area.name),
 | 
| 
bsw/jbe@0
 | 
     8     module = "area",
 | 
| 
bsw/jbe@0
 | 
     9     view = "show",
 | 
| 
bsw/jbe@0
 | 
    10     id = issue.area.id
 | 
| 
bsw/jbe@0
 | 
    11   }
 | 
| 
bsw/jbe@0
 | 
    12 end)
 | 
| 
bsw/jbe@0
 | 
    13 
 | 
| 
bsw/jbe@0
 | 
    14 slot.put_into("title", encode.html(_"Issue ##{id} (#{policy_name})":gsub("#{id}", issue.id):gsub("#{policy_name}", issue.policy.name)))
 | 
| 
bsw/jbe@0
 | 
    15 
 | 
| 
bsw/jbe@0
 | 
    16 slot.select("actions", function()
 | 
| 
bsw/jbe@0
 | 
    17   if not issue.closed then
 | 
| 
bsw/jbe@0
 | 
    18     ui.link{
 | 
| 
bsw/jbe@0
 | 
    19       content = function()
 | 
| 
bsw/jbe@0
 | 
    20         ui.image{ static = "icons/16/table_go.png" }
 | 
| 
bsw/jbe@0
 | 
    21         slot.put(_"Delegate")
 | 
| 
bsw/jbe@0
 | 
    22       end,
 | 
| 
bsw/jbe@0
 | 
    23       module = "delegation",
 | 
| 
bsw/jbe@0
 | 
    24       view = "new",
 | 
| 
bsw/jbe@0
 | 
    25       params = { issue_id = issue.id }
 | 
| 
bsw/jbe@0
 | 
    26     }
 | 
| 
bsw/jbe@0
 | 
    27   end
 | 
| 
bsw/jbe@0
 | 
    28 
 | 
| 
bsw/jbe@0
 | 
    29   ui.twitter("http://example.com/t" .. tostring(issue.id))
 | 
| 
bsw/jbe@0
 | 
    30 
 | 
| 
bsw/jbe@0
 | 
    31 end)
 | 
| 
bsw/jbe@0
 | 
    32 
 | 
| 
bsw/jbe@0
 | 
    33 execute.view{
 | 
| 
bsw/jbe@0
 | 
    34   module = "interest",
 | 
| 
bsw/jbe@0
 | 
    35   view = "_show_box",
 | 
| 
bsw/jbe@0
 | 
    36   params = { issue = issue }
 | 
| 
bsw/jbe@0
 | 
    37 }
 | 
| 
bsw/jbe@0
 | 
    38 
 | 
| 
bsw/jbe@0
 | 
    39 execute.view{
 | 
| 
bsw/jbe@0
 | 
    40   module = "delegation",
 | 
| 
bsw/jbe@0
 | 
    41   view = "_show_box",
 | 
| 
bsw/jbe@0
 | 
    42   params = { issue_id = issue.id }
 | 
| 
bsw/jbe@0
 | 
    43 }
 | 
| 
bsw/jbe@0
 | 
    44 
 | 
| 
bsw/jbe@0
 | 
    45 ui.tabs{
 | 
| 
bsw/jbe@0
 | 
    46   {
 | 
| 
bsw/jbe@0
 | 
    47     name = "initiatives",
 | 
| 
bsw/jbe@0
 | 
    48     label = _"Initiatives",
 | 
| 
bsw/jbe@0
 | 
    49     content = function()
 | 
| 
bsw/jbe@0
 | 
    50       execute.view{
 | 
| 
bsw/jbe@0
 | 
    51         module = "initiative",
 | 
| 
bsw/jbe@0
 | 
    52         view = "_list",
 | 
| 
bsw/jbe@0
 | 
    53         params = { 
 | 
| 
bsw/jbe@0
 | 
    54           issue = issue,
 | 
| 
bsw/jbe@0
 | 
    55           initiatives_selector = issue:get_reference_selector("initiatives")
 | 
| 
bsw/jbe@0
 | 
    56         }
 | 
| 
bsw/jbe@0
 | 
    57       }
 | 
| 
bsw/jbe@0
 | 
    58       slot.put("<br />")
 | 
| 
bsw/jbe@0
 | 
    59       if not issue.frozen and not issue.closed then
 | 
| 
bsw/jbe@0
 | 
    60         ui.link{
 | 
| 
bsw/jbe@0
 | 
    61           attr = { class = "action" },
 | 
| 
bsw/jbe@0
 | 
    62           content = function()
 | 
| 
bsw/jbe@0
 | 
    63             ui.image{ static = "icons/16/script_add.png" }
 | 
| 
bsw/jbe@0
 | 
    64             slot.put(_"Add new initiative to issue")
 | 
| 
bsw/jbe@0
 | 
    65           end,
 | 
| 
bsw/jbe@0
 | 
    66           module = "initiative",
 | 
| 
bsw/jbe@0
 | 
    67           view = "new",
 | 
| 
bsw/jbe@0
 | 
    68           params = { issue_id = issue.id }
 | 
| 
bsw/jbe@0
 | 
    69         }
 | 
| 
bsw/jbe@0
 | 
    70       end
 | 
| 
bsw/jbe@0
 | 
    71     end
 | 
| 
bsw/jbe@0
 | 
    72   },
 | 
| 
bsw/jbe@0
 | 
    73 --[[  {
 | 
| 
bsw/jbe@0
 | 
    74     name = "voting_requests",
 | 
| 
bsw/jbe@0
 | 
    75     label = _"Voting requests",
 | 
| 
bsw/jbe@0
 | 
    76     content = function()
 | 
| 
bsw/jbe@0
 | 
    77       execute.view{
 | 
| 
bsw/jbe@0
 | 
    78         module = "issue_voting_request",
 | 
| 
bsw/jbe@0
 | 
    79         view = "_list",
 | 
| 
bsw/jbe@0
 | 
    80         params = { issue = issue }
 | 
| 
bsw/jbe@0
 | 
    81       }
 | 
| 
bsw/jbe@0
 | 
    82     end
 | 
| 
bsw/jbe@0
 | 
    83   },
 | 
| 
bsw/jbe@0
 | 
    84 --]]
 | 
| 
bsw/jbe@0
 | 
    85   {
 | 
| 
bsw/jbe@0
 | 
    86     name = "details",
 | 
| 
bsw/jbe@0
 | 
    87     label = _"Details",
 | 
| 
bsw/jbe@0
 | 
    88     content = function()
 | 
| 
bsw/jbe@0
 | 
    89       ui.form{
 | 
| 
bsw/jbe@0
 | 
    90         record = issue,
 | 
| 
bsw/jbe@0
 | 
    91         readonly = true,
 | 
| 
bsw/jbe@0
 | 
    92         attr = { class = "vertical" },
 | 
| 
bsw/jbe@0
 | 
    93         content = function()
 | 
| 
bsw/jbe@0
 | 
    94           trace.debug(issue.created)
 | 
| 
bsw/jbe@0
 | 
    95           ui.field.text{ label = _"State", name = "state" }
 | 
| 
bsw/jbe@0
 | 
    96           ui.field.timestamp{ label = _"Created at", name = "created" }
 | 
| 
bsw/jbe@0
 | 
    97           ui.field.timestamp{ label = _"Accepted", name = "accepted" }
 | 
| 
bsw/jbe@0
 | 
    98           ui.field.timestamp{ label = _"Half frozen", name = "half_frozen" }
 | 
| 
bsw/jbe@0
 | 
    99           ui.field.timestamp{ label = _"Fully frozen", name = "fully_frozen" }
 | 
| 
bsw/jbe@0
 | 
   100           ui.field.timestamp{ label = _"Closed", name = "closed" }
 | 
| 
bsw/jbe@0
 | 
   101           ui.field.potential_issue_weight{ label = _"Potential weight", name = "potential_weight" }
 | 
| 
bsw/jbe@0
 | 
   102           ui.field.vote_now{ label = _"Vote now", name = "vote_now" }
 | 
| 
bsw/jbe@0
 | 
   103           ui.field.vote_later{ label = _"Vote later", name = "vote_later" }
 | 
| 
bsw/jbe@0
 | 
   104         end
 | 
| 
bsw/jbe@0
 | 
   105       }
 | 
| 
bsw/jbe@0
 | 
   106     end
 | 
| 
bsw/jbe@0
 | 
   107   },
 | 
| 
bsw/jbe@0
 | 
   108 }
 | 
| 
bsw/jbe@0
 | 
   109 
 | 
| 
bsw/jbe@0
 | 
   110 
 |