liquid_feedback_frontend
annotate 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 |
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@2 | 45 execute.view{ |
bsw@2 | 46 module = "issue", |
bsw@2 | 47 view = "_show_box", |
bsw@2 | 48 params = { issue = issue } |
bsw@2 | 49 } |
bsw@2 | 50 |
bsw/jbe@0 | 51 ui.tabs{ |
bsw/jbe@0 | 52 { |
bsw/jbe@0 | 53 name = "initiatives", |
bsw/jbe@0 | 54 label = _"Initiatives", |
bsw@2 | 55 content = function() execute.view{ |
bsw/jbe@0 | 56 module = "initiative", |
bsw/jbe@0 | 57 view = "_list", |
bsw/jbe@0 | 58 params = { |
bsw/jbe@0 | 59 issue = issue, |
bsw/jbe@0 | 60 initiatives_selector = issue:get_reference_selector("initiatives") |
bsw/jbe@0 | 61 } |
bsw/jbe@0 | 62 } |
bsw/jbe@0 | 63 slot.put("<br />") |
bsw@3 | 64 if not issue.fully_frozen and not issue.closed then |
bsw/jbe@0 | 65 ui.link{ |
bsw/jbe@0 | 66 attr = { class = "action" }, |
bsw/jbe@0 | 67 content = function() |
bsw/jbe@0 | 68 ui.image{ static = "icons/16/script_add.png" } |
bsw/jbe@0 | 69 slot.put(_"Add new initiative to issue") |
bsw/jbe@0 | 70 end, |
bsw/jbe@0 | 71 module = "initiative", |
bsw/jbe@0 | 72 view = "new", |
bsw/jbe@0 | 73 params = { issue_id = issue.id } |
bsw/jbe@0 | 74 } |
bsw/jbe@0 | 75 end |
bsw/jbe@0 | 76 end |
bsw/jbe@0 | 77 }, |
bsw/jbe@0 | 78 --[[ { |
bsw/jbe@0 | 79 name = "voting_requests", |
bsw/jbe@0 | 80 label = _"Voting requests", |
bsw/jbe@0 | 81 content = function() |
bsw/jbe@0 | 82 execute.view{ |
bsw/jbe@0 | 83 module = "issue_voting_request", |
bsw/jbe@0 | 84 view = "_list", |
bsw/jbe@0 | 85 params = { issue = issue } |
bsw/jbe@0 | 86 } |
bsw/jbe@0 | 87 end |
bsw/jbe@0 | 88 }, |
bsw/jbe@0 | 89 --]] |
bsw/jbe@0 | 90 { |
bsw@3 | 91 name = "interested_members", |
bsw@3 | 92 label = _"Interested members", |
bsw@3 | 93 content = function() |
bsw@3 | 94 execute.view{ |
bsw@3 | 95 module = "member", |
bsw@3 | 96 view = "_list", |
bsw@3 | 97 params = { |
bsw@3 | 98 issue = issue, |
bsw@3 | 99 members_selector = issue:get_reference_selector("interested_members_snapshot") |
bsw@3 | 100 :join("issue", nil, "issue.id = direct_interest_snapshot.issue_id") |
bsw@3 | 101 :add_field("direct_interest_snapshot.weight") |
bsw@3 | 102 :add_where("direct_interest_snapshot.event = issue.latest_snapshot_event") |
bsw@3 | 103 } |
bsw@3 | 104 } |
bsw@3 | 105 end |
bsw@3 | 106 }, |
bsw@3 | 107 { |
bsw@2 | 108 name = "delegations", |
bsw@2 | 109 label = _"Delegations", |
bsw@2 | 110 content = function() |
bsw@2 | 111 execute.view{ |
bsw@2 | 112 module = "delegation", |
bsw@2 | 113 view = "_list", |
bsw@2 | 114 params = { delegations_selector = issue:get_reference_selector("delegations") } |
bsw@2 | 115 } |
bsw@2 | 116 end |
bsw@2 | 117 }, |
bsw@2 | 118 { |
bsw/jbe@0 | 119 name = "details", |
bsw/jbe@0 | 120 label = _"Details", |
bsw/jbe@0 | 121 content = function() |
bsw@2 | 122 local policy = issue.policy |
bsw/jbe@0 | 123 ui.form{ |
bsw/jbe@0 | 124 record = issue, |
bsw/jbe@0 | 125 readonly = true, |
bsw/jbe@0 | 126 attr = { class = "vertical" }, |
bsw/jbe@0 | 127 content = function() |
bsw/jbe@0 | 128 ui.field.text{ label = _"State", name = "state" } |
bsw@2 | 129 ui.field.timestamp{ label = _"Created at", name = "created" } |
bsw@3 | 130 ui.field.text{ label = _"Admission time", value = policy.admission_time } |
bsw@3 | 131 ui.field.text{ |
bsw@3 | 132 label = _"Issue quorum", |
bsw@3 | 133 value = format.percentage(policy.issue_quorum_num / policy.issue_quorum_den) |
bsw@3 | 134 } |
bsw@3 | 135 ui.field.timestamp{ label = _"Accepted at", name = "accepted" } |
bsw@3 | 136 ui.field.text{ label = _"Discussion time", value = policy.discussion_time } |
bsw@2 | 137 ui.field.vote_now{ label = _"Vote now", name = "vote_now" } |
bsw/jbe@0 | 138 ui.field.vote_later{ label = _"Vote later", name = "vote_later" } |
bsw@3 | 139 ui.field.timestamp{ label = _"Half frozen at", name = "half_frozen" } |
bsw@3 | 140 ui.field.text{ label = _"Verification time", value = policy.verification_time } |
bsw@3 | 141 ui.field.text{ |
bsw@3 | 142 label = _"Initiative quorum", |
bsw@3 | 143 value = format.percentage(policy.initiative_quorum_num / policy.initiative_quorum_den) |
bsw@3 | 144 } |
bsw@3 | 145 ui.field.timestamp{ label = _"Fully frozen at", name = "fully_frozen" } |
bsw@3 | 146 ui.field.text{ label = _"Voting time", value = policy.voting_time } |
bsw@2 | 147 ui.field.timestamp{ label = _"Closed", name = "closed" } |
bsw@2 | 148 end |
bsw@2 | 149 } |
bsw@2 | 150 ui.form{ |
bsw@2 | 151 record = issue.policy, |
bsw@2 | 152 readonly = true, |
bsw@2 | 153 content = function() |
bsw/jbe@0 | 154 end |
bsw/jbe@0 | 155 } |
bsw/jbe@0 | 156 end |
bsw/jbe@0 | 157 }, |
bsw/jbe@0 | 158 } |
bsw/jbe@0 | 159 |
bsw/jbe@0 | 160 |