liquid_feedback_frontend
changeset 242:2dc13655afca
Removed vote later support (which was removed from core-2)
author | bsw |
---|---|
date | Fri Dec 30 03:02:09 2011 +0100 (2011-12-30) |
parents | 6725c13b6ce0 |
children | ec86db506312 |
files | app/main/interest/_action/update_voting_requested.lua app/main/issue/_show_vote_later_box.lua app/main/issue/show_tab.lua app/main/member/show_tab.lua static/style.css |
line diff
1.1 --- a/app/main/interest/_action/update_voting_requested.lua Fri Dec 30 02:59:43 2011 +0100 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 @@ -1,23 +0,0 @@ 1.4 -local issue_id = assert(param.get("issue_id", atom.integer), "no issue id given") 1.5 - 1.6 -local interest = Interest:by_pk(issue_id, app.session.member.id) 1.7 - 1.8 -local issue = Issue:new_selector():add_where{ "id = ?", issue_id }:for_share():single_object_mode():exec() 1.9 - 1.10 -if issue.closed then 1.11 - slot.put_into("error", _"This issue is already closed.") 1.12 - return false 1.13 -elseif issue.half_frozen then 1.14 - slot.put_into("error", _"This issue is already frozen.") 1.15 - return false 1.16 -end 1.17 - 1.18 -interest.voting_requested = param.get("voting_requested", atom.boolean) 1.19 - 1.20 -if interest.voting_requested == true then 1.21 - error("not implemented yet") 1.22 -end 1.23 - 1.24 -interest:save() 1.25 - 1.26 -slot.put_into("notice", _"Voting request updated")
2.1 --- a/app/main/issue/_show_vote_later_box.lua Fri Dec 30 02:59:43 2011 +0100 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,77 +0,0 @@ 2.4 -local issue = param.get("issue", "table") 2.5 - 2.6 - 2.7 -if issue.closed and issue.half_frozen then 2.8 - return 2.9 -end 2.10 - 2.11 -local interest = Interest:by_pk(issue.id, app.session.member.id) 2.12 - 2.13 -if not interest then 2.14 - return 2.15 -end 2.16 - 2.17 -if interest.voting_requested ~= nil then 2.18 - slot.select("actions", function() 2.19 - 2.20 - ui.container{ 2.21 - attr = { class = "voting_requested vote_info"}, 2.22 - content = function() 2.23 - ui.container{ 2.24 - attr = { 2.25 - class = "head head_active", 2.26 - onclick = "document.getElementById('voting_requested_content').style.display = 'block';" 2.27 - }, 2.28 - content = function() 2.29 - if interest.voting_requested == false then 2.30 - ui.image{ 2.31 - static = "icons/16/clock_play.png" 2.32 - } 2.33 - slot.put(_"You want to vote later") 2.34 - ui.image{ 2.35 - static = "icons/16/dropdown.png" 2.36 - } 2.37 - end 2.38 - end 2.39 - } 2.40 - ui.container{ 2.41 - attr = { class = "content", id = "voting_requested_content" }, 2.42 - content = function() 2.43 - ui.container{ 2.44 - attr = { 2.45 - class = "close", 2.46 - style = "cursor: pointer;", 2.47 - onclick = "document.getElementById('voting_requested_content').style.display = 'none';" 2.48 - }, 2.49 - content = function() 2.50 - ui.image{ static = "icons/16/cross.png" } 2.51 - end 2.52 - } 2.53 - ui.link{ 2.54 - text = _"Remove my request to vote later", 2.55 - module = "interest", 2.56 - action = "update_voting_requested", 2.57 - params = { issue_id = issue.id, voting_requested = nil }, 2.58 - routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } 2.59 - } 2.60 - slot.put("<br />") 2.61 - end 2.62 - } 2.63 - end 2.64 - } 2.65 - end) 2.66 -else 2.67 - if not issue.closed and not issue.half_frozen then 2.68 - ui.link{ 2.69 - image = { static = "icons/16/clock_play.png" }, 2.70 - text = _"Vote later", 2.71 - module = "interest", 2.72 - action = "update_voting_requested", 2.73 - params = { 2.74 - issue_id = issue.id, 2.75 - voting_requested = false 2.76 - }, 2.77 - routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } 2.78 - } 2.79 - end 2.80 -end 2.81 \ No newline at end of file
3.1 --- a/app/main/issue/show_tab.lua Fri Dec 30 02:59:43 2011 +0100 3.2 +++ b/app/main/issue/show_tab.lua Fri Dec 30 03:02:09 2011 +0100 3.3 @@ -5,21 +5,11 @@ 3.4 issue = param.get("issue", "table") 3.5 end 3.6 3.7 -local voting_requested_percentage = 0 3.8 -if issue.vote_later and issue.population and issue.population > 0 then 3.9 - voting_requested_percentage = math.ceil(issue.vote_later / issue.population * 100) 3.10 -end 3.11 - 3.12 local interested_members_selector = issue:get_reference_selector("interested_members_snapshot") 3.13 :join("issue", nil, "issue.id = direct_interest_snapshot.issue_id") 3.14 :add_field("direct_interest_snapshot.weight") 3.15 :add_where("direct_interest_snapshot.event = issue.latest_snapshot_event") 3.16 3.17 -local voting_requests_selector = issue:get_reference_selector("interested_members_snapshot") 3.18 - :join("issue", nil, "issue.id = direct_interest_snapshot.issue_id") 3.19 - :add_where("direct_interest_snapshot.voting_requested = false") 3.20 - :add_where("direct_interest_snapshot.event = issue.latest_snapshot_event") 3.21 - 3.22 local delegations_selector = issue:get_reference_selector("delegations") 3.23 3.24 local tabs = { 3.25 @@ -44,19 +34,6 @@ 3.26 3.27 tabs[#tabs+1] = 3.28 { 3.29 - name = "voting_requests", 3.30 - label = _"Vote later requests" .. " (" .. tostring(voting_requests_selector:count()) .. ") (" .. tostring(voting_requested_percentage) .. "%)", 3.31 - icon = { static = "icons/16/clock_play.png" }, 3.32 - module = "member", 3.33 - view = "_list", 3.34 - params = { 3.35 - issue = issue, 3.36 - members_selector = voting_requests_selector 3.37 - } 3.38 - } 3.39 - 3.40 - tabs[#tabs+1] = 3.41 - { 3.42 name = "delegations", 3.43 label = _"Delegations" .. " (" .. tostring(delegations_selector:count()) .. ")" , 3.44 icon = { static = "icons/16/table_go.png" },
4.1 --- a/app/main/member/show_tab.lua Fri Dec 30 02:59:43 2011 +0100 4.2 +++ b/app/main/member/show_tab.lua Fri Dec 30 03:02:09 2011 +0100 4.3 @@ -47,7 +47,7 @@ 4.4 :join("issue", nil, "issue.id = delegation.issue_id AND issue.closed ISNULL") 4.5 :join("member", nil, "delegation.trustee_id = member.id") 4.6 :add_where{"delegation.truster_id = ?", member.id} 4.7 - :add_where{"member.active = 'f' OR (member.last_login_public IS NULL OR age(member.last_login) > ?::interval)", config.delegation_warning_time } 4.8 + :add_where{"member.active = 'f' OR (member.last_activity IS NULL OR age(member.last_activity) > ?::interval)", config.delegation_warning_time } 4.9 4.10 if broken_delegations:count() > 0 then 4.11 tabs[#tabs+1] = { 4.12 @@ -226,4 +226,4 @@ 4.13 params = { members_selector = contacts_selector }, 4.14 } 4.15 4.16 -ui.tabs(tabs) 4.17 \ No newline at end of file 4.18 +ui.tabs(tabs)
5.1 --- a/static/style.css Fri Dec 30 02:59:43 2011 +0100 5.2 +++ b/static/style.css Fri Dec 30 03:02:09 2011 +0100 5.3 @@ -304,8 +304,7 @@ 5.4 5.5 .interest, 5.6 .slot_support, 5.7 -.delegation, 5.8 -.voting_requested { 5.9 +.delegation { 5.10 float: left; 5.11 position: relative; 5.12 z-index: 1; 5.13 @@ -313,8 +312,7 @@ 5.14 5.15 .interest img, 5.16 .slot_support img, 5.17 -.delegation img, 5.18 -.voting_requested img { 5.19 +.delegation img { 5.20 padding-left: 0.2em; 5.21 padding-right: 0.2em; 5.22 } 5.23 @@ -366,11 +364,6 @@ 5.24 font-size: 80%; 5.25 } 5.26 5.27 -.voting_requested .head_active { 5.28 - background-color: #fdd; 5.29 - border: 1px solid #b77; 5.30 -} 5.31 - 5.32 .vote_info .close { 5.33 position: absolute; 5.34 top: 0;