| rev | 
   line source | 
| 
bsw/jbe@4
 | 
     1 local issue = param.get("issue", "table")
 | 
| 
bsw/jbe@4
 | 
     2 
 | 
| 
bsw@51
 | 
     3 local direct_voter
 | 
| 
bsw@51
 | 
     4 
 | 
| 
bsw@51
 | 
     5 if app.session.member_id then
 | 
| 
bsw@51
 | 
     6   direct_voter = DirectVoter:by_pk(issue.id, app.session.member.id)
 | 
| 
bsw@51
 | 
     7 end
 | 
| 
bsw/jbe@19
 | 
     8 
 | 
| 
bsw/jbe@52
 | 
     9 if config.feature_rss_enabled then
 | 
| 
bsw/jbe@52
 | 
    10   util.html_rss_head{ title = _"Initiatives in this issue (last created first)", module = "initiative", view = "list_rss", params = { issue_id = issue.id } }
 | 
| 
bsw/jbe@52
 | 
    11   util.html_rss_head{ title = _"Initiatives in this issue (last updated first)", module = "initiative", view = "list_rss", params = { issue_id = issue.id, order = "last_updated" } }
 | 
| 
bsw/jbe@52
 | 
    12 end
 | 
| 
bsw/jbe@4
 | 
    13 
 | 
| 
bsw/jbe@4
 | 
    14 slot.select("path", function()
 | 
| 
bsw/jbe@19
 | 
    15 end)
 | 
| 
bsw/jbe@19
 | 
    16 
 | 
| 
bsw/jbe@19
 | 
    17 slot.select("title", function()
 | 
| 
bsw/jbe@4
 | 
    18   ui.link{
 | 
| 
bsw/jbe@19
 | 
    19     content = issue.area.name,
 | 
| 
bsw/jbe@4
 | 
    20     module = "area",
 | 
| 
bsw/jbe@4
 | 
    21     view = "show",
 | 
| 
bsw/jbe@4
 | 
    22     id = issue.area.id
 | 
| 
bsw/jbe@4
 | 
    23   }
 | 
| 
bsw/jbe@19
 | 
    24   slot.put(" · ")
 | 
| 
bsw/jbe@5
 | 
    25   ui.link{
 | 
| 
bsw/jbe@19
 | 
    26     content = _("Issue ##{id}", { id = issue.id }),
 | 
| 
bsw/jbe@5
 | 
    27     module = "issue",
 | 
| 
bsw/jbe@5
 | 
    28     view = "show",
 | 
| 
bsw/jbe@5
 | 
    29     id = issue.id
 | 
| 
bsw/jbe@5
 | 
    30   }
 | 
| 
bsw/jbe@19
 | 
    31   slot.put(" · ")
 | 
| 
bsw/jbe@19
 | 
    32   ui.tag{
 | 
| 
bsw/jbe@19
 | 
    33     tag = "span",
 | 
| 
bsw/jbe@19
 | 
    34     content = issue.state_name,
 | 
| 
bsw/jbe@19
 | 
    35   }
 | 
| 
bsw/jbe@5
 | 
    36 end)
 | 
| 
bsw/jbe@5
 | 
    37 
 | 
| 
bsw/jbe@4
 | 
    38 
 | 
| 
bsw/jbe@4
 | 
    39 slot.select("actions", function()
 | 
| 
bsw/jbe@5
 | 
    40 
 | 
| 
bsw@51
 | 
    41   if app.session.member_id then
 | 
| 
bsw@51
 | 
    42 
 | 
| 
bsw@51
 | 
    43     if issue.state == 'voting' then
 | 
| 
bsw@51
 | 
    44       local text
 | 
| 
bsw@51
 | 
    45       if not direct_voter then
 | 
| 
bsw@51
 | 
    46         text = _"Vote now"
 | 
| 
bsw@51
 | 
    47       else
 | 
| 
bsw@51
 | 
    48         text = _"Change vote"
 | 
| 
bsw@51
 | 
    49       end
 | 
| 
bsw@51
 | 
    50       ui.link{
 | 
| 
bsw@51
 | 
    51         content = function()
 | 
| 
bsw@51
 | 
    52           ui.image{ static = "icons/16/email_open.png" }
 | 
| 
bsw@51
 | 
    53           slot.put(text)
 | 
| 
bsw@51
 | 
    54         end,
 | 
| 
bsw@51
 | 
    55         module = "vote",
 | 
| 
bsw@51
 | 
    56         view = "list",
 | 
| 
bsw@51
 | 
    57         params = { issue_id = issue.id }
 | 
| 
bsw@51
 | 
    58       }
 | 
| 
bsw/jbe@19
 | 
    59     end
 | 
| 
bsw/jbe@5
 | 
    60 
 | 
| 
bsw/jbe@5
 | 
    61     execute.view{
 | 
| 
bsw@51
 | 
    62       module = "interest",
 | 
| 
bsw/jbe@5
 | 
    63       view = "_show_box",
 | 
| 
bsw@51
 | 
    64       params = { issue = issue }
 | 
| 
bsw/jbe@5
 | 
    65     }
 | 
| 
bsw@7
 | 
    66 
 | 
| 
bsw@51
 | 
    67     if not issue.closed then
 | 
| 
bsw@51
 | 
    68       execute.view{
 | 
| 
bsw@51
 | 
    69         module = "delegation",
 | 
| 
bsw@51
 | 
    70         view = "_show_box",
 | 
| 
bsw@51
 | 
    71         params = { issue_id = issue.id }
 | 
| 
bsw@51
 | 
    72       }
 | 
| 
bsw@51
 | 
    73     end
 | 
| 
bsw@51
 | 
    74 
 | 
| 
bsw@51
 | 
    75     execute.view{
 | 
| 
bsw@51
 | 
    76       module = "issue",
 | 
| 
bsw@51
 | 
    77       view = "_show_vote_later_box",
 | 
| 
bsw@51
 | 
    78       params = { issue = issue }
 | 
| 
bsw@51
 | 
    79     }
 | 
| 
bsw@51
 | 
    80 
 | 
| 
bsw@51
 | 
    81   end
 | 
| 
bsw/jbe@4
 | 
    82 
 | 
| 
bsw@10
 | 
    83   if config.issue_discussion_url_func then
 | 
| 
bsw@10
 | 
    84     local url = config.issue_discussion_url_func(issue)
 | 
| 
bsw@10
 | 
    85     ui.link{
 | 
| 
bsw@10
 | 
    86       attr = { target = "_blank" },
 | 
| 
bsw@10
 | 
    87       external = url,
 | 
| 
bsw@10
 | 
    88       content = function()
 | 
| 
bsw@10
 | 
    89         ui.image{ static = "icons/16/comments.png" }
 | 
| 
bsw@10
 | 
    90         slot.put(_"Discussion on issue")
 | 
| 
bsw@10
 | 
    91       end,
 | 
| 
bsw@10
 | 
    92     }
 | 
| 
bsw@10
 | 
    93   end
 | 
| 
bsw/jbe@4
 | 
    94 end)
 | 
| 
bsw/jbe@4
 | 
    95 
 | 
| 
bsw/jbe@4
 | 
    96 
 | 
| 
bsw/jbe@4
 | 
    97 execute.view{
 | 
| 
bsw/jbe@4
 | 
    98   module = "issue",
 | 
| 
bsw/jbe@4
 | 
    99   view = "_show_box",
 | 
| 
bsw/jbe@4
 | 
   100   params = { issue = issue }
 | 
| 
bsw/jbe@4
 | 
   101 }
 | 
| 
bsw/jbe@4
 | 
   102 
 | 
| 
bsw/jbe@4
 | 
   103 --  ui.twitter("http://example.com/t" .. tostring(issue.id))
 | 
| 
bsw/jbe@6
 | 
   104 
 | 
| 
bsw@60
 | 
   105 if config.public_access_issue_head and not app.session.member_id then
 | 
| 
bsw@60
 | 
   106   config.public_access_issue_head(issue)
 | 
| 
bsw@60
 | 
   107 end
 | 
| 
bsw/jbe@6
 | 
   108 
 | 
| 
bsw@60
 | 
   109 if app.session.member_id and issue.state == 'voting' and not direct_voter then
 | 
| 
bsw/jbe@6
 | 
   110   ui.container{
 | 
| 
bsw/jbe@6
 | 
   111     attr = { class = "voting_active_info" },
 | 
| 
bsw/jbe@6
 | 
   112     content = function()
 | 
| 
bsw/jbe@6
 | 
   113       slot.put(_"Voting for this issue is currently running!")
 | 
| 
bsw/jbe@6
 | 
   114       slot.put(" ")
 | 
| 
bsw@51
 | 
   115       if app.session.member_id then
 | 
| 
bsw@51
 | 
   116         ui.link{
 | 
| 
bsw@51
 | 
   117           content = function()
 | 
| 
bsw@51
 | 
   118             slot.put(_"Vote now")
 | 
| 
bsw@51
 | 
   119           end,
 | 
| 
bsw@51
 | 
   120           module = "vote",
 | 
| 
bsw@51
 | 
   121           view = "list",
 | 
| 
bsw@51
 | 
   122           params = { issue_id = issue.id }
 | 
| 
bsw@51
 | 
   123         }
 | 
| 
bsw@51
 | 
   124       end
 | 
| 
bsw/jbe@6
 | 
   125     end
 | 
| 
bsw/jbe@6
 | 
   126   }
 | 
| 
bsw/jbe@6
 | 
   127   slot.put("<br />")
 | 
| 
bsw/jbe@6
 | 
   128 end
 | 
| 
bsw/jbe@6
 | 
   129 
 |