liquid_feedback_frontend

diff app/main/issue/show.lua @ 0:3bfb2fcf7ab9

Version alpha1
author bsw/jbe
date Wed Nov 18 12:00:00 2009 +0100 (2009-11-18)
parents
children 5c601807d397
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/issue/show.lua	Wed Nov 18 12:00:00 2009 +0100
     1.3 @@ -0,0 +1,110 @@
     1.4 +local issue = Issue:by_id(param.get_id())
     1.5 +
     1.6 +slot.put_into("html_head", '<link rel="alternate" type="application/rss+xml" title="RSS" href="../show/' .. tostring(issue.id) .. '.rss" />')
     1.7 +
     1.8 +slot.select("path", function()
     1.9 +  ui.link{
    1.10 +    content = _"Area '#{name}'":gsub("#{name}", issue.area.name),
    1.11 +    module = "area",
    1.12 +    view = "show",
    1.13 +    id = issue.area.id
    1.14 +  }
    1.15 +end)
    1.16 +
    1.17 +slot.put_into("title", encode.html(_"Issue ##{id} (#{policy_name})":gsub("#{id}", issue.id):gsub("#{policy_name}", issue.policy.name)))
    1.18 +
    1.19 +slot.select("actions", function()
    1.20 +  if not issue.closed then
    1.21 +    ui.link{
    1.22 +      content = function()
    1.23 +        ui.image{ static = "icons/16/table_go.png" }
    1.24 +        slot.put(_"Delegate")
    1.25 +      end,
    1.26 +      module = "delegation",
    1.27 +      view = "new",
    1.28 +      params = { issue_id = issue.id }
    1.29 +    }
    1.30 +  end
    1.31 +
    1.32 +  ui.twitter("http://example.com/t" .. tostring(issue.id))
    1.33 +
    1.34 +end)
    1.35 +
    1.36 +execute.view{
    1.37 +  module = "interest",
    1.38 +  view = "_show_box",
    1.39 +  params = { issue = issue }
    1.40 +}
    1.41 +
    1.42 +execute.view{
    1.43 +  module = "delegation",
    1.44 +  view = "_show_box",
    1.45 +  params = { issue_id = issue.id }
    1.46 +}
    1.47 +
    1.48 +ui.tabs{
    1.49 +  {
    1.50 +    name = "initiatives",
    1.51 +    label = _"Initiatives",
    1.52 +    content = function()
    1.53 +      execute.view{
    1.54 +        module = "initiative",
    1.55 +        view = "_list",
    1.56 +        params = { 
    1.57 +          issue = issue,
    1.58 +          initiatives_selector = issue:get_reference_selector("initiatives")
    1.59 +        }
    1.60 +      }
    1.61 +      slot.put("<br />")
    1.62 +      if not issue.frozen and not issue.closed then
    1.63 +        ui.link{
    1.64 +          attr = { class = "action" },
    1.65 +          content = function()
    1.66 +            ui.image{ static = "icons/16/script_add.png" }
    1.67 +            slot.put(_"Add new initiative to issue")
    1.68 +          end,
    1.69 +          module = "initiative",
    1.70 +          view = "new",
    1.71 +          params = { issue_id = issue.id }
    1.72 +        }
    1.73 +      end
    1.74 +    end
    1.75 +  },
    1.76 +--[[  {
    1.77 +    name = "voting_requests",
    1.78 +    label = _"Voting requests",
    1.79 +    content = function()
    1.80 +      execute.view{
    1.81 +        module = "issue_voting_request",
    1.82 +        view = "_list",
    1.83 +        params = { issue = issue }
    1.84 +      }
    1.85 +    end
    1.86 +  },
    1.87 +--]]
    1.88 +  {
    1.89 +    name = "details",
    1.90 +    label = _"Details",
    1.91 +    content = function()
    1.92 +      ui.form{
    1.93 +        record = issue,
    1.94 +        readonly = true,
    1.95 +        attr = { class = "vertical" },
    1.96 +        content = function()
    1.97 +          trace.debug(issue.created)
    1.98 +          ui.field.text{ label = _"State", name = "state" }
    1.99 +          ui.field.timestamp{ label = _"Created at", name = "created" }
   1.100 +          ui.field.timestamp{ label = _"Accepted", name = "accepted" }
   1.101 +          ui.field.timestamp{ label = _"Half frozen", name = "half_frozen" }
   1.102 +          ui.field.timestamp{ label = _"Fully frozen", name = "fully_frozen" }
   1.103 +          ui.field.timestamp{ label = _"Closed", name = "closed" }
   1.104 +          ui.field.potential_issue_weight{ label = _"Potential weight", name = "potential_weight" }
   1.105 +          ui.field.vote_now{ label = _"Vote now", name = "vote_now" }
   1.106 +          ui.field.vote_later{ label = _"Vote later", name = "vote_later" }
   1.107 +        end
   1.108 +      }
   1.109 +    end
   1.110 +  },
   1.111 +}
   1.112 +
   1.113 +

Impressum / About Us