liquid_feedback_frontend
view app/main/issue/_show_head.lua @ 43:81c4018ad638
Corrected wrong single/many entries, plus two more in Esperanto translation
| author | Dinu Gherman | 
|---|---|
| date | Mon Mar 08 18:51:08 2010 +0100 (2010-03-08) | 
| parents | 00d1004545f1 | 
| children | 0849be391140 | 
 line source
     1 local issue = param.get("issue", "table")
     3 local direct_voter = DirectVoter:by_pk(issue.id, app.session.member.id)
     5 slot.put_into("html_head", '<link rel="alternate" type="application/rss+xml" title="RSS" href="../show/' .. tostring(issue.id) .. '.rss" />')
     7 slot.select("path", function()
     8 end)
    10 slot.select("title", function()
    11   ui.link{
    12     content = issue.area.name,
    13     module = "area",
    14     view = "show",
    15     id = issue.area.id
    16   }
    17   slot.put(" · ")
    18   ui.link{
    19     content = _("Issue ##{id}", { id = issue.id }),
    20     module = "issue",
    21     view = "show",
    22     id = issue.id
    23   }
    24   slot.put(" · ")
    25   ui.tag{
    26     tag = "span",
    27     content = issue.state_name,
    28   }
    29 end)
    32 slot.select("actions", function()
    34   if issue.state == 'voting' then
    35     local text
    36     if not direct_voter then
    37       text = _"Vote now"
    38     else
    39       text = _"Change vote"
    40     end
    41     ui.link{
    42       content = function()
    43         ui.image{ static = "icons/16/email_open.png" }
    44         slot.put(text)
    45       end,
    46       module = "vote",
    47       view = "list",
    48       params = { issue_id = issue.id }
    49     }
    50   end
    52   execute.view{
    53     module = "interest",
    54     view = "_show_box",
    55     params = { issue = issue }
    56   }
    58   if not issue.closed then
    59     execute.view{
    60       module = "delegation",
    61       view = "_show_box",
    62       params = { issue_id = issue.id }
    63     }
    64   end
    66   execute.view{
    67     module = "issue",
    68     view = "_show_vote_later_box",
    69     params = { issue = issue }
    70   }
    72   if config.issue_discussion_url_func then
    73     local url = config.issue_discussion_url_func(issue)
    74     ui.link{
    75       attr = { target = "_blank" },
    76       external = url,
    77       content = function()
    78         ui.image{ static = "icons/16/comments.png" }
    79         slot.put(_"Discussion on issue")
    80       end,
    81     }
    82   end
    83 end)
    86 execute.view{
    87   module = "issue",
    88   view = "_show_box",
    89   params = { issue = issue }
    90 }
    92 --  ui.twitter("http://example.com/t" .. tostring(issue.id))
    95 if issue.state == 'voting' and not direct_voter then
    96   ui.container{
    97     attr = { class = "voting_active_info" },
    98     content = function()
    99       slot.put(_"Voting for this issue is currently running!")
   100       slot.put(" ")
   101       ui.link{
   102         content = function()
   103           slot.put(_"Vote now")
   104         end,
   105         module = "vote",
   106         view = "list",
   107         params = { issue_id = issue.id }
   108       }
   109     end
   110   }
   111   slot.put("<br />")
   112 end
