# HG changeset patch # User bsw # Date 1299092786 -3600 # Node ID 4993b71b383f871550066fc22223cf3e3cba4749 # Parent 2c422bcb79de453674a22b485134f4f34f2f3b25 First checkin of lf2 (frontend second generation) prototype diff -r 2c422bcb79de -r 4993b71b383f app/main/_filter_view/34_stylesheet.lua --- a/app/main/_filter_view/34_stylesheet.lua Sat Feb 05 20:01:09 2011 +0100 +++ b/app/main/_filter_view/34_stylesheet.lua Wed Mar 02 20:06:26 2011 +0100 @@ -41,7 +41,7 @@ slot.set_layout("blank") end -if request.get_module() ~= "api" and request.get_view() ~= "list_rss" and request.get_module() ~= "sitemap" then +if request.get_module() ~= "lf2" and request.get_module() ~= "api" and request.get_view() ~= "list_rss" and request.get_module() ~= "sitemap" then ui.container{ attr = { class = web20 and "web20" or "web10" diff -r 2c422bcb79de -r 4993b71b383f app/main/_layout/lf2.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/_layout/lf2.html Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,577 @@ + + + + + + +
+ +
+
+ + + + + +
+
TRACE
+ +
+ + + + diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_area.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_area.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,75 @@ +local area = param.get("area", "table") + +local membership = Membership:by_pk(area.id, app.session.member_id) + +local trustees = Member:new_selector() + :add_field("delegation_chain.*") + :join("delegation_chain(" .. app.session.member_id .. ", " .. area.id .. ", NULL)", "delegation_chain", "member.id = delegation_chain.member_id") + :add_order_by("index") + :exec() + +ui.box{ class = "area", content = function() + + ui.box_row{ class = "head", content = function() + ui.box_col{ class = "left name", content = area.name } + ui.box_col{ class = "right", content = _("#{direct_count}+#{delegated_count} Mitglieder", { + direct_count = area.direct_member_count, + delegated_count = area.member_weight - area.direct_member_count + } ) } + end } + + if area.description and #area.description > 0 then + ui.box_row{ class = "description", content = function() ui.box_col{ content = area.description } end } + end + + ui.box_row{ class = "member_count", content = function() + end } + + ui.box_row{ content = function() + ui.box_col{ class = "left", content = function() + execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } } + end } + ui.box_col{ class = "right", content = function() + ui.tag{ content = _"[Change] or [revoke] area delegation [prefix]" } + ui.link{ text = _"[Change] or [revoke] area delegation [change]" } + ui.tag{ content = _"[Change] or [revoke] area delegation [midpart]" } + ui.link{ text = _"[Change] or [revoke] area delegation [revoke]" } + ui.tag{ content = _"[Change] or [revoke] area delegation [suffix]" } + end } + end } + + ui.box_row{ content = function() + ui.box_col{ class = "left", content = function() + if membership then + ui.image{ static = "lf2/icon_star.png" } + slot.put(" ", _"You are member of this area") + else + ui.link{ + module = "membership", action = "update", params = { area_id = area.id }, + routing = { default = { + mode = "redirect", module = "lf2", view = "area", id = area.id + } }, + text = _"Become a member of this area" + } + end + end } + ui.box_col{ class = "right", content = function() + if membership then + ui.link{ + module = "membership", action = "update", params = { area_id = area.id, delete = true }, + routing = { default = { + mode = "redirect", module = "lf2", view = "area", id = area.id + } }, + text = _"Give up membership" + } + end + if not trustees then + if membership then + slot.put(" · ") + end + ui.link{ text = _"Delegate area...", module = "lf2", view = "delegation" } + end + end } + end } + +end } \ No newline at end of file diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_areas.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_areas.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,29 @@ +local areas = param.get("areas_selector", "table"):exec() +local head_content = param.get("head_content", "function") + +ui.box{ class = "areas", row_count = #areas, content = function() + if head_content then + ui.box_row{ class = "head", content = function() ui.box_col{ content = head_content } end } + end + + for i, area in ipairs(areas) do + local delegation = Delegation:by_pk(app.session.member_id, area.id) + + ui.box_row{ + class = "area", + toggle_content = function() + ui.image{ static = "lf2/icon_search_crossed.png" } + end, + content = function() + ui.box_col{ class = "name", content = function() + if delegation then + execute.view{ module = "lf2", view = "_avatars", params = { members = { delegation.trustee }, size = "small" } } + end + ui.link{ module = "lf2", view = "area", id = area.id, text = area.name } + end } + end + } + + end + +end } \ No newline at end of file diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_avatars.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_avatars.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,51 @@ +local members = param.get("members", "table") +local hidefirst = param.get("hidefirst", atom.boolean) +local size = param.get("size") or "normal" + +local first_participation = true + +ui.container{ attr = { class = "avatars " .. size }, content = function() + for i, member in ipairs(members) do + local class = "arrow" + if member.overridden then + class = class .. " overridden" + end + local image + local text + if member.scope_in == "global" then + image = "lf2/icon_delegation_global.png" + text = _"Global delegation" + elseif member.scope_in == "area" then + image = "lf2/icon_delegation_area.png" + text = _"Area delegation" + elseif member.scope_in == "issue" then + image = "lf2/icon_delegation.png" + text = _"Issue delegation" + end + if param.get("arrows", atom.boolean) and (i > 1 or #members == 1) then + ui.image{ attr = { title = text, alt = text, class = class }, static = image } + slot.put(member.scope) + end + if not hidefirst or i > 1 then + local class = "avatar" + if first_participation and member.participation then + class = class .. " participation" + first_participation = false + end + if member.overridden then + class = class .. " overridden" + end + ui.container{ attr = { class = class, title = member.name }, content = function() + ui.avatar(member, size) + --ui.image{ module = "member_image", view = "show", id = member.id, params = { image_type = "avatar" } } + if size == "normal" then + ui.container{ attr = { class = "name" }, content = member.name } + end + if size == "small" and member.weight ~= nil then + ui.container{ attr = { class = "weight" }, content = member.weight } + end + end } + end + end +end } + diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_delegation_global.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_delegation_global.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,23 @@ +local trustees = Member:new_selector() + :add_field("delegation_chain.*") + :join("delegation_chain(" .. tostring(app.session.member.id) .. ", NULL, NULL)", "delegation_chain", "member.id = delegation_chain.member_id") + :add_order_by("index") + :exec() + +ui.box{ content = function() + ui.box_row{ class = "head", content = function() + ui.box_col{ content = _"Global delegation active" } + end } + ui.box_row{ content = function() ui.box_col{ content = function() + execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } } + end } end } + ui.box_row{ content = function() ui.box_col{ content = function() + ui.tag{ content = _"[Change] or [revoke] global delegation [prefix]" } + ui.link{ text = _"[Change] or [revoke] global delegation [change]" } + ui.tag{ content = _"[Change] or [revoke] global delegation [midpart]" } + ui.link{ text = _"[Change] or [revoke] global delegation [revoke]" } + ui.tag{ content = _"[Change] or [revoke] global delegation [suffix]" } + + end } end } +end } + \ No newline at end of file diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_draft.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_draft.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,5 @@ +local draft = param.get("draft", "table") + +ui.container{ attr = { class = "draft" }, content = function() + slot.put(format.wiki_text(draft.content, draft.formatting_engine)) +end } diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_filter_view/10_topnav.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_filter_view/10_topnav.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,44 @@ +local state = param.get("state") +local order = param.get("order") + +slot.select("topnav", function() + + ui.link{ + attr = { class = state == "closed" and "active" or nil }, + text = _"Closed", module = "lf2", view = "index", params = { state = "closed", order = order } + } + ui.link{ + attr = { class = state == "voting" and "active" or nil }, + text = _"Voting", module = "lf2", view = "index", params = { state = "voting", order = order } + } + ui.link{ + attr = { class = state == "frozen" and "active" or nil }, + text = _"Frozen", module = "lf2", view = "index", params = { state = "frozen", order = order } + } + ui.link{ + attr = { class = state == "discussion" and "active" or nil }, + text = _"Discussion", module = "lf2", view = "index", params = { state = "discussion", order = order } + } + ui.link{ + attr = { class = state == "new" and "active" or nil }, + text = _"New", module = "lf2", view = "index", params = { state = "new", order = order } + } + + ui.container{ attr = { class = "right" }, content = function() + ui.link{ + attr = { class = order == "last_change" and "active" or nil }, + text = _"Last change", module = "lf2", view = "index", params = { order = "last_change", state = state } + } + ui.link{ + attr = { class = order == "time_left" and "active" or nil }, + text = _"Time left", module = "lf2", view = "index", params = { order = "time_left", state = state } + } + ui.link{ + attr = { class = order == "interest" and "active" or nil }, + text = _"Interest", module = "lf2", view = "index", params = { order = "interest", state = state } + } + end } + +end) + +execute.inner() \ No newline at end of file diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_initiative.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_initiative.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,95 @@ +local initiative = param.get("initiative", "table") + +ui.container{ attr = { class = "bar" }, content = function() + if initiative.issue.fully_frozen and initiative.issue.closed then + if initiative.issue.ranks_available then + if initiative.negative_votes and initiative.positive_votes then + local max_value = initiative.issue.voter_count + ui.bargraph{ + max_value = max_value, + width = 100, + bars = { + { color = "#0a0", value = initiative.positive_votes }, + { color = "#aaa", value = max_value - initiative.negative_votes - initiative.positive_votes }, + { color = "#a00", value = initiative.negative_votes }, + } + } + else + slot.put(" ") + end + else + slot.put(_"Counting of votes") + end + elseif initiative.issue.population then + local max_value = initiative.issue.population + ui.bargraph{ + max_value = max_value, + width = 100, + quorum = max_value * (initiative.issue.policy.initiative_quorum_num / initiative.issue.policy.initiative_quorum_den), + quorum_color = "#00F", + bars = { + { color = "#0a0", value = (initiative.satisfied_supporter_count or 0) }, + { color = "#bbb", value = (initiative.supporter_count or 0) - (initiative.satisfied_supporter_count or 0) }, + { color = "#eee", value = max_value - (initiative.supporter_count or 0) }, + } + } + else + slot.put(" ") + end +end } + +if initiative.issue.fully_frozen and not initiative.issue.closed then + if not initiative.admitted then + ui.image{ attr = { title = _"Initiative not admitted" }, static = "lf2/icon_cross.png" } + slot.put(" ") + end +end + +if initiative.issue.closed then + if initiative.issue.accepted then + if initiative.admitted then + if initiative.agreed then + if initiative.rank == 1 then + ui.image{ static = "lf2/icon_award_gold.png" } + else + ui.image{ static = "lf2/icon_award_silver.png" } + end + slot.put(" ") + ui.tag{ content = initiative.rank } + else + ui.image{ attr = { title = _"Initiative not agreed" }, static = "lf2/icon_cross.png" } + end + else + ui.image{ attr = { title = _"Initiative not admitted" }, static = "lf2/icon_cross.png" } + end + else + ui.image{ attr = { title = _"Issue not accepted" }, static = "lf2/icon_cross.png" } + end + slot.put(" ") +end + +ui.link{ + module = "lf2", view = "initiative", id = initiative.id, + params = { tab = "draft" }, attr = { class = "name" }, + text = initiative.name +} + +ui.container{ attr = { class = "authors" }, content = function() + local members = initiative.initiating_members + slot.put(_"by", " ") + for i, member in ipairs(members) do + if i > 1 and i < #members then + slot.put(", ") + elseif i > 1 then + slot.put(" ", _"and", " ") + end + ui.link{ + module = "lf2", view = "initiative", id = initiative.id, + params = { member_id = member.id }, content = function() + ui.tag{ content = member.name } + end + } + end +end } + + diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_initiatives.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_initiatives.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,13 @@ +local initiatives = param.get("initiatives", "table") + +initiatives:load("initiating_members", nil, "initiating_members") + +ui.box{ content = function() + for i, initiative in ipairs(initiatives) do + + ui.box_row{ class = "initiative", content = function() ui.box_col { content = function() + execute.view{ module = "lf2", view = "_initiative", params = { initiative = initiative } } + end } end } + + end +end } \ No newline at end of file diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_interested.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_interested.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,12 @@ +local interested_members = param.get("interested_members", "table") +ui.box{ content = function() + ui.box_row{ class = "head interested", content = function() + ui.box_col{ class = "", content = _"Interested members" } + end } + ui.box_row{ class = "interested", content = function() + ui.box_col{ content = _"The interested members are updated after some time." } + ui.box_col{ class = "", content = function() + execute.view{ module = "lf2", view = "_avatars", params = { members = interested_members } } + end } + end } +end } diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_issue_initiatives.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_issue_initiatives.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,72 @@ +local initiatives = param.get("initiatives", "table") + +for i, initiative in ipairs(initiatives) do + + local first = "" + if i == 1 then first = " first" end + + ui.box_row{ class = "initiative" .. first, content = function() ui.box_col { content = function() + + ui.link{ + module = "lf2", view = "initiative", id = initiative.id, + params = { tab = "draft" }, attr = { class = "name" }, + text = initiative.name + } + + ui.container{ attr = { class = "bar" }, content = function() + if initiative.issue.fully_frozen and initiative.issue.closed then + if initiative.issue.ranks_available then + if initiative.negative_votes and initiative.positive_votes then + local max_value = initiative.issue.voter_count + ui.bargraph{ + max_value = max_value, + width = 100, + bars = { + { color = "#0a0", value = initiative.positive_votes }, + { color = "#aaa", value = max_value - initiative.negative_votes - initiative.positive_votes }, + { color = "#a00", value = initiative.negative_votes }, + } + } + else + slot.put(" ") + end + else + slot.put(_"Counting of votes") + end + elseif initiative.issue.population then + local max_value = initiative.issue.population + ui.bargraph{ + max_value = max_value, + width = 100, + quorum = max_value * (initiative.issue.policy.initiative_quorum_num / initiative.issue.policy.initiative_quorum_den), + quorum_color = "#00F", + bars = { + { color = "#0a0", value = (initiative.satisfied_supporter_count or 0) }, + { color = "#bbb", value = (initiative.supporter_count or 0) - (initiative.satisfied_supporter_count or 0) }, + { color = "#eee", value = max_value - (initiative.supporter_count or 0) }, + } + } + else + slot.put(" ") + end + end } + + ui.container{ attr = { class = "authors" }, content = function() + local members = initiative.initiating_members + slot.put(_"by", " ") + for i, member in ipairs(members) do + if i > 1 and i < #members then + slot.put(", ") + elseif i > 1 then + slot.put(" ", _"and", " ") + end + ui.link{ + module = "lf2", view = "initiative", id = initiative.id, + params = { member_id = member.id }, text = member.name + } + end + end } + + end } end } + +end \ No newline at end of file diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_issues.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_issues.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,114 @@ +local issues = param.get("issues", "table") + +for i, issue in ipairs(issues) do + local initiatives = issue.initiatives + + local interested_members = issue.interested_members + + -- prepare interest of current user + local interest = issue.interest + + -- prepare trustees + local trustees = Member:new_selector() + :add_field("delegation_chain.*") + :join("delegation_chain(" .. tostring(app.session.member.id) .. ", NULL, " .. tostring(issue.id or "NULL") .. ")", "delegation_chain", "member.id = delegation_chain.member_id") + :add_order_by("index") + :exec() + + local global_delegation + local area_delegation + local issue_delegation + + for i, delegation in ipairs(issue.outgoing_delegations) do + if delegation.scope == "global" then global_delegation = delegation + elseif delegation.scope == "area" then area_delegation = delegation + elseif delegation.scope == "issue" then issue_delegation = delegation + end + end + + local delegation = issue_delegation or area_delegation or global_delegation + + local delegating_interest = issue.delegating_interest + + ui.box{ class = "issue", content = function() + + ui.box_row{ class = "head", content = function() + + ui.box_col{ class = "issue_id left", content = function() + ui.link{ + module = "lf2", view = "issue", id = issue.id, + content = _("Issue ##{id}", { id = issue.id }) + } + end } + + ui.box_col{ class = "unit_name right", content = function() + ui.link{ + module = "lf2", view = "unit", id = 1, + content = "Dummy unit name" + } + end } + ui.box_col{ class = "area_name right clearright", content = function() + ui.link{ + module = "lf2", view = "area_name", id = issue.area_id, + content = issue.area.name + } + end } + ui.box_col{ class = "policy_name left clearleft first", content = function() + ui.link{ + module = "lf2", view = "policy", id = issue.policy_id, + content = issue.policy.name + } + end } + + end } + + ui.box_row{ class = "head2", content = function() + + ui.box_col{ class = "state_name left", content = function() + ui.tag{ content = issue.state_name } + slot.put(" · ") + ui.tag{ content = issue.closed and _("since #{date}", { date = format.date(issue.closed.date) }) or _("#{time_left} left", { time_left = issue.state_time_left }) } + end } + end } + + if interest or delegation then + ui.box_row{ class = "head2", content = function() + ui.box_col{ class = "interest left", content = function() + if interest then + ui.image{ static = "lf2/icon_star.png" } + if issue.closed then + slot.put(" ", _"You were interested in this issue") + else + slot.put(" ", _"You are interested in this issue") + end + elseif delegating_interest then + ui.image{ static = "lf2/icon_delegated_star.png" } + if issue.closed then + slot.put(" ", _"You were interested in this issue by delegation") + else + slot.put(" ", _"You are interested in this issue by delegation") + end + elseif trustees then + slot.put(_"You have delegated this issue") + else + slot.put(_"You are not interested in this issue") + end + end } + -- TODO if delegation ist falsch + if delegation then + slot.put(tostring(delegation.id)) + ui.box_col{ class = "delegation right", content = function() + execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } } + end } + end + end } + end + + for i, initiative in ipairs(issue.initiatives) do + ui.box_row{ class = "initiative", content = function() ui.box_col { content = function() + execute.view{ module = "lf2", view = "_initiative", params = { initiative = initiative } } + end } end } + end + + end } +end \ No newline at end of file diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_issues_issue.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_issues_issue.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,77 @@ +local issue = param.get("issue", "table") +local hide = param.get("hide", "table") or {} + +local interest = issue.interest + +local delegations = issue.delegations + +local global_delegation +local area_delegation +local issue_delegation + +for i, delegation in ipairs(issue.delegations) do + if delegation.scope == "global" then global_delegation = delegation + elseif delegation.scope == "area" then area_delegation = delegation + elseif delegation.scope == "issue" then issue_delegation = delegation + end +end + +local delegation = issue_delegation or area_delegation or global_delegation + +local delegating_interest = issue.delegating_interest + +ui.box{ class = "issue", content = function() + + ui.box_row{ class = "issue_id", content = function() ui.box_col{ content = function() + ui.link{ + module = "lf2", view = "issue", id = issue.id, + content = _("Issue ##{id}", { id = issue.id }) + } + end } end } + + if not hide.unit then + ui.box_row{ class = "unit_name", content = function() ui.box_col{ content = function() + ui.link{ + module = "lf2", view = "unit", id = 1, + content = "DE / Berlin / Friedrichshain-Kreuzberg" + } + end } end } + end + + if not hide.area then + ui.box_row{ class = "area_name", content = function() ui.box_col{ content = function() + ui.link{ + module = "lf2", view = "area", id = issue.area_id, + content = issue.area.name + } + end } end } + end + + + ui.box_row{ class = "interest", content = function() + if interest then + ui.container{ attr = { title = _"You are interested in this issue" }, content = function() + ui.image{ static = "lf2/icon_star.png" } + end } + elseif delegating_interest then + ui.container{ attr = { class = "interest", title = _"You are interested in this issue by delegation" }, content = function() + ui.image{ static = "lf2/icon_delegated_star.png" } + slot.put(delegating_interest.trustee_member_id) + end } + else + end + end } + + ui.box_row{ class = "delegation", content = function() + if delegation then + ui.box_col{ content = function() + execute.view{ module = "lf2", view = "_avatars", params = { members = { app.session.member, delegation.trustee }, arrows = true, hidefirst = true } } + end } + else + end + end } + +end } + +ui.box_col{ class = "time_left", content = issue.closed and _("Closed since #{date}", { date = format.date(issue.closed.date) }) or _("#{time_left} left", { time_left = issue.state_time_left }) } + diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_search.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_search.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,35 @@ +ui.container{ + attr = { class = "boxhead" }, + content = _"Search in initiatives for text:" +} + +ui.container{ + attr = { class = "search box" }, + content = function() + ui.container{ + attr = { class = "row first" }, + content = function() + ui.container{ + attr = { class = "col first" }, + content = function() + + ui.form{ + content = function() + + + slot.put(" ") + + ui.tag{ tag = "input", attr = { type = "text", name = "q" } } + + ui.submit{ text = _"Search" } + + end + } + + end + } + + end + } + end +} \ No newline at end of file diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_sidebar.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_sidebar.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,36 @@ +local member_areas_selector = Area:build_selector{ + member_id = app.session.member_id, + order = "name" +} +local other_areas_selector = Area:build_selector{ + not_member_id = app.session.member_id, + order = "name" +} + +execute.view{ module = "lf2", view = "_delegation_global" } + +ui.form{ + content = function() + + ui.container{ attr = { class = "boxhead" }, content = _"" } + --execute.view{ module = "lf2", view = "_areas", params = { areas_selector = member_areas_selector } } + + execute.view{ + module = "lf2", view = "_areas", params = { + areas_selector = member_areas_selector, + head_content = function() ui.tag{ content = _"Areas, you are member of" } end + } + } + + execute.view{ + module = "lf2", view = "_areas", params = { + areas_selector = other_areas_selector, + head_content = function() ui.tag{ content = _"Areas, you are not member of" } end + } + } + + end +} + +execute.view{ module = "lf2", view = "_search", params = { area = area } } + diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_sidebar_drafts.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_sidebar_drafts.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,55 @@ +local initiative = param.get("initiative", "table") + +local drafts = Draft:new_selector() + :add_where{ "draft.initiative_id = ?", initiative.id } + :add_order_by("id DESC") + :exec() + +ui.container{ attr = { class = "boxhead" }, content = _"Draft revisions" } + +ui.box{ class = "drafts", content = function() + if drafts then + ui.form{ + method = "get", + module = "draft", + view = "diff", + content = function() + ui.box_row{ class = "", content = function() + ui.box_col{ class = "scrolled", content = function() + + for i, draft in ipairs(drafts) do + ui.box_row{ class = "draft", content = function() + ui.box_col{ class = "left", content = function() + ui.link{ + attr = { class = "created" }, + text = format.timestamp(draft.created), + module = "draft", + view = "show", + id = draft.id + } + slot.put("
") + ui.tag{ content = _"by" } + slot.put(" ") + ui.link{ + attr = { class = "author_name" }, + module = "lf2", view = "issue", id = initiative.issue_id, + params = { member_id = author_id }, + text = draft.author.name + } + end } + ui.box_col{ class = "right", content = function() + slot.put('') + slot.put('') + end } + end } + end + end } end } + + ui.box_row{ content = function() ui.box_col{ class = "right", content = function() + ui.submit{ text = _"Compare selected" } + end } end } + end + } + else + end +end } diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_sidebar_initiatives.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_sidebar_initiatives.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,9 @@ +local initiatives = param.get("initiatives", "table") +ui.box{ content = function() + ui.box_row{ class = "initiatives", content = function() + ui.box_col{ class = "scrolled", content = function() + execute.view{ module = "lf2", view = "_issue_initiatives", params = { initiatives = initiatives } } + end } + end } +end } + diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/_sidebar_issue.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_sidebar_issue.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,177 @@ +local issue = param.get("issue", "table") + +local initiatives = issue.initiatives + +local interested_members_selector = Member:new_selector() + :join("direct_interest_snapshot", "dis", { "dis.issue_id = ? AND dis.member_id = member.id and dis.event = (select latest_snapshot_event from issue where id = ?)", issue.id, issue.id }) + :add_field("dis.weight", "weight") + :add_order_by("dis.weight DESC") +local interested_members = interested_members_selector:exec() + +local interest = issue.interest + +local delegations = issue.delegations + +local trustees = Member:new_selector() + :add_field("delegation_chain.*") + :join("delegation_chain(" .. tostring(app.session.member.id) .. ", NULL, " .. tostring(issue.id or "NULL") .. ")", "delegation_chain", "member.id = delegation_chain.member_id") + :add_order_by("index") + :exec() + +local global_delegation +local area_delegation +local issue_delegation + +for i, delegation in ipairs(issue.delegations) do + if delegation.scope == "global" then global_delegation = delegation + elseif delegation.scope == "area" then area_delegation = delegation + elseif delegation.scope == "issue" then issue_delegation = delegation + end +end + +local delegation = issue_delegation or area_delegation or global_delegation + +local delegating_interest = issue.delegating_interest + +ui.box{ class = "issue", content = function() + + ui.box_row{ class = "issue_id head", content = function() ui.box_col{ content = function() + ui.link{ + module = "lf2", view = "issue", id = issue.id, + content = _("Issue ##{id}", { id = issue.id }) + } + end } end } + + ui.box_row{ class = "unit_name", content = function() ui.box_col{ content = function() + ui.link{ + module = "lf2", view = "unit", id = 1, + content = "DE / Berlin / Friedrichshain-Kreuzberg" + } + end } end } + + ui.box_row{ class = "area_name", content = function() ui.box_col{ content = function() + ui.link{ + module = "lf2", view = "area", id = issue.area_id, + content = issue.area.name + } + end } end } + + ui.box_row{ class = "policy_name", content = function() ui.box_col{ content = function() + ui.link{ + module = "lf2", view = "policy", id = issue.policy_id, + content = issue.policy.name + } + end } end } + + ui.box_row{ class = "time_left", content = function() + ui.box_col{ content = issue.closed and _("Closed since #{date}", { date = format.date(issue.closed.date) }) or _("#{time_left} left", { time_left = issue.state_time_left }) } + end } + + ui.box_row{ class = "interest hoverbutton_container", content = function() ui.box_col{ content = function() + if interest then + ui.image{ static = "lf2/icon_star.png" } + if issue.closed then + slot.put(" ", _"You were interested in this issue") + else + slot.put(" ", _"You are interested in this issue") + end + else + ui.image{ static = "lf2/icon_star_grey.png" } + slot.put(_"You are not interested in this issue") + end + + if issue.closed then + ui.container{ attr = { class = "hoverbutton noaction"}, content = function() + ui.container{ attr = { class = "content"}, content = function() + slot.put(" ", encode.html(_"This issue is closed")) + end } + end } + elseif issue.fully_frozen then + ui.container{ attr = { class = "hoverbutton noaction"}, content = function() + ui.container{ attr = { class = "content"}, content = function() + slot.put(" ", encode.html(_"This issue is in voting")) + end } + end } + else + if interest then + ui.link{ + module = "interest", action = "update", params = { issue_id = issue.id, delete = true }, + routing = { default = { + mode = "redirect", module = "lf2", view = "issue", id = issue.id + } }, + attr = { class = "hoverbutton red"}, + content = function() + ui.container{ attr = { class = "content"}, content = function() + ui.image{ static = "lf2/icon_star_crossed.png" } + slot.put(" ", encode.html(_"Remove my interest")) + end } + end + } + + else + ui.link{ + module = "interest", action = "update", params = { issue_id = issue.id }, + routing = { default = { + mode = "redirect", module = "lf2", view = "issue", id = issue.id + } }, + attr = { class = "hoverbutton green"}, + content = function() + ui.container{ attr = { class = "content"}, content = function() + ui.image{ static = "lf2/icon_star.png" } + slot.put(" ", encode.html(_"Add my interest")) + end + } + end } + + end + end + end } end } + + ui.box_row{ class = "delegation hoverbutton_container", content = function() ui.box_col{ content = function() + if delegation then + if delegation.issue_id then + slot.put(encode.html(_"You have delegated this issue")) + elseif delegation.area_id then + slot.put(encode.html(_"You have delegated this area")) + elseif delegation then + slot.put(encode.html(_"You have delegated globally")) + end + else + slot.put(encode.html(_"No delegation active")) + end + + if issue.closed then + ui.container{ attr = { class = "hoverbutton noaction"}, content = function() + ui.container{ attr = { class = "content"}, content = function() + slot.put(" ", encode.html(_"This issue is closed")) + end } + end } + else + if delegation then + ui.link{ attr = { class = "hoverbutton red"}, content = function() + ui.container{ attr = { class = "content"}, content = function() + ui.image{ static = "lf2/icon_delegation.png" } + slot.put(" ", encode.html(_"Change delegation...")) + end } + end } + + else + ui.link{ attr = { class = "hoverbutton green"}, content = function() + ui.container{ attr = { class = "content"}, content = function() + ui.image{ static = "lf2/icon_delegation.png" } + slot.put(" ", encode.html(_"Delegate issue")) + end } + end } + + end + end + + end } end } + + if delegation then + ui.box_row{ class = "delegation", content = function() ui.box_col{ content = function() + execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } } + end } end } + end + +end } diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/area.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/area.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,24 @@ +local area = Area:by_id(param.get_id()) + +slot.set_layout("lf2") + +slot.select("sidebar", function() + execute.view{ module = "lf2", view = "_sidebar" } +end) + +execute.view{ module = "lf2", view = "_area", params = { area = area } } + + +local issues_selector = Issue:build_selector{ + area_id = area.id, + state = param.get("state"), + order = param.get("order") +}:limit(25) + +local issues = issues_selector:exec() + +issues:load("delegating_interest_snapshot_for_member", { member_id = app.session.member_id }, "delegating_interest") +issues:load("interest_for_member", { member_id = app.session.member_id }, "interest") +issues:load("outgoing_delegations_for_member", { member_id = app.session.member_id }, "outgoing_delegations") + +execute.view{ module = "lf2", view = "_issues", params = { issues = issues } } diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/area_notification.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/area_notification.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,11 @@ +local area = Area:by_id(param.get_id()) + +slot.set_layout("lf2") + +ui.box{ + ui.box_row{ content = function() ui.box_col{ content = function() + + + + end } end } +} \ No newline at end of file diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/index.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/index.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,18 @@ +slot.set_layout("lf2") + +slot.select("sidebar", function() + execute.view{ module = "lf2", view = "_sidebar" } +end) + +local issues_selector = Issue:build_selector{ + state = param.get("state"), + order = param.get("order") +}:limit(25) + +local issues = issues_selector:exec() + +issues:load("delegating_interest_snapshot_for_member", { member_id = app.session.member_id }, "delegating_interest") +issues:load("interest_for_member", { member_id = app.session.member_id }, "interest") +issues:load("outgoing_delegations_for_member", { member_id = app.session.member_id }, "outgoing_delegations") + +execute.view{ module = "lf2", view = "_issues", params = { issues = issues } } diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/initiative.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/initiative.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,92 @@ +slot.set_layout("lf2") + +local initiative = Initiative:by_id(param.get_id()) + +local issue = initiative.issue + +local supporting_members_selector = Member:new_selector() + :join("direct_supporter_snapshot", "dss", { "dss.issue_id = ? AND dss.initiative_id = ? AND dss.member_id = member.id and dss.event = (select latest_snapshot_event from issue where id = ?)", issue.id, initiative.id, issue.id }) + :join("direct_interest_snapshot", "dis", { "dis.issue_id = ? AND dis.member_id = member.id and dis.event = (select latest_snapshot_event from issue where id = ?)", issue.id, issue.id }) + :add_field("dis.weight", "weight") + :add_order_by("dis.weight DESC") +local supporting_members = supporting_members_selector:exec() + +local voting_members_selector = Member:new_selector() + :join("direct_voter", nil, { "direct_voter.issue_id = ? AND direct_voter.member_id = member.id", issue.id }) + :add_field("direct_voter.weight", "weight") + :add_order_by("direct_voter.weight DESC") +local voting_members = voting_members_selector:exec() + +local alternative_initiatives = initiative.issue.initiatives +alternative_initiatives:load("initiating_members", nil, "initiating_members") + + +slot.select("sidebar", function() + + execute.view{ module = "lf2", view = "_sidebar_issue", params = { issue = issue } } + ui.container{ attr = { class = "boxhead" }, content = _"Alternative initiatives" } + + execute.view{ module = "lf2", view = "_sidebar_initiatives", params = { + initiatives = alternative_initiatives + } } + + execute.view{ module = "lf2", view = "_sidebar_drafts", params = { + initiative = initiative + } } + +end) + +local draft = initiative.current_draft + +ui.box{ + content = function() + + ui.box_row{ class = "initiative head", content = function() ui.box_col { content = function() + execute.view{ module = "lf2", view = "_initiative", params = { initiative = initiative } } + end } end } + + ui.box_row{ class = "head2", content = function() ui.box_col{ content = function() + if initiative.issue.fully_frozen and initiative.issue.closed then + ui.link{ external = "#votes", text = _("#{vote_count} votes", { vote_count = #voting_members }) } + slot.put(" · ") + end + ui.link{ external = "#suggestions", text = _("#{suggestion_count} suggestions", { suggestion_count = 23 }) } + slot.put(" · ") + ui.link{ external = "#supporters", text = _("#{supporter_count} supporters", { supporter_count = #supporting_members }) } + end } end } + + ui.box_row{ content = function() ui.box_col{ content = function() + execute.view{ module = "lf2", view = "_draft", params = { draft = draft } } + end } end } + end +} + +if initiative.issue.fully_frozen and initiative.issue.closed then + ui.boxhead{ name = "votes", content = _"Votes" } + ui.box{ + content = function() + ui.box_row{ content = function() ui.box_col{ content = function() + execute.view{ module = "lf2", view = "_avatars", params = { members = voting_members } } + end } end } + end + } +end + +ui.boxhead{ name = "suggestions", content = _"Suggestions" } +ui.box{ + content = function() + ui.box_row{ content = function() ui.box_col{ content = function() + slot.put("suggestions") + end } end } + end +} + +ui.boxhead{ name = "supporters", content = _"Supporters" } +ui.box{ + content = function() + ui.box_row{ content = function() ui.box_col{ content = function() + execute.view{ module = "lf2", view = "_avatars", params = { members = supporting_members } } + end } end } + end +} + diff -r 2c422bcb79de -r 4993b71b383f app/main/lf2/issue.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/issue.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,56 @@ +slot.set_layout("lf2") + + +local issue = Issue:by_id(param.get_id()) +local area = issue.area + +-- TODO broken +--issue:load("interested_members_snapshot", {}, "interested_members") +issue:load("delegating_interest_snapshot_for_member", { member_id = app.session.member_id }, "delegating_interest") +issue:load("interest_for_member", { member_id = app.session.member_id }, "interest") +issue:load("outgoing_delegations_for_member", { member_id = app.session.member_id }, "outgoing_delegations") + +local initiatives = issue.initiatives + +local interested_members = issue.interested_members + +local interest = issue.interest + +local delegations = issue.delegations + +local trustees = Member:new_selector() + :add_field("delegation_chain.*") + :join("delegation_chain(" .. tostring(app.session.member.id) .. ", " .. tostring(area_id or "NULL") .. ", " .. tostring(issue_id or "NULL") .. ")", "delegation_chain", "member.id = delegation_chain.member_id") + :add_order_by("index") + :exec() + +local global_delegation +local area_delegation +local issue_delegation + +for i, delegation in ipairs(issue.delegations) do + if delegation.scope == "global" then global_delegation = delegation + elseif delegation.scope == "area" then area_delegation = delegation + elseif delegation.scope == "issue" then issue_delegation = delegation + end +end + +local delegation = issue_delegation or area_delegation or global_delegation + +local delegating_interest = issue.delegating_interest + +slot.select("sidebar", function() + execute.view{ module = "lf2", view = "_sidebar" } +end) + +execute.view{ module = "lf2", view = "_area", params = { area = area } } + +execute.view{ module = "lf2", view = "_issues", params = { issues = { issue } } } + +-- TODO bugfix for not working reference loader +interested_members = issue:get_reference_selector("interested_members_snapshot"):exec() + +execute.view{ module = "lf2", view = "_interested", params = { + interested_members = interested_members +} } + diff -r 2c422bcb79de -r 4993b71b383f config/development.lua --- a/config/development.lua Sat Feb 05 20:01:09 2011 +0100 +++ b/config/development.lua Wed Mar 02 20:06:26 2011 +0100 @@ -3,7 +3,7 @@ execute.config("default") config.formatting_engine_executeables = { - rocketwiki= "/opt/rocketwiki/rocketwiki-lqfb", + rocketwiki= "/opt/rocketwiki/rocketwiki-lqfb.sh", compat = "/opt/rocketwiki/rocketwiki-lqfb-compat" } diff -r 2c422bcb79de -r 4993b71b383f env/ui/avatar.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/env/ui/avatar.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,66 @@ +local alphabet = { + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", + "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", + "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", + "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", + "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/" +} + +local function encode_base64(str) + local parts = {} + local pos = 1 + local block_count = 0 + while pos <= #str do + local s = string.sub(str, pos, pos + 2) + local n = 0 + for i = 1, 3 do + n = n * 256 + if i <= #s then + n = n + string.byte(string.sub(s, i, i)) + end + end + parts[#parts+1] = alphabet[math.floor(n / 262144) + 1] + parts[#parts+1] = alphabet[math.floor(n / 4096) % 64 + 1] + if #s > 1 then + parts[#parts+1] = alphabet[math.floor(n / 64) % 64 + 1] + else + parts[#parts+1] = "=" + end + if #s > 2 then + parts[#parts+1] = alphabet[n % 64 + 1] + else + parts[#parts+1] = "=" + end + block_count = block_count + 1 + if block_count == 19 then + --parts[#parts+1] = "\r\n" + block_count = 0 + end + pos = pos + #s + end + if block_count > 0 then + --parts[#parts+1] = "\r\n" + end + return table.concat(parts) +end + +function ui.avatar(member, size) + local base64_string + + if member.avatar_base64 then + base64_string = member.avatar_base64 + else + local member_image = MemberImage:by_pk(member.id, "avatar", true) + if member_image then + base64_string = encode_base64(member_image.data) + else + base64_string = "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/wAALCAAwADABAREA/8QAGQABAAMBAQAAAAAAAAAAAAAAAAMGBwQC/8QAIxAAAgICAgEEAwAAAAAAAAAAAQIAAwQRBTEGEiEyYTVRcf/aAAgBAQAAPwDf4kN2TRjjd1ip/TFOTRkDdNiv/DJoiR3WCml7D0o3M55DOtzsp7HYkb9h+hHH51uDlJYjEDfuP2Jo1NgupSwdMNySJzcgC3H3gd+gzNCNMR9wBtgPuaXx4K8fQD36BOmJ5ZQ6FT0RozNeQrWrPuRegx1HH1rbn0o3RYbmlKoRAo6A0J6kGXlV4eM99vxXuVrK8uJBXHp19tKxZY1trWN8mOzFdjVWrYvyU7Es+L5cQAuRTv7WWXEyq8zGS+r4t1ODyP8AC3SgRES/+OfhaZ//2Q==" + end + member.avatar_base64 = base64_string + member:save() + end + + ui.tag{ tag = "img", attr = { src = "data:image/jpeg;base64," .. base64_string } } + +end + diff -r 2c422bcb79de -r 4993b71b383f env/ui/box.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/env/ui/box.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,7 @@ +function ui.box(args) + app.ui_box_row = 1 + app.ui_box_row_count = args.row_count + local class = "box" + if args.class then class = class .. " " .. args.class end + ui.container{ attr = { class = class }, content = args.content } +end diff -r 2c422bcb79de -r 4993b71b383f env/ui/box_col.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/env/ui/box_col.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,7 @@ +function ui.box_col(args) + local class = "col" + if args.class then class = class .. " " .. args.class end + if app.ui_box_col == 1 then class = class .. " first" end + ui.container{ attr = { class = class }, content = args.content } + app.ui_box_col = app.ui_box_col + 1 +end diff -r 2c422bcb79de -r 4993b71b383f env/ui/box_row.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/env/ui/box_row.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,25 @@ +function ui.box_row(args) + app.ui_box_col = 1 + local class = "row" + if args.class then class = class .. " " .. args.class end + if app.ui_box_row == 1 then class = class .. " first" end + if app.ui_box_row == app.ui_box_row_count then class = class .. " last" end + if args.toggle_content then class = class .. " toggled" end + ui.container{ attr = { class = class }, content = function() + if args.toggle_content then + ui.container{ attr = { class = "col toggle"}, content = function() + if type(args.toggle_content) == "function" then + args.toggle_content() + else + slot.put(encode.html(args.toggle_content)) + end + end } + end + if type(args.content) == "function" then + args.content() + else + slot.put(encode.html(args.content)) + end + end } + app.ui_box_row = app.ui_box_row + 1 +end diff -r 2c422bcb79de -r 4993b71b383f env/ui/boxhead.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/env/ui/boxhead.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,5 @@ +function ui.boxhead(args) + local class = "boxhead" + if args.class then class = class .. " " .. args.class end + ui.tag{ tag = "a", attr = { class = class, name = args.name }, content = args.content } +end diff -r 2c422bcb79de -r 4993b71b383f locale/translations.de.lua --- a/locale/translations.de.lua Sat Feb 05 20:01:09 2011 +0100 +++ b/locale/translations.de.lua Wed Mar 02 20:06:26 2011 +0100 @@ -3,14 +3,20 @@ ["##{id}"] = "##{id}"; ["##{issue_id}.#{id} #{name}"] = "##{issue_id}.#{id} #{name}"; ["#{author} at #{date}"] = "#{author} am #{date}"; +["#{direct_count}+#{delegated_count} Mitglieder"] = false; ["#{interested_issues_to_vote_count} issue(s) you are interested in"] = "#{interested_issues_to_vote_count} Themen, die Dich interessieren"; ["#{issues_to_vote_count} issue(s)"] = "#{issues_to_vote_count} Themen"; ["#{number} Image(s) has been deleted"] = "Es wurde(n) #{number} Bild(er) gelöscht"; ["#{number} Image(s) has been updated"] = "Es wurde(n) #{number} Bild(er) aktualisiert"; +["#{suggestion_count} suggestions"] = "#{suggestion_count} Anregungen"; +["#{supporter_count} supporters"] = "#{supporter_count} Unterstützer"; +["#{time_left} left"] = "noch #{time_left}"; +["#{vote_count} votes"] = "#{vote_count} Stimmzettel"; ["(#{more_count} duplicates removed)"] = "(#{more_count} Duplikate entfernt)"; ["(change URL)"] = "(URL ändern)"; ["(new window)"] = "(neues Fenster)"; ["+ #{weight}"] = "+ #{weight}"; +["+getElementById("] = false; ["A-Z"] = "A-Z"; ["API key"] = "API-Schlüssel"; ["API key has been deleted"] = "API-Schlüssel wurde gelöscht"; @@ -62,6 +68,8 @@ ["Area list"] = "Liste der Themenbereiche"; ["Area successfully updated"] = "Themenbereich erfolgreich aktualisiert"; ["Areas"] = "Themenbereiche"; +["Areas, you are member of"] = false; +["Areas, you are not member of"] = "Nicht Mitglied in:"; ["Author"] = "Autor"; ["Auto support is now disabled"] = false; ["Auto support is now enabled"] = false; @@ -77,6 +85,7 @@ ["Back to timeline"] = "Zurück zur Zeitachse"; ["Ballot of '#{member_name}' for issue ##{issue_id}"] = "Stimmzettel von '#{member_name}' für Thema ##{issue_id}"; ["Become a member"] = "Mitglied werden"; +["Become a member of this area"] = "Dem Themenbereich beitreten"; ["Birthday"] = "Geburtstag"; ["Can't remove last initiator"] = "Der letzte Initiator kann nicht entfernt werden"; ["Can't send confirmation email"] = "Bestätigungs-E-Mail kann nicht versendet werden."; @@ -87,6 +96,7 @@ ["Cancelled"] = "Abgebrochen"; ["Change API key"] = "API-Schlüssel ändern"; ["Change area delegation"] = "Delegation für Themenbereich ändern"; +["Change delegation..."] = "Delegation ändern..."; ["Change display settings"] = "Anzeige-Einstellungen ändern"; ["Change email"] = "E-Mail-Adresse ändern"; ["Change email address"] = "E-Mail-Adresse ändern"; @@ -106,9 +116,11 @@ ["Choose member"] = "Mitglied auswählen"; ["Click for details"] = "Klicke für Details"; ["Closed"] = "geschlossen"; +["Closed since #{date}"] = "Geschlossen seit #{date}"; ["Collective opinion of supporters"] = "Meinungsbild der Unterstützer"; ["Commit suggestion"] = "Anregung speichern"; ["Compare"] = "Vergleichen"; +["Compare selected"] = "Vergleiche ausgewählte"; ["Confirm"] = "Bestätigen"; ["Confirmation code"] = "Bestätigungscode"; ["Confirmation code invalid!"] = "Bestätigungscode ist ungültig!"; @@ -133,6 +145,8 @@ ["Date format is not valid. Please use following format: YYYY-MM-DD"] = "Datumsformat nicht korrekt. Bitte verwende: JJJJ-MM-TT, also z.B. 1945-05-23"; ["Default Policy"] = "Standard-Regelwerk"; ["Degree"] = "Grad"; +["Delegate area..."] = "Themengebiet delegieren..."; +["Delegate issue"] = "Thema delegieren"; ["Delegation abandoned"] = "Delegation ausgesetzt"; ["Delegation problems"] = "Delegationsprobleme"; ["Delegation turned off for area"] = "Delegation für Themengebiet ausgesetzt"; @@ -166,6 +180,7 @@ ["Download database export"] = "Datenbankexport herunterladen"; ["Draft"] = "Entwurf"; ["Draft history"] = "Entwurfshistorie"; +["Draft revisions"] = "Entwurfsversionen"; ["EXPERIMENTAL FEATURE"] = "EXPERIMENTELLE FUNKTION"; ["Edit"] = "Bearbeiten"; ["Edit draft"] = "Entwurf bearbeiten"; @@ -193,6 +208,7 @@ ["Fully frozen at"] = "Ganz eingefroren am/um"; ["Generate / change API key"] = "API-Schlüssel erzeugen/ändern"; ["Generate API key"] = "API-Schlüssel erzeugen"; +["Give up membership"] = "Mitgliedschaft aufgeben"; ["Global delegation"] = "Globale Delegation"; ["Global delegation active"] = "Globale Delegation aktiv"; ["Go up"] = "Nach oben"; @@ -222,6 +238,8 @@ ["Initiative ##{id}"] = "Initiative ##{id}"; ["Initiative events"] = "Initiativen-Ereignisse"; ["Initiative is revoked now"] = "Initiative ist jetzt zurückgezogen"; +["Initiative not admitted"] = "Initiative nicht zugelassen"; +["Initiative not agreed"] = "Initiative abgelehnt"; ["Initiative quorum"] = "Quorum Inititive"; ["Initiative quorum denumerator"] = "Initiativ-Quorum Zähler"; ["Initiative quorum numerator"] = "Initiativ-Quorum Nenner"; @@ -239,6 +257,7 @@ ["Initiator"] = "Initiator"; ["Initiator invites"] = "Einladungen"; ["Initiators"] = "Initiatoren"; +["Interest"] = "Interesse"; ["Interest not existant"] = "Interesse existiert nicht"; ["Interest removed"] = "Interesse entfernt"; ["Interest updated"] = "Interesse aktualisiert"; @@ -263,6 +282,7 @@ ["Issue finished"] = "Thema abgeschlossen"; ["Issue finished without voting"] = "Thema ohne Abstimmung abgeschlossen"; ["Issue frozen"] = "Thema eingefroren"; +["Issue not accepted"] = "Thema nicht zugelassen"; ["Issue policy"] = "Regelwerk für Thema"; ["Issue quorum"] = "Quorum Thema"; ["Issue quorum denumerator"] = "Themen-Quorum Zähler"; @@ -270,6 +290,8 @@ ["Issues"] = "Themen"; ["JavaScript is disabled or not available."] = "JavaScript ist abgeschaltet oder nicht verfügbar."; ["Last author"] = "Letzter Autor"; +["Last change"] = "Letzte Änderung"; +["Last login (updated daily)"] = "Letzte Anmeldung (täglich aktualisiert)"; ["Last snapshot:"] = "Letzte Auszählung:"; ["Legend:"] = "Legende:"; ["License"] = "Lizenz"; @@ -336,6 +358,7 @@ ["No changes to your images were made"] = "An Deinen Bildern wurde nichts geändert"; ["No default"] = "Kein Standard"; ["No delegation"] = "Keine Delegation"; +["No delegation active"] = "Keine Delegation aktiv"; ["No events selected to list"] = "Keine Ereignisse ausgewählt"; ["No membership at all"] = "Gar keine Mitgliedschaft"; ["No support at all"] = "Gar keine Unterstützung"; @@ -442,6 +465,7 @@ ["Saved as contact"] = "Als Kontakt gespeichert"; ["Saved contacts"] = "Gespeicherte Kontakte"; ["Search"] = "Suchen"; +["Search in initiatives for text:"] = "In Initiative nach Text suchen:"; ["Search initiatives"] = "Suche Initiativen"; ["Search issues"] = "Suche Themen"; ["Search members"] = "Suche Mitglieder"; @@ -507,6 +531,7 @@ ["Supported"] = "Unterstützt"; ["Supported initiatives"] = "Unterstützte Initiativen"; ["Supporter"] = "Unterstützer"; +["Supporters"] = "Unterstützer"; ["Syntax help"] = "Syntax-Hilfe"; ["Tabs"] = "Registerkarten"; ["Terms of use"] = "Nutzungsbedingungen"; @@ -515,6 +540,7 @@ ["The draft of this initiative has been updated!"] = "Der Entwurfstext der Initiative wurde aktualisiert!"; ["The drafts do not differ"] = "Die Entwürfe unterscheiden sich nicht"; ["The initiators suggest to support the following initiative:"] = "Die Initiatoren empfehlen folgende Initiative zu unterstützen:"; +["The interested members are updated after some time."] = false; ["There are no more alternative initiatives currently."] = "Es gibt zur Zeit keine weiteren alternative Initiative."; ["There were no more alternative initiatives."] = "Es gab keine weiteren alternativen Initiativen."; ["This email address is too short!"] = "Diese E-Mail-Adresse ist zu kurz!"; @@ -530,6 +556,8 @@ ["This issue has been finished without any winning initiative."] = "Das Thema wurde ohne Gewinner abgeschlossen."; ["This issue is already closed."] = "Das Thema ist schon geschlossen."; ["This issue is already frozen."] = "Das Thema ist schon eingefroren"; +["This issue is closed"] = "Thema geschlossen"; +["This issue is in voting"] = "Thema in Abstimmung"; ["This login is already taken, please choose another one!"] = "Dieser Anmeldename ist bereits vergeben, bitte wähle einen anderen!"; ["This login is too short!"] = "Dieser Anmeldename ist zu kurz!"; ["This member account has been created at #{created}"] = "Dieser Mitgliedszugang wurde am/um #{created} angelegt."; @@ -570,6 +598,7 @@ ["Voted no"] = "Mit Nein gestimmt"; ["Voted proposal"] = "Abgestimmte Vorlage"; ["Voted yes"] = "Mit Ja gestimmt"; +["Votes"] = "Stimmzettel"; ["Voting"] = "Abstimmung"; ["Voting details"] = "Abstimmdetails"; ["Voting for this issue has already begun."] = "Die Abstimmung für dieses Thema hat schon begonnen."; @@ -591,9 +620,12 @@ ["You are currently not invited to any initiative."] = "Du bist zur Zeit von keiner Initiative eingeladen."; ["You are currently not supporting this initiative directly. By adding suggestions to this initiative you will automatically become a potential supporter."] = "Du bist zur Zeit kein direkter Unterstützer dieser Initiative. Wenn Du eine Anregung hinzufügst wirst Du automatisch potentieller Unterstützer!"; ["You are iniator of this initiative"] = "Du bist Initiator dieser Initiative"; -["You are interested in this issue"] = "Du bist an diesem Thema interessiert"; +["You are interested in this issue"] = "Du bist am Thema interessiert"; +["You are interested in this issue by delegation"] = "Du bist am Thema durch Delegation interessiert"; ["You are invited to become initiator of this initiative."] = "Du bist eingeladen Initiator dieser Initiative zu werden."; ["You are member"] = "Du bist Mitglied"; +["You are member of this area"] = "Du bist Mitglied des Themenbereichs"; +["You are not interested in this issue"] = "Du bist nicht am Thema interessiert"; ["You are now initiator of this initiative"] = "Du bist jetzt Initiator dieser Initiative"; ["You are potential supporter of this initiative"] = "Du bist potentieller Unterstützer dieser Initiative"; ["You are supporting this initiative"] = "Du unterstützt diese Initiative"; @@ -603,11 +635,16 @@ ["You didn't confirmed your email address '#{email}' within 7 days."] = "Du hast die E-Mail-Adresse '#{email}' nicht innerhalb von 7 Tagen bestätigt."; ["You didn't confirmed your email address '#{email}'. You have received an email with an activation link."] = "Du hast die E-Mail-Adresse '#{email}' nicht bestätigt. Du hast hierzu eine E-Mail mit einem Aktivierungslink erhalten."; ["You didn't saved any member as contact yet."] = "Du hast noch kein Mitglied als Kontakt gespeichert!"; +["You have delegated globally"] = "Du hast global delegiert"; +["You have delegated this area"] = "Du hast das Themengebiet delegiert"; +["You have delegated this issue"] = "Du hast das Thema delegiert"; ["You have saved this member as contact"] = "Du hast das Mitglied als Kontakt gespeichert"; ["You have saved this member as contact."] = "Du hast das Mitglied als Kontakt gespeichert."; ["You have to mark 'Are you sure' to revoke!"] = "Zum Zurückziehen musst Du 'Sicher?' auswählen"; ["You need to be logged in, to use all features of this system."] = "Du musst eingeloggt sein, um alle Funktionen dieses Systems nutzen zu können."; ["You want to vote later"] = "Du willst später abstimmen"; +["You were interested in this issue"] = "Du warst am Thema interessiert"; +["You were interested in this issue by delegation"] = "Du warst am Thema durch Delegation interessiert"; ["You've successfully registered and you can login now with your login and password!"] = "Du hast Dich erfolgreich registriert und kannst Dich jetzt mit Deinen Benutzernamen und Kennwort anmelden!"; ["Your API key:"] = "Dein API-Schlüssel:"; ["Your are interested"] = "Du bist interessiert"; @@ -636,13 +673,25 @@ ["Your vote has been discarded. Delegation rules apply if set."] = "Deine Abstimmung wurde zurückgezogen. Delegationsregeln gelten sofern gesetzt."; ["Your web browser is not fully supported yet."] = "Dein Web-Browser wird noch nicht vollständig unterstützt."; ["Z-A"] = "Z-A"; +["[Change] or [revoke] area delegation [change]"] = false; +["[Change] or [revoke] area delegation [midpart]"] = false; +["[Change] or [revoke] area delegation [prefix]"] = false; +["[Change] or [revoke] area delegation [revoke]"] = false; +["[Change] or [revoke] area delegation [suffix]"] = false; +["[Change] or [revoke] global delegation [change]"] = false; +["[Change] or [revoke] global delegation [midpart]"] = false; +["[Change] or [revoke] global delegation [prefix]"] = false; +["[Change] or [revoke] global delegation [revoke]"] = false; +["[Change] or [revoke] global delegation [suffix]"] = false; ["[Registered members only]"] = "[nur für Registrierte]"; ["[not displayed public]"] = "[nicht öffentlich]"; ["a bit unsatisfied"] = "etwas unzufrieden"; ["abandoned"] = "ausgesetzt"; ["activated"] = "aktiviert"; +["and"] = "und"; ["and #{count} more initiatives"] = "und #{count} weitere Initiativen"; ["area"] = "Themengebiet"; +["by"] = "von"; ["deactivated"] = "deaktiviert"; ["delete

"] = "löschen

"; ["disabled"] = "ausgeschaltet"; @@ -658,12 +707,13 @@ ["must/should not"] = "muss/soll nicht"; ["neutral"] = "neutral"; ["not implemented"] = "nicht umgesetzt"; +["not yet"] = false; ["requested"] = "angefragt"; ["satisfied"] = "zufrieden"; ["should"] = "soll"; ["should not"] = "soll nicht"; +["since #{date}"] = "seit #{date}"; ["to reset your password please click on the following link:\n\n"] = "um Dein Kennwort zurückzusetzen klicke bitte den folgenden Link an:\n\n"; ["until"] = "bis"; ["xmpp"] = "Jabber (XMPP)"; -["Last login (updated daily)"] = "Letzte Anmeldung (täglich aktualisiert)"; } diff -r 2c422bcb79de -r 4993b71b383f locale/translations.en.lua --- a/locale/translations.en.lua Sat Feb 05 20:01:09 2011 +0100 +++ b/locale/translations.en.lua Wed Mar 02 20:06:26 2011 +0100 @@ -3,14 +3,20 @@ ["##{id}"] = false; ["##{issue_id}.#{id} #{name}"] = false; ["#{author} at #{date}"] = false; +["#{direct_count}+#{delegated_count} Mitglieder"] = false; ["#{interested_issues_to_vote_count} issue(s) you are interested in"] = false; ["#{issues_to_vote_count} issue(s)"] = false; ["#{number} Image(s) has been deleted"] = false; ["#{number} Image(s) has been updated"] = false; +["#{suggestion_count} suggestions"] = false; +["#{supporter_count} supporters"] = false; +["#{time_left} left"] = false; +["#{vote_count} votes"] = false; ["(#{more_count} duplicates removed)"] = false; ["(change URL)"] = false; ["(new window)"] = false; ["+ #{weight}"] = false; +["+getElementById("] = false; ["A-Z"] = false; ["API key"] = false; ["API key has been deleted"] = false; @@ -62,6 +68,8 @@ ["Area list"] = false; ["Area successfully updated"] = false; ["Areas"] = false; +["Areas, you are member of"] = false; +["Areas, you are not member of"] = false; ["Author"] = false; ["Auto support is now disabled"] = false; ["Auto support is now enabled"] = false; @@ -77,6 +85,7 @@ ["Back to timeline"] = false; ["Ballot of '#{member_name}' for issue ##{issue_id}"] = false; ["Become a member"] = false; +["Become a member of this area"] = false; ["Birthday"] = false; ["Can't remove last initiator"] = false; ["Can't send confirmation email"] = false; @@ -87,6 +96,7 @@ ["Cancelled"] = false; ["Change API key"] = false; ["Change area delegation"] = false; +["Change delegation..."] = false; ["Change display settings"] = false; ["Change email"] = false; ["Change email address"] = false; @@ -106,9 +116,11 @@ ["Choose member"] = false; ["Click for details"] = false; ["Closed"] = false; +["Closed since #{date}"] = false; ["Collective opinion of supporters"] = false; ["Commit suggestion"] = false; ["Compare"] = false; +["Compare selected"] = false; ["Confirm"] = false; ["Confirmation code"] = false; ["Confirmation code invalid!"] = false; @@ -116,9 +128,12 @@ ["Contacts"] = false; ["Content"] = false; ["Counting of votes"] = false; +["Create / edit area"] = false; +["Create / edit policy"] = false; ["Create alternative initiative"] = false; ["Create new area"] = false; ["Create new issue"] = false; +["Create new policy"] = false; ["Created at"] = false; ["Current draft"] = false; ["Current name"] = false; @@ -130,6 +145,8 @@ ["Date format is not valid. Please use following format: YYYY-MM-DD"] = false; ["Default Policy"] = false; ["Degree"] = false; +["Delegate area..."] = false; +["Delegate issue"] = false; ["Delegation abandoned"] = false; ["Delegation problems"] = false; ["Delegation turned off for area"] = false; @@ -163,6 +180,7 @@ ["Download database export"] = false; ["Draft"] = false; ["Draft history"] = false; +["Draft revisions"] = false; ["EXPERIMENTAL FEATURE"] = false; ["Edit"] = false; ["Edit draft"] = false; @@ -190,6 +208,7 @@ ["Fully frozen at"] = false; ["Generate / change API key"] = false; ["Generate API key"] = false; +["Give up membership"] = false; ["Global delegation"] = false; ["Global delegation active"] = false; ["Go up"] = false; @@ -200,6 +219,7 @@ ["Hide"] = false; ["Hide filter details"] = false; ["Hide this help message"] = false; +["Hint"] = false; ["History"] = false; ["Home"] = false; ["I consider suggestion as"] = false; @@ -210,6 +230,7 @@ ["Images"] = false; ["In discussion"] = false; ["Incoming delegations"] = false; +["Index"] = false; ["Information about the available policies"] = false; ["Inherit autoreject from area"] = false; ["Initiated"] = false; @@ -217,7 +238,11 @@ ["Initiative ##{id}"] = false; ["Initiative events"] = false; ["Initiative is revoked now"] = false; +["Initiative not admitted"] = false; +["Initiative not agreed"] = false; ["Initiative quorum"] = false; +["Initiative quorum denumerator"] = false; +["Initiative quorum numerator"] = false; ["Initiative revoked"] = false; ["Initiative successfully created"] = false; ["Initiative successfully updated"] = false; @@ -232,12 +257,14 @@ ["Initiator"] = false; ["Initiator invites"] = false; ["Initiators"] = false; +["Interest"] = false; ["Interest not existant"] = false; ["Interest removed"] = false; ["Interest updated"] = false; ["Interested"] = false; ["Interested members"] = false; ["Internal posts"] = false; +["Interval format:"] = false; ["Invalid query"] = false; ["Invalid username or password!"] = false; ["Invitation has been refused"] = false; @@ -255,11 +282,16 @@ ["Issue finished"] = false; ["Issue finished without voting"] = false; ["Issue frozen"] = false; +["Issue not accepted"] = false; ["Issue policy"] = false; ["Issue quorum"] = false; +["Issue quorum denumerator"] = false; +["Issue quorum numerator"] = false; ["Issues"] = false; ["JavaScript is disabled or not available."] = false; ["Last author"] = false; +["Last change"] = false; +["Last login (updated daily)"] = false; ["Last snapshot:"] = false; ["Legend:"] = false; ["License"] = false; @@ -270,6 +302,8 @@ ["Logout"] = false; ["Logout successful"] = false; ["Majority"] = false; +["Majority denumerator"] = false; +["Majority numerator"] = false; ["Manage filter"] = false; ["Manage timeline filters"] = false; ["Max potential support"] = false; @@ -324,6 +358,7 @@ ["No changes to your images were made"] = false; ["No default"] = false; ["No delegation"] = false; +["No delegation active"] = false; ["No events selected to list"] = false; ["No membership at all"] = false; ["No support at all"] = false; @@ -380,6 +415,8 @@ ["Policies"] = false; ["Policy"] = false; ["Policy '#{name}'"] = false; +["Policy list"] = false; +["Policy successfully updated"] = false; ["Population"] = false; ["Posts"] = false; ["Potential support"] = false; @@ -428,6 +465,7 @@ ["Saved as contact"] = false; ["Saved contacts"] = false; ["Search"] = false; +["Search in initiatives for text:"] = false; ["Search initiatives"] = false; ["Search issues"] = false; ["Search members"] = false; @@ -456,6 +494,8 @@ ["Show member"] = false; ["Show name history"] = false; ["Show only events which match... (or associtated)"] = false; +["Show policies in use"] = false; +["Show policies not in use"] = false; ["So I'm"] = false; ["Software"] = false; ["Some JavaScript based functions (voting in particular) will not work.\nFor this beta, please use a current version of Firefox, Safari, Opera(?), Konqueror or another (more) standard compliant browser.\nAlternative access without JavaScript will be available soon."] = false; @@ -473,6 +513,7 @@ ["Step 3/5: Username"] = false; ["Step 4/5: Login name"] = false; ["Step 5/5: Terms of use and password"] = false; +["Strict majority"] = false; ["Stylesheet URL"] = false; ["Stylesheet URL has been updated"] = false; ["Suggest no initiative"] = false; @@ -490,6 +531,7 @@ ["Supported"] = false; ["Supported initiatives"] = false; ["Supporter"] = false; +["Supporters"] = false; ["Syntax help"] = false; ["Tabs"] = false; ["Terms of use"] = false; @@ -498,6 +540,7 @@ ["The draft of this initiative has been updated!"] = false; ["The drafts do not differ"] = false; ["The initiators suggest to support the following initiative:"] = false; +["The interested members are updated after some time."] = false; ["There are no more alternative initiatives currently."] = false; ["There were no more alternative initiatives."] = false; ["This email address is too short!"] = false; @@ -513,6 +556,8 @@ ["This issue has been finished without any winning initiative."] = false; ["This issue is already closed."] = false; ["This issue is already frozen."] = false; +["This issue is closed"] = false; +["This issue is in voting"] = false; ["This login is already taken, please choose another one!"] = false; ["This login is too short!"] = false; ["This member account has been created at #{created}"] = false; @@ -553,6 +598,7 @@ ["Voted no"] = false; ["Voted proposal"] = false; ["Voted yes"] = false; +["Votes"] = false; ["Voting"] = false; ["Voting details"] = false; ["Voting for this issue has already begun."] = false; @@ -575,8 +621,11 @@ ["You are currently not supporting this initiative directly. By adding suggestions to this initiative you will automatically become a potential supporter."] = false; ["You are iniator of this initiative"] = false; ["You are interested in this issue"] = false; +["You are interested in this issue by delegation"] = false; ["You are invited to become initiator of this initiative."] = false; ["You are member"] = false; +["You are member of this area"] = false; +["You are not interested in this issue"] = false; ["You are now initiator of this initiative"] = false; ["You are potential supporter of this initiative"] = false; ["You are supporting this initiative"] = false; @@ -586,11 +635,16 @@ ["You didn't confirmed your email address '#{email}' within 7 days."] = false; ["You didn't confirmed your email address '#{email}'. You have received an email with an activation link."] = false; ["You didn't saved any member as contact yet."] = false; +["You have delegated globally"] = false; +["You have delegated this area"] = false; +["You have delegated this issue"] = false; ["You have saved this member as contact"] = false; ["You have saved this member as contact."] = false; ["You have to mark 'Are you sure' to revoke!"] = false; ["You need to be logged in, to use all features of this system."] = false; ["You want to vote later"] = false; +["You were interested in this issue"] = false; +["You were interested in this issue by delegation"] = false; ["You've successfully registered and you can login now with your login and password!"] = false; ["Your API key:"] = false; ["Your are interested"] = false; @@ -619,13 +673,25 @@ ["Your vote has been discarded. Delegation rules apply if set."] = false; ["Your web browser is not fully supported yet."] = false; ["Z-A"] = false; +["[Change] or [revoke] area delegation [change]"] = "Change"; +["[Change] or [revoke] area delegation [midpart]"] = " or "; +["[Change] or [revoke] area delegation [prefix]"] = ""; +["[Change] or [revoke] area delegation [revoke]"] = "revoke"; +["[Change] or [revoke] area delegation [suffix]"] = " area delegation"; +["[Change] or [revoke] global delegation [change]"] = "Change"; +["[Change] or [revoke] global delegation [midpart]"] = " or "; +["[Change] or [revoke] global delegation [prefix]"] = ""; +["[Change] or [revoke] global delegation [revoke]"] = "revoke"; +["[Change] or [revoke] global delegation [suffix]"] = " global delegation"; ["[Registered members only]"] = false; ["[not displayed public]"] = false; ["a bit unsatisfied"] = false; ["abandoned"] = false; ["activated"] = false; +["and"] = false; ["and #{count} more initiatives"] = false; ["area"] = false; +["by"] = false; ["deactivated"] = false; ["delete

"] = false; ["disabled"] = false; @@ -641,10 +707,12 @@ ["must/should not"] = false; ["neutral"] = false; ["not implemented"] = false; +["not yet"] = false; ["requested"] = false; ["satisfied"] = false; ["should"] = false; ["should not"] = false; +["since #{date}"] = false; ["to reset your password please click on the following link:\n\n"] = false; ["until"] = false; ["xmpp"] = false; diff -r 2c422bcb79de -r 4993b71b383f model/area.lua --- a/model/area.lua Sat Feb 05 20:01:09 2011 +0100 +++ b/model/area.lua Wed Mar 02 20:06:26 2011 +0100 @@ -63,5 +63,12 @@ if args.active ~= nil then selector:add_where{ "active = ?", args.active } end + if args.member_id then + selector:join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ?", args.member_id }) + end + if args.not_member_id then + selector:left_join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ?", args.not_member_id }) + selector:add_where{ "membership.member_id ISNULL" } + end return selector end diff -r 2c422bcb79de -r 4993b71b383f model/delegating_interest_snapshot.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/model/delegating_interest_snapshot.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,10 @@ +DelegatingInterestSnapshot = mondelefant.new_class() +DelegatingInterestSnapshot.table = 'delegating_interest_snapshot' +DelegatingInterestSnapshot.primary_key = { "issue_id", "event", "member_id" } + +function DelegatingInterestSnapshot:by_pk(issue_id, event, member_id) + return self:new_selector() + :add_where{ "issue_id = ? AND event = ? AND member_id = ?", issue_id, event, member_id } + :optional_object_mode() + :exec() +end \ No newline at end of file diff -r 2c422bcb79de -r 4993b71b383f model/direct_interest_snapshot.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/model/direct_interest_snapshot.lua Wed Mar 02 20:06:26 2011 +0100 @@ -0,0 +1,10 @@ +DirectInterestSnapshot = mondelefant.new_class() +DirectInterestSnapshot.table = 'direct_interest_snapshot' +DirectInterestSnapshot.primary_key = { "issue_id", "event", "member_id" } + +function DirectInterestSnapshot:by_pk(issue_id, event, member_id) + return self:new_selector() + :add_where{ "issue_id = ? AND event = ? AND member_id = ?", issue_id, event, member_id } + :optional_object_mode() + :exec() +end \ No newline at end of file diff -r 2c422bcb79de -r 4993b71b383f model/issue.lua --- a/model/issue.lua Sat Feb 05 20:01:09 2011 +0100 +++ b/model/issue.lua Wed Mar 02 20:06:26 2011 +0100 @@ -23,7 +23,8 @@ this_key = 'id', that_key = 'issue_id', ref = 'initiatives', - back_ref = 'issue' + back_ref = 'issue', + default_order = 'initiative.rank, initiative.admitted ISNULL, initiative.admitted DESC, initiative.positive_votes::float / initiative.negative_votes::float DESC, initiative.supporter_count DESC' } Issue:add_reference{ @@ -85,7 +86,7 @@ connected_by_that_key = 'member_id', ref = 'members' } - +--[[ Issue:add_reference{ mode = 'mm', to = "Member", @@ -96,7 +97,7 @@ connected_by_that_key = 'member_id', ref = 'interested_members_snapshot' } - +--]] Issue:add_reference{ mode = 'mm', to = "Member", @@ -108,6 +109,133 @@ ref = 'direct_voters' } +Issue:add_reference{ + mode = 'mm', + to = "Member", + this_key = 'id', + that_key = 'id', + connected_by_table = 'direct_interest_snapshot', + connected_by_this_key = 'issue_id', + connected_by_that_key = 'member_id', + ref = 'interested_members_snapshot', + selector_generator = function(list, options) + -- build list of issue ids + local ids = { sep = ", " } + for i, object in ipairs(list) do + local id = object.id + if id ~= nil then + ids[#ids+1] = {"?", id} + end + end + + if #ids == 0 then + return Member:new_selector():empty_list_mode() + end + + local selector = Member:new_selector() + selector:join("direct_interest_snapshot", nil, { "direct_interest_snapshot.member_id = member.id AND direct_interest_snapshot.issue_id IN ($)", ids }) + selector:join("issue", nil, "direct_interest_snapshot.issue_id = issue.id AND direct_interest_snapshot.event = issue.latest_snapshot_event") + selector:add_order_by('direct_interest_snapshot.weight DESC') + return selector + end +} + +Issue:add_reference{ + mode = '11', + to = "DelegatingInterestSnapshot", + this_key = 'id', + that_key = 'issue_id', + ref = 'delegating_interest_snapshot_for_member', + back_ref = 'issue', + selector_generator = function(list, options) + local member_id = assert(options.member_id) + + -- build list of issue ids + local ids = { sep = ", " } + for i, object in ipairs(list) do + local id = object.id + if id ~= nil then + ids[#ids+1] = {"?", id} + end + end + + if #ids == 0 then + return DelegatingInterestSnapshot:new_selector():empty_list_mode() + end + + local selector = DelegatingInterestSnapshot:new_selector() + selector:join("issue", nil, "delegating_interest_snapshot.issue_id = issue.id AND delegating_interest_snapshot.event = issue.latest_snapshot_event") + selector:add_where{ 'delegating_interest_snapshot.issue_id IN ($)', ids } + selector:add_where{ 'delegating_interest_snapshot.member_id = ?', options.member_id } + + return selector + end +} + +Issue:add_reference{ + mode = '11', + to = "Interest", + this_key = 'id', + that_key = 'issue_id', + ref = 'interest_for_member', + back_ref = 'issue', + selector_generator = function(list, options) + + local member_id = assert(options.member_id) + + -- build list of issue ids + local ids = { sep = ", " } + for i, object in ipairs(list) do + local id = object.id + if id ~= nil then + ids[#ids+1] = {"?", id} + end + end + + if #ids == 0 then + return Interest:new_selector():empty_list_mode() + end + + local selector = Interest:new_selector() + selector:add_where{ 'interest.issue_id IN ($)', ids } + selector:add_where{ 'interest.member_id = ?', member_id } + return selector + + end +} + +Issue:add_reference{ + mode = '1m', + to = "Delegation", + this_key = 'id', + that_key = 'issue_id', + ref = 'outgoing_delegations_for_member', + back_ref = 'issue', + selector_generator = function(list, options) + + local member_id = assert(options.member_id) + + -- build list of issue ids + local ids = { sep = ", " } + for i, object in ipairs(list) do + local id = object.id + if id ~= nil then + ids[#ids+1] = {"?", id} + end + end + + if #ids == 0 then + return Delegation:new_selector():empty_list_mode() + end + + local selector = Delegation:new_selector() + selector:add_where{ 'delegation.issue_id IN ($)', ids } + selector:add_where{ 'delegation.truster_id = ?', member_id } + return selector + + end +} + function Issue:get_state_name_for_state(value) @@ -169,6 +297,33 @@ end end +function Issue:build_selector(args) + local selector = self:new_selector() + if args.area_id then + selector:add_where{ "issue.area_id = ?", args.area_id } + end + if args.state == "closed" then + selector:add_where("issue.closed NOTNULL") + elseif args.state == "voting" then + selector:add_where("issue.fully_frozen NOTNULL AND issue.closed ISNULL") + elseif args.state == "frozen" then + selector:add_where("issue.half_frozen NOTNULL AND issue.fully_frozen ISNULL AND issue.closed ISNULL") + elseif args.state == "discussion" then + selector:add_where("issue.accepted NOTNULL AND issue.half_frozen ISNULL AND issue.closed ISNULL") + elseif args.state == "new" then + selector:add_where("issue.accepted ISNULL AND issue.closed ISNULL") + end + if args.order == "time_left" then + selector:add_order_by("issue.closed DESC") + elseif args.order == "last_change" then + selector:add_order_by("issue.closed DESC") + elseif args.order == "interest" then + selector:add_order_by("issue.population DESC") + end + + return selector +end + function Issue.object_get:state() if self.closed then if self.fully_frozen then diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_award_gold.png Binary file static/lf2/icon_award_gold.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_award_silver.png Binary file static/lf2/icon_award_silver.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_cross.png Binary file static/lf2/icon_cross.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_delegated_star.png Binary file static/lf2/icon_delegated_star.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_delegation.png Binary file static/lf2/icon_delegation.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_delegation_area.png Binary file static/lf2/icon_delegation_area.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_delegation_global.png Binary file static/lf2/icon_delegation_global.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_eye.png Binary file static/lf2/icon_eye.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_search.png Binary file static/lf2/icon_search.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_search_crossed.png Binary file static/lf2/icon_search_crossed.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_star.png Binary file static/lf2/icon_star.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_star_crossed.png Binary file static/lf2/icon_star_crossed.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_star_grey.png Binary file static/lf2/icon_star_grey.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_suggestion.png Binary file static/lf2/icon_suggestion.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_supporter.png Binary file static/lf2/icon_supporter.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_text.png Binary file static/lf2/icon_text.png has changed diff -r 2c422bcb79de -r 4993b71b383f static/lf2/icon_vote.png Binary file static/lf2/icon_vote.png has changed