liquid_feedback_frontend
view app/main/issue/show.lua @ 3:768faea1096d
Version alpha4
Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.
Initiatives may provide a link to an external discussion platform
Direct link on every initiative page to create an alternative initiative
Bugfix: No error when clicking "neutral", when "neutral" is currently selected
Members interested in an issue or supporting an initiative have a weight information attached. Browsing the members causing that weight is possible.
Initiatives may provide a link to an external discussion platform
Direct link on every initiative page to create an alternative initiative
Bugfix: No error when clicking "neutral", when "neutral" is currently selected
| author | bsw | 
|---|---|
| date | Mon Nov 30 12:00:00 2009 +0100 (2009-11-30) | 
| parents | 5c601807d397 | 
| children | 80c215dbf076 | 
 line source
     1 local issue = Issue:by_id(param.get_id())
     3 slot.put_into("html_head", '<link rel="alternate" type="application/rss+xml" title="RSS" href="../show/' .. tostring(issue.id) .. '.rss" />')
     5 slot.select("path", function()
     6   ui.link{
     7     content = _"Area '#{name}'":gsub("#{name}", issue.area.name),
     8     module = "area",
     9     view = "show",
    10     id = issue.area.id
    11   }
    12 end)
    14 slot.put_into("title", encode.html(_"Issue ##{id} (#{policy_name})":gsub("#{id}", issue.id):gsub("#{policy_name}", issue.policy.name)))
    16 slot.select("actions", function()
    17   if not issue.closed then
    18     ui.link{
    19       content = function()
    20         ui.image{ static = "icons/16/table_go.png" }
    21         slot.put(_"Delegate")
    22       end,
    23       module = "delegation",
    24       view = "new",
    25       params = { issue_id = issue.id }
    26     }
    27   end
    29   ui.twitter("http://example.com/t" .. tostring(issue.id))
    31 end)
    33 execute.view{
    34   module = "interest",
    35   view = "_show_box",
    36   params = { issue = issue }
    37 }
    39 execute.view{
    40   module = "delegation",
    41   view = "_show_box",
    42   params = { issue_id = issue.id }
    43 }
    45 execute.view{
    46   module = "issue",
    47   view = "_show_box",
    48   params = { issue = issue }
    49 }
    51 ui.tabs{
    52   {
    53     name = "initiatives",
    54     label = _"Initiatives",
    55     content = function()      execute.view{
    56         module = "initiative",
    57         view = "_list",
    58         params = { 
    59           issue = issue,
    60           initiatives_selector = issue:get_reference_selector("initiatives")
    61         }
    62       }
    63       slot.put("<br />")
    64       if not issue.fully_frozen and not issue.closed then
    65         ui.link{
    66           attr = { class = "action" },
    67           content = function()
    68             ui.image{ static = "icons/16/script_add.png" }
    69             slot.put(_"Add new initiative to issue")
    70           end,
    71           module = "initiative",
    72           view = "new",
    73           params = { issue_id = issue.id }
    74         }
    75       end
    76     end
    77   },
    78 --[[  {
    79     name = "voting_requests",
    80     label = _"Voting requests",
    81     content = function()
    82       execute.view{
    83         module = "issue_voting_request",
    84         view = "_list",
    85         params = { issue = issue }
    86       }
    87     end
    88   },
    89 --]]
    90   {
    91     name = "interested_members",
    92     label = _"Interested members",
    93     content = function()
    94       execute.view{
    95         module = "member",
    96         view = "_list",
    97         params = {
    98           issue = issue,
    99           members_selector =  issue:get_reference_selector("interested_members_snapshot")
   100             :join("issue", nil, "issue.id = direct_interest_snapshot.issue_id")
   101             :add_field("direct_interest_snapshot.weight")
   102             :add_where("direct_interest_snapshot.event = issue.latest_snapshot_event")
   103         }
   104       }
   105     end
   106   },
   107   {
   108     name = "delegations",
   109     label = _"Delegations",
   110     content = function()
   111       execute.view{
   112         module = "delegation",
   113         view = "_list",
   114         params = { delegations_selector = issue:get_reference_selector("delegations") }
   115       }
   116     end
   117   },
   118   {
   119     name = "details",
   120     label = _"Details",
   121     content = function()
   122       local policy = issue.policy
   123       ui.form{
   124         record = issue,
   125         readonly = true,
   126         attr = { class = "vertical" },
   127         content = function()
   128           ui.field.text{ label = _"State", name = "state" }
   129           ui.field.timestamp{ label = _"Created at",            name = "created" }
   130           ui.field.text{      label = _"Admission time",        value = policy.admission_time }
   131           ui.field.text{
   132             label = _"Issue quorum",
   133             value = format.percentage(policy.issue_quorum_num / policy.issue_quorum_den)
   134           }
   135           ui.field.timestamp{ label = _"Accepted at",              name = "accepted" }
   136           ui.field.text{      label = _"Discussion time",       value = policy.discussion_time }
   137           ui.field.vote_now{   label = _"Vote now", name = "vote_now" }
   138           ui.field.vote_later{ label = _"Vote later", name = "vote_later" }
   139           ui.field.timestamp{ label = _"Half frozen at",           name = "half_frozen" }
   140           ui.field.text{      label = _"Verification time",     value = policy.verification_time }
   141           ui.field.text{
   142             label   = _"Initiative quorum",
   143             value = format.percentage(policy.initiative_quorum_num / policy.initiative_quorum_den)
   144           }
   145           ui.field.timestamp{ label = _"Fully frozen at",          name = "fully_frozen" }
   146           ui.field.text{      label = _"Voting time",           value = policy.voting_time }
   147           ui.field.timestamp{ label = _"Closed",                name = "closed" }
   148         end
   149       }
   150       ui.form{
   151         record = issue.policy,
   152         readonly = true,
   153         content = function()
   154         end
   155       }
   156     end
   157   },
   158 }
