# HG changeset patch # User bsw # Date 1325210529 -3600 # Node ID 2dc13655afca57f72adc65a81bf19b30e401e292 # Parent 6725c13b6ce012218b5ccaa1d86018deb74cdd6e Removed vote later support (which was removed from core-2) diff -r 6725c13b6ce0 -r 2dc13655afca app/main/interest/_action/update_voting_requested.lua --- a/app/main/interest/_action/update_voting_requested.lua Fri Dec 30 02:59:43 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -local issue_id = assert(param.get("issue_id", atom.integer), "no issue id given") - -local interest = Interest:by_pk(issue_id, app.session.member.id) - -local issue = Issue:new_selector():add_where{ "id = ?", issue_id }:for_share():single_object_mode():exec() - -if issue.closed then - slot.put_into("error", _"This issue is already closed.") - return false -elseif issue.half_frozen then - slot.put_into("error", _"This issue is already frozen.") - return false -end - -interest.voting_requested = param.get("voting_requested", atom.boolean) - -if interest.voting_requested == true then - error("not implemented yet") -end - -interest:save() - -slot.put_into("notice", _"Voting request updated") diff -r 6725c13b6ce0 -r 2dc13655afca app/main/issue/_show_vote_later_box.lua --- a/app/main/issue/_show_vote_later_box.lua Fri Dec 30 02:59:43 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -local issue = param.get("issue", "table") - - -if issue.closed and issue.half_frozen then - return -end - -local interest = Interest:by_pk(issue.id, app.session.member.id) - -if not interest then - return -end - -if interest.voting_requested ~= nil then - slot.select("actions", function() - - ui.container{ - attr = { class = "voting_requested vote_info"}, - content = function() - ui.container{ - attr = { - class = "head head_active", - onclick = "document.getElementById('voting_requested_content').style.display = 'block';" - }, - content = function() - if interest.voting_requested == false then - ui.image{ - static = "icons/16/clock_play.png" - } - slot.put(_"You want to vote later") - ui.image{ - static = "icons/16/dropdown.png" - } - end - end - } - ui.container{ - attr = { class = "content", id = "voting_requested_content" }, - content = function() - ui.container{ - attr = { - class = "close", - style = "cursor: pointer;", - onclick = "document.getElementById('voting_requested_content').style.display = 'none';" - }, - content = function() - ui.image{ static = "icons/16/cross.png" } - end - } - ui.link{ - text = _"Remove my request to vote later", - module = "interest", - action = "update_voting_requested", - params = { issue_id = issue.id, voting_requested = nil }, - routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } - } - slot.put("
") - end - } - end - } - end) -else - if not issue.closed and not issue.half_frozen then - ui.link{ - image = { static = "icons/16/clock_play.png" }, - text = _"Vote later", - module = "interest", - action = "update_voting_requested", - params = { - issue_id = issue.id, - voting_requested = false - }, - routing = { default = { mode = "redirect", module = "issue", view = "show", id = issue.id } } - } - end -end \ No newline at end of file diff -r 6725c13b6ce0 -r 2dc13655afca app/main/issue/show_tab.lua --- a/app/main/issue/show_tab.lua Fri Dec 30 02:59:43 2011 +0100 +++ b/app/main/issue/show_tab.lua Fri Dec 30 03:02:09 2011 +0100 @@ -5,21 +5,11 @@ issue = param.get("issue", "table") end -local voting_requested_percentage = 0 -if issue.vote_later and issue.population and issue.population > 0 then - voting_requested_percentage = math.ceil(issue.vote_later / issue.population * 100) -end - local interested_members_selector = issue:get_reference_selector("interested_members_snapshot") :join("issue", nil, "issue.id = direct_interest_snapshot.issue_id") :add_field("direct_interest_snapshot.weight") :add_where("direct_interest_snapshot.event = issue.latest_snapshot_event") -local voting_requests_selector = issue:get_reference_selector("interested_members_snapshot") - :join("issue", nil, "issue.id = direct_interest_snapshot.issue_id") - :add_where("direct_interest_snapshot.voting_requested = false") - :add_where("direct_interest_snapshot.event = issue.latest_snapshot_event") - local delegations_selector = issue:get_reference_selector("delegations") local tabs = { @@ -44,19 +34,6 @@ tabs[#tabs+1] = { - name = "voting_requests", - label = _"Vote later requests" .. " (" .. tostring(voting_requests_selector:count()) .. ") (" .. tostring(voting_requested_percentage) .. "%)", - icon = { static = "icons/16/clock_play.png" }, - module = "member", - view = "_list", - params = { - issue = issue, - members_selector = voting_requests_selector - } - } - - tabs[#tabs+1] = - { name = "delegations", label = _"Delegations" .. " (" .. tostring(delegations_selector:count()) .. ")" , icon = { static = "icons/16/table_go.png" }, diff -r 6725c13b6ce0 -r 2dc13655afca app/main/member/show_tab.lua --- a/app/main/member/show_tab.lua Fri Dec 30 02:59:43 2011 +0100 +++ b/app/main/member/show_tab.lua Fri Dec 30 03:02:09 2011 +0100 @@ -47,7 +47,7 @@ :join("issue", nil, "issue.id = delegation.issue_id AND issue.closed ISNULL") :join("member", nil, "delegation.trustee_id = member.id") :add_where{"delegation.truster_id = ?", member.id} - :add_where{"member.active = 'f' OR (member.last_login_public IS NULL OR age(member.last_login) > ?::interval)", config.delegation_warning_time } + :add_where{"member.active = 'f' OR (member.last_activity IS NULL OR age(member.last_activity) > ?::interval)", config.delegation_warning_time } if broken_delegations:count() > 0 then tabs[#tabs+1] = { @@ -226,4 +226,4 @@ params = { members_selector = contacts_selector }, } -ui.tabs(tabs) \ No newline at end of file +ui.tabs(tabs) diff -r 6725c13b6ce0 -r 2dc13655afca static/style.css --- a/static/style.css Fri Dec 30 02:59:43 2011 +0100 +++ b/static/style.css Fri Dec 30 03:02:09 2011 +0100 @@ -304,8 +304,7 @@ .interest, .slot_support, -.delegation, -.voting_requested { +.delegation { float: left; position: relative; z-index: 1; @@ -313,8 +312,7 @@ .interest img, .slot_support img, -.delegation img, -.voting_requested img { +.delegation img { padding-left: 0.2em; padding-right: 0.2em; } @@ -366,11 +364,6 @@ font-size: 80%; } -.voting_requested .head_active { - background-color: #fdd; - border: 1px solid #b77; -} - .vote_info .close { position: absolute; top: 0;