liquid_feedback_frontend
changeset 812:e12f0348b191
Removed files not needed anymore
author | bsw |
---|---|
date | Fri Jul 06 13:34:02 2012 +0200 (2012-07-06) |
parents | 9a2e5f4be58c |
children | ea2449916c12 |
files | app/main/initiative/show_tab.lua app/main/issue/show_tab.lua |
line diff
1.1 --- a/app/main/initiative/show_tab.lua Wed Jul 04 23:34:21 2012 +0200 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,159 +0,0 @@ 1.4 -local initiative = param.get("initiative", "table") 1.5 -local initiator = param.get("initiator", "table") 1.6 - 1.7 -if not initiative then 1.8 - initiative = Initiative:by_id(param.get("initiative_id", atom.number)) 1.9 -end 1.10 - 1.11 -if not initiator and app.session.member_id then 1.12 - initiator = Initiator:by_pk(initiative.id, app.session.member.id) 1.13 -end 1.14 - 1.15 -local current_draft_name = _"Current draft" 1.16 -if initiative.issue.half_frozen then 1.17 - current_draft_name = _"Voting proposal" 1.18 -end 1.19 - 1.20 -if initiative.issue.state == "finished" then 1.21 - current_draft_name = _"Voted proposal" 1.22 -end 1.23 - 1.24 -local tabs = { 1.25 - { 1.26 - name = "current_draft", 1.27 - label = current_draft_name, 1.28 - icon = { static = "icons/16/script.png" }, 1.29 - module = "draft", 1.30 - view = "_show", 1.31 - params = { 1.32 - draft = initiative.current_draft 1.33 - } 1.34 - } 1.35 -} 1.36 - 1.37 -if config.public_access == "full" or app.session.member_id then 1.38 - if initiative.issue.ranks_available then 1.39 - tabs[#tabs+1] = { 1.40 - name = "voting", 1.41 - label = _"Voting details", 1.42 - icon = { static = "icons/16/email_open.png" }, 1.43 - module = "initiative", 1.44 - view = "_show_voting", 1.45 - params = { 1.46 - initiative = initiative 1.47 - } 1.48 - } 1.49 - end 1.50 -end 1.51 - 1.52 -local suggestion_count = initiative:get_reference_selector("suggestions"):count() 1.53 - 1.54 -tabs[#tabs+1] = { 1.55 - name = "suggestions", 1.56 - label = _"Suggestions" .. " (" .. tostring(suggestion_count) .. ")", 1.57 - icon = { static = "icons/16/comments.png" }, 1.58 - module = "suggestion", 1.59 - view = "_list", 1.60 - params = { 1.61 - initiative = initiative, 1.62 - suggestions_selector = initiative:get_reference_selector("suggestions"), 1.63 - tab_id = param.get("tab_id") 1.64 - } 1.65 -} 1.66 - 1.67 -if config.public_access == "full" or app.session.member_id then 1.68 - local members_selector = initiative:get_reference_selector("supporting_members_snapshot") 1.69 - :join("issue", nil, "issue.id = direct_supporter_snapshot.issue_id") 1.70 - :join("direct_interest_snapshot", nil, "direct_interest_snapshot.event = issue.latest_snapshot_event AND direct_interest_snapshot.issue_id = issue.id AND direct_interest_snapshot.member_id = member.id") 1.71 - :add_field("direct_interest_snapshot.weight") 1.72 - :add_where("direct_supporter_snapshot.event = issue.latest_snapshot_event") 1.73 - :add_where("direct_supporter_snapshot.satisfied") 1.74 - :add_field("direct_supporter_snapshot.informed", "is_informed") 1.75 - 1.76 - local tmp = db:query("SELECT count(1) AS count, sum(weight) AS weight FROM (" .. tostring(members_selector) .. ") as subquery", "object") 1.77 - local direct_satisfied_supporter_count = tmp.count 1.78 - local indirect_satisfied_supporter_count = (tmp.weight or 0) - tmp.count 1.79 - 1.80 - local count_string 1.81 - if indirect_satisfied_supporter_count > 0 then 1.82 - count_string = "(" .. tostring(direct_satisfied_supporter_count) .. "+" .. tostring(indirect_satisfied_supporter_count) .. ")" 1.83 - else 1.84 - count_string = "(" .. tostring(direct_satisfied_supporter_count) .. ")" 1.85 - end 1.86 - 1.87 - tabs[#tabs+1] = { 1.88 - name = "satisfied_supporter", 1.89 - label = _"Supporters" .. " " .. count_string, 1.90 - icon = { static = "icons/16/thumb_up_green.png" }, 1.91 - module = "member", 1.92 - view = "_list", 1.93 - params = { 1.94 - initiative = initiative, 1.95 - members_selector = members_selector 1.96 - } 1.97 - } 1.98 - 1.99 - local members_selector = initiative:get_reference_selector("supporting_members_snapshot") 1.100 - :join("issue", nil, "issue.id = direct_supporter_snapshot.issue_id") 1.101 - :join("direct_interest_snapshot", nil, "direct_interest_snapshot.event = issue.latest_snapshot_event AND direct_interest_snapshot.issue_id = issue.id AND direct_interest_snapshot.member_id = member.id") 1.102 - :add_field("direct_interest_snapshot.weight") 1.103 - :add_where("direct_supporter_snapshot.event = issue.latest_snapshot_event") 1.104 - :add_where("NOT direct_supporter_snapshot.satisfied") 1.105 - :add_field("direct_supporter_snapshot.informed", "is_informed") 1.106 - 1.107 - local tmp = db:query("SELECT count(1) AS count, sum(weight) AS weight FROM (" .. tostring(members_selector) .. ") as subquery", "object") 1.108 - local direct_potential_supporter_count = tmp.count 1.109 - local indirect_potential_supporter_count = (tmp.weight or 0) - tmp.count 1.110 - 1.111 - local count_string 1.112 - if indirect_potential_supporter_count > 0 then 1.113 - count_string = "(" .. tostring(direct_potential_supporter_count) .. "+" .. tostring(indirect_potential_supporter_count) .. ")" 1.114 - else 1.115 - count_string = "(" .. tostring(direct_potential_supporter_count) .. ")" 1.116 - end 1.117 - 1.118 - tabs[#tabs+1] = { 1.119 - name = "supporter", 1.120 - label = _"Potential supporters" .. " " .. count_string, 1.121 - icon = { static = "icons/16/thumb_up.png" }, 1.122 - module = "member", 1.123 - view = "_list", 1.124 - params = { 1.125 - initiative = initiative, 1.126 - members_selector = members_selector 1.127 - } 1.128 - } 1.129 - 1.130 -end 1.131 - 1.132 -local drafts_count = initiative:get_reference_selector("drafts"):count() 1.133 - 1.134 -tabs[#tabs+1] = { 1.135 - name = "drafts", 1.136 - label = _"Draft history" .. " (" .. tostring(drafts_count) .. ")", 1.137 - icon = { static = "icons/16/script.png" }, 1.138 - module = "draft", 1.139 - view = "_list", 1.140 - params = { drafts = initiative.drafts } 1.141 -} 1.142 - 1.143 -tabs[#tabs+1] = { 1.144 - name = "details", 1.145 - label = _"Details", 1.146 - icon = { static = "icons/16/magnifier.png" }, 1.147 - module = "initiative", 1.148 - view = "_details", 1.149 - params = { 1.150 - initiative = initiative, 1.151 - members_selector = members_selector 1.152 - } 1.153 -} 1.154 - 1.155 -tabs.module = "initiative" 1.156 -tabs.view = "show_tab" 1.157 -tabs.static_params = { 1.158 - initiative_id = initiative.id 1.159 -} 1.160 - 1.161 -ui.tabs(tabs) 1.162 -
2.1 --- a/app/main/issue/show_tab.lua Wed Jul 04 23:34:21 2012 +0200 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,66 +0,0 @@ 2.4 -local issue 2.5 -if request.get_json_request_slots() then 2.6 - issue = Issue:by_id(param.get("issue_id")) 2.7 -else 2.8 - issue = param.get("issue", "table") 2.9 -end 2.10 - 2.11 -local interested_members_selector = issue:get_reference_selector("interested_members_snapshot") 2.12 - :join("issue", nil, "issue.id = direct_interest_snapshot.issue_id") 2.13 - :add_field("direct_interest_snapshot.weight") 2.14 - :add_where("direct_interest_snapshot.event = issue.latest_snapshot_event") 2.15 - 2.16 -local delegations_selector = issue:get_reference_selector("delegations") 2.17 - 2.18 -local tabs = { 2.19 - module = "issue", 2.20 - view = "show_tab", 2.21 - static_params = { issue_id = issue.id }, 2.22 -} 2.23 - 2.24 -if app.session.member_id or config.public_access == "full" then 2.25 - tabs[#tabs+1] = 2.26 - { 2.27 - name = "interested_members", 2.28 - label = _"Interested" .. " (" .. tostring(interested_members_selector:count()) .. ")" , 2.29 - module = "member", 2.30 - view = "_list", 2.31 - params = { 2.32 - issue = issue, 2.33 - members_selector = interested_members_selector 2.34 - } 2.35 - } 2.36 - 2.37 - tabs[#tabs+1] = 2.38 - { 2.39 - name = "delegations", 2.40 - label = _"Delegations" .. " (" .. tostring(delegations_selector:count()) .. ")" , 2.41 - module = "delegation", 2.42 - view = "_list", 2.43 - params = { delegations_selector = delegations_selector } 2.44 - } 2.45 -end 2.46 - 2.47 -tabs[#tabs+1] = 2.48 - { 2.49 - name = "details", 2.50 - label = _"Details", 2.51 - module = "issue", 2.52 - view = "_details", 2.53 - params = { issue = issue } 2.54 - } 2.55 - 2.56 -if config.etherpad and app.session.member_id then 2.57 - tabs[#tabs+1] = 2.58 - { 2.59 - name = "pad", 2.60 - label = _"Pad", 2.61 - module = "issue", 2.62 - view = "_pad", 2.63 - params = { issue = issue } 2.64 - } 2.65 -end 2.66 - 2.67 -ui.tabs(tabs) 2.68 - 2.69 -