# HG changeset patch # User bsw # Date 1299954170 -3600 # Node ID 73dbc9e2bfd408a157517a5cac9b17172773469d # Parent 4f6e6b213fb89eaedb3f511fee4a1dea7204edb3 Cummulative patch for enhancements at next generation frontend diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/_layout/lf2.html --- a/app/main/_layout/lf2.html Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/_layout/lf2.html Sat Mar 12 19:22:50 2011 +0100 @@ -2,11 +2,21 @@ + LiquidFeedback -
+
+ LiquidFeedback + Musterorganisation + +
+
+

diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/delegation/_action/update.lua --- a/app/main/delegation/_action/update.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/delegation/_action/update.lua Sat Mar 12 19:22:50 2011 +0100 @@ -2,15 +2,19 @@ local trustee_id = param.get("trustee_id", atom.integer) +local unit_id = param.get("unit_id", atom.integer) + local area_id = param.get("area_id", atom.integer) local issue_id = param.get("issue_id", atom.integer) if issue_id then area_id = nil +elseif area_id then + unit_id = nil end -local delegation = Delegation:by_pk(truster_id, area_id, issue_id) +local delegation = Delegation:by_pk(truster_id, unit_id, area_id, issue_id) if param.get("delete") or trustee_id == -1 then @@ -22,8 +26,10 @@ slot.put_into("notice", _"Your delegation for this issue has been deleted.") elseif area_id then slot.put_into("notice", _"Your delegation for this area has been deleted.") + elseif unit_id then + slot.put_into("notice", _"Your delegation for this unit has been deleted.") else - slot.put_into("notice", _"Your global delegation has been deleted.") + error("shouldn't happen") end end @@ -33,14 +39,17 @@ if not delegation then delegation = Delegation:new() delegation.truster_id = truster_id + delegation.unit_id = unit_id delegation.area_id = area_id delegation.issue_id = issue_id if issue_id then delegation.scope = "issue" elseif area_id then delegation.scope = "area" + elseif unit_id then + delegation.scope = "unit" else - delegation.scope = "global" + error("should'nt happen") end end if trustee_id == 0 then @@ -55,8 +64,10 @@ slot.put_into("notice", _"Your delegation for this issue has been updated.") elseif area_id then slot.put_into("notice", _"Your delegation for this area has been updated.") + elseif unit_id then + slot.put_into("notice", _"Your delegation for this unit has been updated.") else - slot.put_into("notice", _"Your global delegation has been updated.") + error("shouldn't happen") end end diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/_area.lua --- a/app/main/lf2/_area.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/_area.lua Sat Mar 12 19:22:50 2011 +0100 @@ -4,48 +4,46 @@ 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") + :join({ "delegation_chain(?, null, ?, null)", app.session.member_id, area.id }, "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 = "head left name", content = area.name } + ui.box_col{ class = "head left name", content = function() + if membership then + local text = _"You are member of this area" + ui.image{ attr = { title = text, alt = text }, static = "lf2/icon_star.png" } + else + end + slot.put(" ") + ui.tag{ content = area.name } + end } ui.box_col{ class = "right", content = _("#{direct_count}+#{delegated_count} members", { 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 - if #trustees > 1 then 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 } - if trustees[1].scope_out == "area" then - text = _"Change or revoke area delegation" - else - text = _"Set area delegation" - end - ui.box_col{ class = "right", content = function() - ui.link{ - text = text, - module = "lf2", view = "delegation", params = { area_id = area.id } - } - end } 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") + 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 area membership" + } else ui.link{ module = "membership", action = "update", params = { area_id = area.id }, @@ -55,27 +53,21 @@ 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 #trustees == 1 then - if membership then - slot.put(" · ") - end - ui.link{ - text = _"Set area delegation", - module = "lf2", view = "delegation", params = { area_id = area.id } - } - end + slot.put(" · ") + if trustees[1].scope_out == "area" then + text = _"Change or revoke area delegation" + else + text = _"Set area delegation" + end + ui.link{ + text = text, + module = "lf2", view = "delegation", params = { area_id = area.id } + } end } end } + if area.description and #area.description > 0 then +-- ui.box_row{ class = "description", content = function() ui.box_col{ content = area.description } end } + end + end } \ No newline at end of file diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/_avatars.lua --- a/app/main/lf2/_avatars.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/_avatars.lua Sat Mar 12 19:22:50 2011 +0100 @@ -11,9 +11,9 @@ end local image local text - if member.scope_in == "global" then - image = "lf2/icon_delegation_global.png" - text = _"Global delegation" + if member.scope_in == "unit" then + image = "lf2/icon_delegation_unit.png" + text = _"Unit delegation" elseif member.scope_in == "area" then image = "lf2/icon_delegation_area.png" text = _"Area delegation" diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/_draft.lua --- a/app/main/lf2/_draft.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/_draft.lua Sat Mar 12 19:22:50 2011 +0100 @@ -1,5 +1,3 @@ local draft = param.get("draft", "table") -ui.container{ attr = { class = "draft" }, content = function() - slot.put(format.wiki_text(draft.content, draft.formatting_engine)) -end } +slot.put(format.wiki_text(draft.content, draft.formatting_engine)) diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/_filter_view/10_topnav.lua --- a/app/main/lf2/_filter_view/10_topnav.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/_filter_view/10_topnav.lua Sat Mar 12 19:22:50 2011 +0100 @@ -1,20 +1,11 @@ execute.inner() -local phase -if app.topnav_phase then - phase = app.topnav_phase -else - phase = param.get("phase") -end +local phase = app.topnav_phase +local order = app.topnav_order -local area_id -if app.topnav_area_id then - area_id = app.topnav_area_id -else - area_id = param.get_all_cgi()["area_id"] -end +local area_id = app.topnav_area_id +local unit_id = app.topnav_unit_id -local order = param.get("order") local view local id @@ -23,6 +14,7 @@ id = area_id else view = "index" + id = unit_id end slot.select("topnav", function() @@ -49,18 +41,31 @@ } ui.container{ attr = { class = "right" }, content = function() - ui.link{ - attr = { class = order == "last_change" and "active" or nil }, - text = _"Last change", module = "lf2", view = view, id = id, params = { order = "last_change", state = state } - } - ui.link{ - attr = { class = order == "time_left" and "active" or nil }, - text = _"Time left", module = "lf2", view = view, id = id, params = { order = "time_left", state = state } - } - ui.link{ - attr = { class = order == "interest" and "active" or nil }, - text = _"Interest", module = "lf2", view = view, id = id, params = { order = "interest", state = state } - } + if not order then + ui.tag{ attr = { class = "inactive" }, content = _"↕ Interest" } + else + ui.link{ + attr = { class = order == "interest" and "active" or nil }, + text = _"↕ Interest", module = "lf2", view = view, id = id, params = { phase = phase, order = "interest", state = state } + } + end + + if not order or phase == "closed" then + ui.tag{ attr = { class = "inactive" }, content = _"↕ Time left" } + else + ui.link{ + attr = { class = order == "time_left" and "active" or "" }, + text = _"↕ Time left", module = "lf2", view = view, id = id, params = { phase = phase, order = "time_left", state = state } + } + end + if not order then + ui.tag{ attr = { class = "inactive" }, content = _"↕ Last change" } + else + ui.link{ + attr = { class = order == "last_change" and "active" or nil }, + text = _"↕ Last change", module = "lf2", view = view, id = id, params = { phase = phase, order = "last_change", state = state } + } + end end } end) diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/_interested.lua --- a/app/main/lf2/_interested.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/_interested.lua Sat Mar 12 19:22:50 2011 +0100 @@ -1,13 +0,0 @@ -local interested_members = param.get("interested_members", "table") -local issue_id = param.get("issue_id", atom.integer) -ui.box{ row_count = 2, content = function() - ui.box_row{ class = "head interested", content = function() - ui.box_col{ class = "head left", content = _"Members, interested in this issue" } - ui.box_col{ class = "right", content = _("#{count} members", { count = #interested_members }) } - end } - ui.box_row{ class = "interested", content = function() - ui.box_col{ class = "", content = function() - execute.view{ module = "lf2", view = "_avatars", params = { members = interested_members, issue_id = issue_id } } - end } - end } -end } diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/_issue.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/_issue.lua Sat Mar 12 19:22:50 2011 +0100 @@ -0,0 +1,178 @@ +local issue = param.get("issue", "table") +local for_list = param.get("for_list", atom.boolean) + +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(?, null, null, " .. tostring(issue.id or "NULL") .. ")", app.session.member.id }, "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 +--[[ +local current_delegating_interest = false + +for i, trustee in ipairs(trustees) do + if i > 1 and trustee.participation then + delegating_interest = true + end +end +--]] +local row_count = #initiatives + 3 +if #trustees > 1 then + row_count = row_count + 1 +end + +ui.box{ class = "issue", content = function() + ui.box_row{ class = "head", content = function() + + ui.box_col{ class = "issue_id left head", content = function() + if interest then + local text + if issue.close then + text = _"You were interested in this issue" + else + text = _"You are interested in this issue" + end + ui.image{ attr = { title = text, alt = text}, static = "lf2/icon_star.png" } + elseif delegating_interest then + local text + if issue.closed then + text = _"Someone in your delegation chain was interested" + else + text = _"Someone in your delegation chain is interested" + end + ui.image{ attr = { title = text, alt = text}, static = "lf2/icon_delegated_star.png" } + end + slot.put(" ") + ui.link{ + module = "lf2", view = "issue", id = issue.id, + content = _("Issue ##{id}", { id = issue.id }) + } + end } + + end } + + if #trustees > 1 then + ui.box_row{ class = "head2", content = function() + ui.box_col{ class = "head left", content = function() + execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small", issue_id = issue.id } } + end } + end } + end + + if not issue.closed and not issue.fully_frozen then + ui.box_row{ content = function() + ui.box_col{ class = "head", content = function() + if interest then + ui.link{ + text = _"Remove interest", + module = "interest", action = "update", params = { issue_id = issue.id, delete = true }, + routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } } + } + elseif not issue.closed and not issue.fully_frozen then + ui.link{ + text = _"Add my interest", + module = "interest", action = "update", params = { issue_id = issue.id }, + routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } } + } + end + if #trustees == 1 then + ui.link{ + text = _"Set issue delegation", + module = "lf2", view = "delegation", params = { issue_id = issue.id } + } + end + slot.put(" · ") + if not issue.closed and not issue.fully_frozen then + if trustees[1].scope_out == "issue" then + text = _"Change or revoke issue delegation" + else + text = _"Set issue delegation" + end + ui.link{ + text = text, + module = "lf2", view = "delegation", params = { issue_id = issue.id } + } + end + end } + + end } + end + + ui.box_row{ content = function() + ui.box_col{ class = "unit_name left", content = function() + ui.link{ + module = "lf2", view = "index", id = issue.area.unit_id, + params = { phase = issue.phase }, + text = issue.area.unit.name + } + end } + ui.box_col{ class = "policy_name right", content = function() + ui.link{ + module = "lf2", view = "policy", id = issue.policy_id, + content = issue.policy.name + } + end } + end } + + ui.box_row{ content = function() + ui.box_col{ class = "area_name left", content = function() + ui.link{ + module = "lf2", view = "area", id = issue.area_id, + params = { phase = issue.phase }, + text = issue.area.name + } + end } + ui.box_col{ class = "state_time_left right", 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 } + + + ui.box_row{ class = "subhead", content = function() + ui.box_col{ class = "head", content = _"Initiatives" } + 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 + if not for_list then + -- TODO bugfix for not working reference loader + interested_members = issue:get_reference_selector("interested_members_snapshot"):exec() + + ui.box_row{ class = "subhead", content = function() + ui.box_col{ class = "head left", content = _"Members, interested in this issue" } + ui.box_col{ class = "right", content = _("#{count} members", { count = #interested_members }) } + end } + ui.box_row{ class = "interested", content = function() + ui.box_col{ class = "", content = function() + execute.view{ module = "lf2", view = "_avatars", params = { members = interested_members, issue_id = issue.id } } + end } + end } + end +end } \ No newline at end of file diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/_issues.lua --- a/app/main/lf2/_issues.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/_issues.lua Sat Mar 12 19:22:50 2011 +0100 @@ -1,161 +1,5 @@ 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 - --[[ - local current_delegating_interest = false - - for i, trustee in ipairs(trustees) do - if i > 1 and trustee.participation then - delegating_interest = true - end - end - --]] - local row_count = #initiatives + 3 - if #trustees > 1 then - row_count = row_count + 1 - end - - ui.box{ class = "issue", row_count = row_count, content = function() - - ui.box_row{ class = "head2", content = function() - - ui.box_col{ class = "issue_id left head", content = function() - ui.link{ - module = "lf2", view = "issue", id = issue.id, - content = _("Issue ##{id}", { id = issue.id }) - } - end } - - ui.box_col{ class = "policy_name right", 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 } - end } - ui.box_col{ class = "state_time_left right", content = function() - 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 #trustees > 1 then - local class = "head" - if not issue.closed and not issue.fully_frozen then - class = "head2" - end - ui.box_row{ class = "head2", content = function() - ui.box_col{ class = "left", content = function() - execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small", issue_id = issue.id } } - end } - if not issue.closed and not issue.fully_frozen then - if trustees[1].scope_out == "issue" then - text = _"Change or revoke issue delegation" - else - text = _"Set issue delegation" - end - ui.box_col{ class = "right", content = function() - ui.link{ - text = text, - module = "lf2", view = "delegation", params = { issue_id = issue.id } - } - end } - end - end } - end - - if not issue.closed and not issue.fully_frozen then - ui.box_row{ class = "head", content = function() - ui.box_col{ class = "interest left", content = function() - if interest then - ui.image{ static = "lf2/icon_star.png" } - if issue.close 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(" ", _"Someone in your delegation chain was interested") - else - slot.put(" ", _"Someone in your delegation chain is interested") - end - elseif not issue.closed and not issue.fully_frozen then - ui.link{ - text = _"Add my interest", - module = "interest", action = "update", params = { issue_id = issue.id }, - routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } } - } - end - end } - - ui.box_col{ class = "right", content = function() - if interest then - ui.link{ - text = _"Remove interest", - module = "interest", action = "update", params = { issue_id = issue.id, delete = true }, - routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } } - } - slot.put(" · ") - elseif delegating_interest then - ui.link{ - text = _"Add my interest", - module = "interest", action = "update", params = { issue_id = issue.id }, - routing = { default = { mode = "redirect", module = "lf2", view = "issue", id = issue.id } } - } - slot.put(" · ") - end - if #trustees == 1 then - ui.link{ - text = _"Set issue delegation", - module = "lf2", view = "delegation", params = { issue_id = issue.id } - } - 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 + execute.view{ module = "lf2", view = "_issue", params = { issue = issue, for_list = true } } +end diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/_sidebar_issue.lua --- a/app/main/lf2/_sidebar_issue.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/_sidebar_issue.lua Sat Mar 12 19:22:50 2011 +0100 @@ -15,7 +15,7 @@ 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") + :join("delegation_chain(" .. tostring(app.session.member.id) .. ", NULL, NULL, " .. tostring(issue.id or "NULL") .. ")", "delegation_chain", "member.id = delegation_chain.member_id") :add_order_by("index") :exec() @@ -23,27 +23,91 @@ ui.box{ class = "issue", content = function() - ui.box_row{ class = "unit_name head2x", content = function() ui.box_col{ content = function() + ui.box_row{ class = "issue_id head", content = function() ui.box_col{ class = "head", content = function() + if interest then + local text + if issue.close then + text = _"You were interested in this issue" + else + text = _"You are interested in this issue" + end + ui.image{ attr = { title = text, alt = text}, static = "lf2/icon_star.png" } + slot.put(" ") + elseif delegating_interest then + local text + if issue.closed then + text = _"Someone in your delegation chain was interested" + else + text = _"Someone in your delegation chain is interested" + end + ui.image{ attr = { title = text, alt = text}, static = "lf2/icon_delegated_star.png" } + slot.put(" ") + end + ui.link{ + module = "lf2", view = "issue", id = issue.id, + content = _("Issue ##{id}", { id = issue.id }) + } + end } end } + + if #trustees > 1 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", issue_id = issue.id } } + end } end } + end + + if not issue.closed then + ui.box_row{ class = "interest", content = function() ui.box_col{ content = function() + if interest then + ui.link{ + module = "interest", action = "update", params = { issue_id = issue.id, delete = true }, + routing = { default = { + mode = "redirect", module = "lf2", view = initiative_id and "initiative" or "issue", id = initiative_id or issue.id, + } }, + content = _"Remove my interest" + } + else + ui.link{ + module = "interest", action = "update", params = { issue_id = issue.id }, + routing = { default = { + mode = "redirect", module = "lf2", view = initiative_id and "initiative" or "issue", id = initiative_id or issue.id, + } }, + content = _"Add my interest" + } + end + end } end } + end + + if not issue.closed then + ui.box_row{ class = "interest", content = function() ui.box_col{ content = function() + if #trustees > 1 and trustees[1].scope_out == "issue" then + ui.link{ + module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id }, + content = _"Set issue delegation" + } + else + ui.link{ + module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id }, + content = _"Change or remove delegation" + } + end + + end } end } + end + + ui.box_row{ class = "unit_name", content = function() ui.box_col{ content = function() ui.link{ module = "lf2", view = "index", id = 1, content = "DE / Berlin / Friedrichshain-Kreuzberg" } end } end } - ui.box_row{ class = "area_name head2x", content = function() ui.box_col{ content = function() + 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 = "issue_id subhead", content = function() ui.box_col{ class = "head", content = function() - ui.link{ - module = "lf2", view = "issue", id = issue.id, - content = _("Issue ##{id}", { id = issue.id }) - } - 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, @@ -58,143 +122,14 @@ 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 } - - 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 - if not issue.closed and not issue.fully_frozen then - ui.image{ static = "lf2/icon_star_grey.png" } - end - 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 = initiative_id and "initiative" or "issue", id = initiative_id or 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 = initiative_id and "initiative" or "issue", id = initiative_id or 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 trustees[1].scope_out then - ui.image{ static = "lf2/icon_delegation.png" } - slot.put(" ") - if trustees[1].disabled_out == false then - if trustees[1].scope_out == "issue" then - slot.put(encode.html(_"Issue is delegated")) - elseif trustees[1].scope_out == "area" then - slot.put(encode.html(_"Area is delegated")) - elseif trustees[1].scope_out == "global" then - slot.put(encode.html(_"Unit wide delegated")) - end - else - if trustees[1].scope_out == "issue" then - slot.put(encode.html(_"Issue delegation abandoned")) - elseif trustees[1].scope_out == "area" then - slot.put(encode.html(_"Area delegation abandoned")) - elseif trustees[1].scope_out == "global" then - slot.put(encode.html(_"Global delegation abandoned")) - end - 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 } - 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 #trustees > 1 and trustees[1].scope_out == "issue" then - ui.link{ - module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id }, - attr = { class = "hoverbutton red"}, content = function() - ui.container{ attr = { class = "content"}, content = function() - slot.put(" ", encode.html(_"Change issue delegation")) - end } - end } - - else - ui.link{ - module = "lf2", view = "delegation", params = { issue_id = issue.id, initiative_id = initiative_id }, - attr = { class = "hoverbutton green"}, content = function() - ui.container{ attr = { class = "content"}, content = function() - slot.put(" ", encode.html(_"Set issue delegation")) - - end } - end } - - end - end - - end } end } - - if #trustees > 1 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", issue_id = issue.id } } - end } end } - end ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Initiatives" } end } ui.box_row{ class = "initiatives last", content = function() - ui.box_col{ class = "scrolled", content = function() + ui.box_col{ id = "resizable", class = "scrolled", content = function() execute.view{ module = "lf2", view = "_issue_initiatives", params = { initiatives = alternative_initiatives, current_initiative_id = initiative_id } } end } end } + ui.script{ script = "$(function() { $( '#resizable' ).resizable(); });" } end } diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/_sidebar_unit.lua --- a/app/main/lf2/_sidebar_unit.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/_sidebar_unit.lua Sat Mar 12 19:22:50 2011 +0100 @@ -1,57 +1,86 @@ +local unit = param.get("unit", "table") + local current_area_id = param.get("current_area_id", atom.integer) local current_phase = param.get_all_cgi()["phase"] -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" +local records = { + { id = 0, name = _"All units" }, + { id = "disabled", name = "" }, + { id = "disabled", name = _"Units, you are member of:" }, } -local unit = {} - -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() - -local row_count = member_areas_selector:count() + other_areas_selector:count() + 4 -if #trustees > 1 then - row_count = row_count + 1 + +for i, unit in ipairs(Unit:get_flattened_tree()) do + records[#records+1] = { id = unit.id, name = unit.flattened_tree_name } end -ui.box{ row_count = row_count, content = function() +records[#records+1] = { id = "disabled", name = "" } +records[#records+1] = { id = -1, name = _"Other units..." } + +ui.box{ content = function() ui.box_row{ class = "head", content = function() - ui.box_col{ class = "head", content = _"DE / Berlin / Friedrichshain-Kreuzberg" } + ui.box_col{ class = "head", content = function() + ui.form{ + method = "GET", + module = "lf2", view = "index", + content = function() + ui.field.select{ + attr = { onchange = "this.form.submit();" }, + name = "_webmcp_id", + foreign_records = records, + foreign_id = "id", + foreign_name = "name", + disabled_records = { disabled = true }, + value = unit and unit.id or 0 + } + end + } + end } end } - - if #trustees > 1 then + + if unit then + local trustees = Member:new_selector() + :add_field("delegation_chain.*") + :join({ "delegation_chain(?, ?, NULL, NULL)", app.session.member.id, unit.id }, "delegation_chain", "member.id = delegation_chain.member_id") + :add_order_by("index") + :exec() + + if #trustees > 1 then + 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 } + end + ui.box_row{ content = function() ui.box_col{ content = function() - execute.view{ module = "lf2", view = "_avatars", params = { members = trustees, arrows = true, size = "small" } } + if trustees[1].scope_out == "global" then + text = _"Change or revoke unit delegation" + else + text = _"Set unit delegation" + end + ui.link{ + text = text, + module = "lf2", view = "delegation", params = { unit_id = unit.id } + } end } end } end - - ui.box_row{ content = function() ui.box_col{ content = function() - if trustees[1].scope_out == "global" then - text = _"Change or revoke unit delegation" - else - text = _"Set unit delegation" - end - ui.link{ - text = text, - module = "lf2", view = "delegation", params = { unit_id = unit.id } - } - end } end } - - - ui.form{ - method = "get", - content = function() - - ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = function() + +end } + +if unit then + local member_areas_selector = Area:build_selector{ + unit_id = unit.id, + member_id = app.session.member_id, + order = "name" + } + local other_areas_selector = Area:build_selector{ + unit_id = unit.id, + not_member_id = app.session.member_id, + order = "name" + } + + if member_areas_selector:count() > 0 then + ui.box{ content = function() + ui.box_row{ class = "head", content = function() ui.box_col{ class = "head", content = function() ui.link{ text = _"Areas, you are member of", module = "lf2", view = "index" } end } end } @@ -62,9 +91,13 @@ current_phase = current_phase } } + end } + end - ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = function() - ui.link{ content = _"Other areas", module = "lf2", view = "index" } + if other_areas_selector:count() > 0 then + ui.box{ content = function() + ui.box_row{ class = "head", content = function() ui.box_col{ class = "head", content = function() + ui.link{ content = _"Areas", module = "lf2", view = "index" } end } end } execute.view{ @@ -74,10 +107,8 @@ current_phase = current_phase } } - - end - } - -end } + end } + end +end execute.view{ module = "lf2", view = "_search", params = { area = area } } diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/area.lua --- a/app/main/lf2/area.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/area.lua Sat Mar 12 19:22:50 2011 +0100 @@ -1,18 +1,12 @@ local area = Area:by_id(param.get_id()) -slot.set_layout("lf2") - -slot.select("sidebar", function() - execute.view{ module = "lf2", view = "_sidebar_unit", params = { current_area_id = area.id } } -end) - -execute.view{ module = "lf2", view = "_area", params = { area = area } } - +local current_phase = param.get("phase") or "closed" +local current_order = param.get("order") or "last_change" local issues_selector = Issue:build_selector{ area_id = area.id, - phase = param.get("phase"), - order = param.get("order") + phase = current_phase, + order = current_order }:limit(25) local issues = issues_selector:exec() @@ -21,7 +15,18 @@ 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") +app.topnav_order = current_order +app.topnav_phase = current_phase +app.topnav_area_id = area.id +app.topnav_unit_id = area.unit_id -app.topnav_area_id = area.id + +slot.set_layout("lf2") + +slot.select("sidebar", function() + execute.view{ module = "lf2", view = "_sidebar_unit", params = { unit = area.unit, current_area_id = area.id } } +end) + +execute.view{ module = "lf2", view = "_area", params = { area = area } } execute.view{ module = "lf2", view = "_issues", params = { issues = issues } } diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/delegation.lua --- a/app/main/lf2/delegation.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/delegation.lua Sat Mar 12 19:22:50 2011 +0100 @@ -2,6 +2,10 @@ local area = Area:by_id(param.get("area_id", atom.integer)) local issue = Issue:by_id(param.get("issue_id", atom.integer)) +local unit = Unit:by_id(param.get("unit_id", atom.integer)) + +local delegation = Delegation:by_pk(app.session.member_id, unit and unit.id or nil, area and area.id or nil, issue and issue.id or nil) + local initiative = Initiative:by_id(param.get("initiative_id", atom.integer)) local contact_members = Member:build_selector{ @@ -10,15 +14,15 @@ }:exec() if area then - title = _"Set delegation for Area '#{name}'":gsub("#{name}", area.name) + title = _("Set delegation for area '#{name}'", { name = area.name }) end if issue then - title = _"Set delegation for Issue ##{number} in Area '#{area_name}'":gsub("#{number}", issue.id):gsub("#{area_name}", issue.area.name) + title = _("Set delegation for issue ##{number} in area '#{area_name}'", { number = issue.id, area_name = issue.area.name }) end if not area and not issue then - title = _"Set unit delegation" + title = _("Set delegation for unit #{name}", { name = unit.name }) end ui.box{ content = function() @@ -30,6 +34,7 @@ module = "delegation", action = "update", params = { + unit_id = unit and unit.id or nil, area_id = area and area.id or nil, issue_id = issue and issue.id or nil, }, @@ -121,12 +126,13 @@ ui.box_row{ content = function() ui.box_col{ content = function() ui.field.select{ - label = _"Trustee", + label = _"Delegate", name = "trustee_id", foreign_records = records, foreign_id = "id", foreign_name = "name", - disabled_records = disabled_records + disabled_records = disabled_records, + value = delegation and delegation.trustee_id or nil } end } end } diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/index.lua --- a/app/main/lf2/index.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/index.lua Sat Mar 12 19:22:50 2011 +0100 @@ -1,9 +1,23 @@ slot.set_layout("lf2") -local current_phase = param.get("phase") -local current_order = param.get("order") +local unit = Unit:by_id(param.get_id()) + +local current_phase = param.get("phase") or "closed" +local current_order = param.get("order") or "last_change" + +if current_phase == "closed" and current_order == "time_left" then + current_order = "last_change" +end + +app.topnav_phase = current_phase +app.topnav_order = current_order +if unit then + app.topnav_unit_id = unit.id +end + local issues_selector = Issue:build_selector{ + unit_id = unit and unit.id or nil, phase = current_phase, order = current_order }:limit(25) @@ -16,7 +30,7 @@ slot.select("sidebar", function() - execute.view{ module = "lf2", view = "_sidebar_unit" } + execute.view{ module = "lf2", view = "_sidebar_unit", params = { unit = unit } } end) execute.view{ module = "lf2", view = "_issues", params = { issues = issues } } diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/initiative.lua --- a/app/main/lf2/initiative.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/initiative.lua Sat Mar 12 19:22:50 2011 +0100 @@ -27,7 +27,8 @@ local support = Supporter:by_pk(initiative.id, app.session.member.id) app.topnav_phase = issue.phase - +app.topnav_area_id = issue.area_id +app.topnav_unit_id = issue.area.unit_id slot.select("sidebar", function() @@ -44,12 +45,12 @@ ui.box{ content = function() - ui.box_row{ class = "initiative head2", content = function() ui.box_col { 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 = "head", content = function() ui.box_col{ content = function() - if initiative.issue.closed then + if initiative.issue.closed then + ui.box_row{ content = function() ui.box_col{ content = function() if initiative.issue.accepted then if initiative.admitted then if initiative.agreed then @@ -65,30 +66,35 @@ else ui.image{ static = "lf2/icon_cross.png" } slot.put(" ") - ui.tag{ content = _"Initiative not approved" } + ui.tag{ content = _"Initiative not approved (no majority)" } end + slot.put(" · ") + ui.tag{ class = "yes_count", content = _("#{count} Yes", { count = initiative.positive_votes }) } + slot.put(" · ") + ui.tag{ class = "no_count", content = _("#{count} No", { count = initiative.negative_votes }) } + slot.put(" · ") + ui.tag{ class = "abstention_count", content = _("#{count} Abstention", { count = initiative.issue.voter_count - initiative.positive_votes - initiative.negative_votes }) } + else ui.image{ static = "lf2/icon_cross.png" } slot.put(" ") - ui.tag{ content = _"Initiative not admitted" } + ui.tag{ content = _"Initiative not admitted (quorum failed)" } end else ui.image{ static = "lf2/icon_cross.png" } slot.put(" ") - ui.tag{ content = _"Issue not accepted" } + ui.tag{ content = _"Issue not accepted (quorum failed)" } end - slot.put(" ") - end - + end } end } + end + + ui.box_row{ class = "", content = function() ui.box_col{ content = function() if initiative.issue.fully_frozen and initiative.issue.closed then if initiative.admitted and initiative.issue.ranks_available then - slot.put(" · ") ui.link{ external = "#votes", text = _("#{vote_count}+#{delegated_weight} votes", { vote_count = #voting_members, delegated_weight = initiative.issue.voter_count - #voting_members }) } + slot.put(" · ") end end - if initiative.issue.closed then - slot.put(" · ") - end ui.link{ external = "#suggestions", text = _("#{suggestion_count} suggestions", { suggestion_count = 23 }) } slot.put(" · ") ui.link{ external = "#supporters", text = _("#{supporter_count}+#{delegated_weight} supporters", { supporter_count = #supporting_members, delegated_weight = initiative.supporter_count - #supporting_members }) } @@ -99,7 +105,7 @@ } } ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Current draft" } end } - ui.box_row{ class = "member_content", content = function() ui.box_col{ content = function() + ui.box_row{ class = "member_content", content = function() ui.box_col{ class = "draft", content = function() execute.view{ module = "lf2", view = "_draft", params = { draft = draft } } end } end } diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/interest.lua --- a/app/main/lf2/interest.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/interest.lua Sat Mar 12 19:22:50 2011 +0100 @@ -90,16 +90,21 @@ end } end } end - ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Statement about issue" } end } - - ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Supported initiatives" } end } - execute.view{ module = "lf2", view = "_initiatives", params = { initiatives = supported_initiatives } } - - ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Incoming delegations" } end } - ui.box_row{ content = function() ui.box_col{ content = function() - execute.view{ module = "lf2", view = "_avatars", params = { members = issue.trusters, size = "small", issue_id = issue.id } } - end } end } - + if statement then + ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Statement about issue" } end } + end + + if #supported_initiatives > 0 then + ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Supported initiatives" } end } + execute.view{ module = "lf2", view = "_initiatives", params = { initiatives = supported_initiatives } } + end + + if #(issue.trusters) > 0 then + ui.box_row{ class = "subhead", content = function() ui.box_col{ class = "head", content = _"Incoming delegations" } end } + ui.box_row{ content = function() ui.box_col{ content = function() + execute.view{ module = "lf2", view = "_avatars", params = { members = issue.trusters, size = "small", issue_id = issue.id } } + end } end } + end end } diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/issue.lua --- a/app/main/lf2/issue.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/app/main/lf2/issue.lua Sat Mar 12 19:22:50 2011 +0100 @@ -12,7 +12,6 @@ local initiatives = issue.initiatives -local interested_members = issue.interested_members local interest = issue.interest @@ -20,7 +19,7 @@ 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") + :join({ "delegation_chain(?, null, ?, ?)", app.session.member_id, not issue.id and area.id or nil, issue.id}, "delegation_chain", "member.id = delegation_chain.member_id") :add_order_by("index") :exec() @@ -43,17 +42,13 @@ app.topnav_area_id = issue.area_id slot.select("sidebar", function() - execute.view{ module = "lf2", view = "_sidebar_unit", params = { current_area_id = issue.area_id } } + execute.view{ module = "lf2", view = "_sidebar_unit", params = { + unit = issue.area.unit, + current_area_id = issue.area_id + } } end) execute.view{ module = "lf2", view = "_area", params = { area = area } } - -execute.view{ module = "lf2", view = "_issues", params = { issues = { issue } } } +execute.view{ module = "lf2", view = "_issue", params = { issue = 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, issue_id = issue.id -} } - diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/settings.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/settings.lua Sat Mar 12 19:22:50 2011 +0100 @@ -0,0 +1,28 @@ +slot.set_layout("lf2") + +slot.put_into("leftright_pre", '') + + +ui.box{ content = function() + ui.box_row{ content = function() + ui.box_col{ content = function() + ui.link{ module = "lf2", view = "settings_password", text = _"Change your password" } + end } + ui.box_col{ content = function() + ui.link{ module = "lf2", view = "settings_name", text = _"Member name" } + end } + ui.box_col{ content = function() + ui.link{ module = "lf2", view = "settings_email", text = _"Change your email address" } + end } + ui.box_col{ content = function() + ui.link{ module = "lf2", view = "settings_privacy", text = _"Privacy settings" } + end } + ui.box_col{ content = function() + ui.link{ module = "lf2", view = "settings_api", text = _"API settings" } + end } + ui.box_col{ content = function() + ui.link{ module = "lf2", view = "settings_", text = _"" } + end } + end } +end } \ No newline at end of file diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 app/main/lf2/units.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/lf2/units.lua Sat Mar 12 19:22:50 2011 +0100 @@ -0,0 +1,15 @@ +slot.set_layout("lf2") + +local units = Unit:new_selector():exec() + +ui.box{ content = function() + ui.box_row{ class = "head", content = function() ui.box_col{ class = "head", content = _"Units" } end } + for i, unit in ipairs(units) do + + ui.box_row{ content = function() ui.box_col{ content = function() + ui.link{ text = unit.name, module = "lf2", view = "unit", id = unit.id } + end } end } + + end + +end } \ No newline at end of file diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 config/development.lua --- a/config/development.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/config/development.lua Sat Mar 12 19:22:50 2011 +0100 @@ -1,4 +1,4 @@ -config.absolute_base_url = "http://10.8.33.34/lf/" +config.absolute_base_url = "http://lqfb/lf/" execute.config("default") diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 env/ui/box_col.lua --- a/env/ui/box_col.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/env/ui/box_col.lua Sat Mar 12 19:22:50 2011 +0100 @@ -1,5 +1,5 @@ function ui.box_col(args) local class = "col" if args.class then class = class .. " " .. args.class end - ui.container{ attr = { class = class }, content = args.content } + ui.container{ attr = { class = class, id = args.id }, content = args.content } end diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 locale/translations.de.lua --- a/locale/translations.de.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/locale/translations.de.lua Sat Mar 12 19:22:50 2011 +0100 @@ -3,15 +3,16 @@ ["##{id}"] = "##{id}"; ["##{issue_id}.#{id} #{name}"] = "##{issue_id}.#{id} #{name}"; ["#{author} at #{date}"] = "#{author} am #{date}"; -["#{direct_count}+#{delegated_count} Mitglieder"] = false; +["#{count} members"] = "#{count} Mitglieder"; +["#{direct_count}+#{delegated_count} members"] = "#{direct_count}+#{delegated_count} Mitglieder"; ["#{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"; +["#{supporter_count}+#{delegated_weight} supporters"] = "#{supporter_count}+#{delegated_weight} Unterstützer"; ["#{time_left} left"] = "noch #{time_left}"; -["#{vote_count} votes"] = "#{vote_count} Stimmzettel"; +["#{vote_count}+#{delegated_weight} votes"] = "#{vote_count}+#{delegated_weight} Stimmen"; ["(#{more_count} duplicates removed)"] = "(#{more_count} Duplikate entfernt)"; ["(change URL)"] = "(URL ändern)"; ["(new window)"] = "(neues Fenster)"; @@ -23,6 +24,8 @@ ["API key has been updated"] = "API-Schlüssel wurde aktualisiert"; ["Abandon global and area delegations for this issue"] = "Globale und Themenbereichs-Delegation für dieses Thema aussetzen"; ["Abandon global delegation for this area"] = "Globale Delegation für diesen Themenbereich aussetzen"; +["Abandon unit and area delegations for this issue"] = "Gliederungs- und Themengebiets-Delegation für dieses Thema aussetzen"; +["Abandon unit delegation for this area"] = "Gliederungs-Delegation für dieses Themengebiet aussetzen"; ["About"] = "About"; ["About / Impressum"] = false; ["About LiquidFeedback"] = "Über LiquidFeedback"; @@ -49,6 +52,8 @@ ["Any"] = "Alle"; ["Apply global delegation for this area (Currently: #{delegate_name} [#{scope}])"] = "Globale Delegation für dieses Themengebiet anwenden (Zur Zeit: #{delegate_name} [#{scope}])"; ["Apply global or area delegation for this issue (Currently: #{delegate_name} [#{scope}])"] = "Globale oder Themengebiets-Delegation für dieses Thema anwenden (Zur Zeit: #{delegate_name} [#{scope}])"; +["Apply unit delegation for this area (Currently: #{delegate_name} [#{scope}])"] = "Gliederungs-Delegation für dieses Themengebiet anwenden(Zur Zeit: #{delegate_name} [#{scope}])"; +["Apply unit or area delegation for this issue (Currently: #{delegate_name} [#{scope}])"] = "Gliederungs- oder Themengebiets-Delegation für dieses Thema anwenden (Currently: #{delegate_name} [#{scope}])"; ["Approval (#th preference) [many entries]"] = "Zustimmung (#.-Wünsche)"; ["Approval (#th preference) [single entry]"] = "Zustimmung (#.-Wunsch)"; ["Approval (first preference) [many entries]"] = "Zustimmung (Erstwünsche)"; @@ -64,12 +69,13 @@ ["Area"] = "Themenbereich"; ["Area '#{name}'"] = "Themenbereich '#{name}'"; ["Area delegation"] = "Delegation für Themenbereich"; +["Area delegation abandoned"] = "Themengebiets-Delegation ausgesetzt"; ["Area delegation active"] = "Delegation für Themenbereich aktiv"; +["Area is delegated"] = "Themengebiet ist delegiert"; ["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:"; +["Areas, you are member of"] = "Deine Themengebiete"; ["Author"] = "Autor"; ["Auto support is now disabled"] = false; ["Auto support is now enabled"] = false; @@ -96,7 +102,6 @@ ["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"; @@ -105,6 +110,9 @@ ["Change issue delegation"] = "Delegation für Thema ändern"; ["Change login"] = "Login ändern"; ["Change name"] = "Name ändern"; +["Change or revoke area delegation"] = "Themengebiets-Delegation ändern"; +["Change or revoke issue delegation"] = "Themen-Delegation ändern"; +["Change or revoke unit delegation"] = "Gliederungs-Delegation ändern"; ["Change order"] = "Sortierung ändern"; ["Change password"] = "Kennwort ändern"; ["Change vote"] = "Abstimmung ändern"; @@ -115,7 +123,7 @@ ["Choose initiator"] = "Initiator auswählen"; ["Choose member"] = "Mitglied auswählen"; ["Click for details"] = "Klicke für Details"; -["Closed"] = "geschlossen"; +["Closed"] = "Geschlossen"; ["Closed since #{date}"] = "Geschlossen seit #{date}"; ["Collective opinion of supporters"] = "Meinungsbild der Unterstützer"; ["Commit suggestion"] = "Anregung speichern"; @@ -145,8 +153,6 @@ ["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"; @@ -210,6 +216,7 @@ ["Generate API key"] = "API-Schlüssel erzeugen"; ["Give up membership"] = "Mitgliedschaft aufgeben"; ["Global delegation"] = "Globale Delegation"; +["Global delegation abandoned"] = "Globale Delegation ausgesetzt"; ["Global delegation active"] = "Globale Delegation aktiv"; ["Go up"] = "Nach oben"; ["Half frozen at"] = "Halb eingefroren am/um"; @@ -239,7 +246,7 @@ ["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 not approved"] = "Initiative nicht angenommen"; ["Initiative quorum"] = "Quorum Inititive"; ["Initiative quorum denumerator"] = "Initiativ-Quorum Zähler"; ["Initiative quorum numerator"] = "Initiativ-Quorum Nenner"; @@ -257,7 +264,6 @@ ["Initiator"] = "Initiator"; ["Initiator invites"] = "Einladungen"; ["Initiators"] = "Initiatoren"; -["Interest"] = "Interesse"; ["Interest not existant"] = "Interesse existiert nicht"; ["Interest removed"] = "Interesse entfernt"; ["Interest updated"] = "Interesse aktualisiert"; @@ -265,7 +271,7 @@ ["Interested members"] = "Interessierte Mitglieder"; ["Internal posts"] = "Interne Ämter"; ["Interval format:"] = "Intervall-Format"; -["Invalid query"] = false; +["Invalid query"] = "Ungültige Anfrage"; ["Invalid username or password!"] = "Ungültiger Benutzername oder Kennwort"; ["Invitation has been refused"] = "Einladung wurde widerrufen"; ["Invite an initiator to initiative"] = "Initiator zur Initiative einladen"; @@ -277,11 +283,13 @@ ["Issue accepted"] = "Thema akzeptiert"; ["Issue canceled"] = "Thema abgebrochen"; ["Issue delegation"] = "Issue-Delegation"; +["Issue delegation abandoned"] = "Themen-Delegation ausgesetzt"; ["Issue delegation active"] = "Delegation für Thema aktiv"; ["Issue events"] = "Themen-Ereignisse"; ["Issue finished"] = "Thema abgeschlossen"; ["Issue finished without voting"] = "Thema ohne Abstimmung abgeschlossen"; ["Issue frozen"] = "Thema eingefroren"; +["Issue is delegated"] = "Thema delegiert"; ["Issue not accepted"] = "Thema nicht zugelassen"; ["Issue policy"] = "Regelwerk für Thema"; ["Issue quorum"] = "Quorum Thema"; @@ -290,7 +298,6 @@ ["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:"; @@ -316,6 +323,8 @@ ["Member is administrator"] = "Mitglied ist Administrator"; ["Member is already saved in your contacts!"] = "Mitglied ist schon in Deinen Kontakten!"; ["Member is deactivated"] = "Mitglied ist deaktiviert"; +["Member is interested in this issue"] = "Mitglied ist an diesem Thema interessiert"; +["Member is not interested"] = "Mitglied ist nicht interessiert"; ["Member is now invited to be initiator"] = "Mitglied ist jetzt als Initiator eingeladen"; ["Member list"] = "Mitgliederliste"; ["Member name"] = "Mitglied Name"; @@ -327,6 +336,7 @@ ["Member voting"] = "Abstimmungsverhalten"; ["Member: '#{login}' (#{name})"] = "Mitlied: '#{login}' (#{name})"; ["Members"] = "Mitglieder"; +["Members, interested in this issue"] = "Am Thema interessierte Mitglieder"; ["Membership by delegation"] = "Mitgliedschaft durch Delegation"; ["Membership not existant"] = "Mitgliedschaft exisitert nicht"; ["Membership removed"] = "Mitgliedschaft entfernt"; @@ -389,6 +399,7 @@ ["Opinions"] = "Meinungen"; ["Order by"] = "Sortieren nach"; ["Organizational unit"] = "Organisationseinheit"; +["Other areas"] = "Andere Themenbereiche"; ["Outgoing delegations"] = "Ausgehende Delegationen"; ["Password"] = "Kennwort"; ["Password (repeat)"] = "Kennwort (wiederholen)"; @@ -412,6 +423,7 @@ ["Please enter your email address. This address will be used for automatic notifications (if you request them) and in case you've lost your password. This address will not be published. After registration you will receive an email with a confirmation link."] = "Bitte gib Deine E-Mail-Adresse ein. Diese Adresse wird für automatische Benachrichtigungen (wenn Du diese anforderst) sowie zum Zurücksetzen des Kennworts verwendet. Diese Adresse wird nicht veröffentlicht. Nach Abschluß der Registration wirst Du eine E-Mail mit einem Link zum Bestätigen der Adresse erhalten."; ["Please enter your login name. You will receive an email with a link to reset your password."] = "Bitte gib Deinen Anmeldenamen ein. Du wirst eine E-Mail mit einem Link zum Zurücksetzen des Kennworts erhalten."; ["Please enter your new password twice."] = "Bitte gib Dein neues Kennwort zweimal ein:"; +["Please note: Member, interest and supporter counts are calculated periodically, therefore it can take some time until your changes become effective everywhere."] = false; ["Policies"] = "Regelwerke"; ["Policy"] = "Regelwerk"; ["Policy '#{name}'"] = "Regelwerk '#{name}'"; @@ -443,10 +455,12 @@ ["Remove from contacts"] = "Aus den Kontakten entfernen"; ["Remove initiator"] = "Initiator entfernen"; ["Remove initiator from initiative"] = "Initiator von der Initiative entfernen"; +["Remove interest"] = "Interesse abmelden"; ["Remove my interest"] = "Interesse abmelden"; ["Remove my membership"] = "Mitgliedschaft aufgeben"; ["Remove my request to vote later"] = "Meinen Wunsch später abzustimmen zurückziehen"; ["Remove my support from this initiative"] = "Meine Unterstützung der Initiative entziehen"; +["Remove support"] = "Unterstützung widerrufen"; ["Rendered"] = "Formatiert"; ["Repeat new password"] = "Neues Kennwort wiederholen"; ["Request password reset link"] = "Link zum Rücksetzen des Kennworts anfordern"; @@ -465,7 +479,7 @@ ["Saved as contact"] = "Als Kontakt gespeichert"; ["Saved contacts"] = "Gespeicherte Kontakte"; ["Search"] = "Suchen"; -["Search in initiatives for text:"] = "In Initiative nach Text suchen:"; +["Search in initiatives"] = "In Initiativen suchen"; ["Search initiatives"] = "Suche Initiativen"; ["Search issues"] = "Suche Themen"; ["Search members"] = "Suche Mitglieder"; @@ -476,9 +490,11 @@ ["Set autoreject"] = "Auto-Ablehnen anschalten"; ["Set delegation for Area '#{name}'"] = "Delegation für Themenbereich '#{name}' festlegen"; ["Set delegation for Issue ##{number} in Area '#{area_name}'"] = "Delegation für Thema ##{number} im Themenbereich '#{area_name}' festlegen"; +["Set delegation for Unit #{name}"] = "Delegation für Glieder #{name} festlegen"; ["Set global delegation"] = "Globale Delegation festlegen"; ["Set issue delegation"] = "Delegation für Thema festlegen"; ["Set new password"] = "Neues Kennwort setzen"; +["Set unit delegation"] = "Gliederungs-Delegation setzen"; ["Settings"] = "Einstellungen"; ["Show"] = "Zeige"; ["Show active members"] = "Zeige aktive Mitglieder"; @@ -499,6 +515,9 @@ ["So I'm"] = "Also bin ich"; ["Software"] = "Software"; ["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."] = "Einige auf JavaScript basierende Funktionen (insbesondere der Abstimmung) sind nicht benutzbar.\nFür diese Beta verwende bitte eine aktuelle Version von Firefox, Safari, Opera(?), Konqueror oder einen anderen (mehr) den Standards entsprechenden Browser.\nEin alternativer Zugriff ohne JavaScript wird bald zur Verfügung stehen."; +["Someone in members delegation chain is interested"] = "In der Delegationskette des Mitglieds ist jemand interessiert"; +["Someone in your delegation chain is interested"] = "Jemand in deiner Delegationskette ist interessiert"; +["Someone in your delegation chain was interested"] = "Jemand in deiner Delegationskette war interessiert"; ["Sorry, but there is not confirmed email address for your account. Please contact the administrator or support."] = "Sorry, aber für diesen Account ist keine bestätigte E-Mail-Adresse hinterlegt. Bitte wende Dich an den Administrator oder den Support."; ["Sorry, but you are currently not invited"] = "Sorry, aber Du bist zur Zeit nicht eingeladen"; ["Sorry, it was not possible to verify your OpenID."] = "Sorry, es war nicht möglich deine OpenID zu verifizieren."; @@ -507,6 +526,7 @@ ["Source"] = "Quelltext"; ["State"] = "Zustand"; ["Statement"] = "Statement"; +["Statement about issue"] = "Statement zum Thema"; ["Status"] = "Status"; ["Step 1/5: Invite code"] = "Schritt 1/5: Invite-Code"; ["Step 2/5: Email address"] = "Schritt 2/5: E-Mail-Adresse"; @@ -540,7 +560,6 @@ ["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!"; @@ -586,6 +605,8 @@ ["Turn on autoreject for issue"] = "Auto-Ablehnen für dieses Thema einschalten"; ["Type of tabs"] = "Tabulatortyp"; ["Unconfirmed address"] = "Unbestätigte E-Mail"; +["Unit wide delegated"] = "Gliederungsweit delegiert"; +["Units"] = "Gliederungen"; ["Unknown author"] = "Unbekannter Autor"; ["Updated drafts"] = "Neue Entwürfe"; ["Upload images"] = "Bilder hochladen"; @@ -598,7 +619,7 @@ ["Voted no"] = "Mit Nein gestimmt"; ["Voted proposal"] = "Abgestimmte Vorlage"; ["Voted yes"] = "Mit Ja gestimmt"; -["Votes"] = "Stimmzettel"; +["Voters"] = "Abstimmende"; ["Voting"] = "Abstimmung"; ["Voting details"] = "Abstimmdetails"; ["Voting for this issue has already begun."] = "Die Abstimmung für dieses Thema hat schon begonnen."; @@ -635,16 +656,12 @@ ["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"; @@ -673,16 +690,6 @@ ["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"; @@ -714,6 +721,10 @@ ["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"; +["unit"] = "Gliederung"; ["until"] = "bis"; ["xmpp"] = "Jabber (XMPP)"; +["↕ Interest"] = "↕ Interesse"; +["↕ Last change"] = "↕ Letzte Änderung"; +["↕ Time left"] = "↕ Restzeit"; } diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 model/area.lua --- a/model/area.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/model/area.lua Sat Mar 12 19:22:50 2011 +0100 @@ -29,6 +29,14 @@ } Area:add_reference{ + mode = 'm1', + to = "Unit", + this_key = 'unit_id', + that_key = 'id', + ref = 'unit', +} + +Area:add_reference{ mode = 'mm', to = "Member", this_key = 'id', @@ -95,6 +103,9 @@ if args.active ~= nil then selector:add_where{ "active = ?", args.active } end + if args.unit_id then + selector:add_where{ "unit_id = ?", args.unit_id } + end if args.member_id then selector:join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ?", args.member_id }) end @@ -102,5 +113,8 @@ 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 + if args.order == "name" then + selector:add_order_by("area.name") + end return selector end diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 model/delegation.lua --- a/model/delegation.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/model/delegation.lua Sat Mar 12 19:22:50 2011 +0100 @@ -33,9 +33,14 @@ ref = 'issue', } -function Delegation:by_pk(truster_id, area_id, issue_id) +function Delegation:by_pk(truster_id, unit_id, area_id, issue_id) local selector = self:new_selector():optional_object_mode() selector:add_where{ "truster_id = ?", truster_id } + if unit_id then + selector:add_where{ "unit_id = ?", unit_id } + else + selector:add_where("unit_id ISNULL") + end if area_id then selector:add_where{ "area_id = ?", area_id } else diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 model/issue.lua --- a/model/issue.lua Mon Mar 07 12:15:22 2011 +0100 +++ b/model/issue.lua Sat Mar 12 19:22:50 2011 +0100 @@ -335,6 +335,10 @@ function Issue:build_selector(args) local selector = self:new_selector() + if args.unit_id then + selector:join("area", nil, "area.id = issue.area_id") + selector:add_where{ "area.unit_id = ?", args.unit_id } + end if args.area_id then selector:add_where{ "issue.area_id = ?", args.area_id } end diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 model/unit.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/model/unit.lua Sat Mar 12 19:22:50 2011 +0100 @@ -0,0 +1,53 @@ +Unit = mondelefant.new_class() +Unit.table = 'unit' + +function Unit:get_flattened_tree() + local units = Unit:new_selector():exec() + local tmp_list = {} + for i, unit in ipairs(units) do + tmp_list[unit.id] = unit + end + + local function get_depth(unit) + local depth + if unit.parent_id then + local parent = tmp_list[unit.parent_id] + depth = get_depth(parent) + 1 + else + depth = 0 + end + return depth + end + + + for i, unit in ipairs(units) do + local depth = get_depth(unit) + local name = "" + for i = 1, depth do + if i < depth then + name = name .. "     " + else + name = name .. "   ‣ " + end + end + unit.flattened_tree_name = name .. unit.name + end + + local function recurse(units) + local list = {} + for i, unit in ipairs(units) do + list[#list+1] = tmp_list[unit.id] + for i, item in ipairs(recurse( + Unit:new_selector() + :add_where{ "parent_id = ?", unit.id }:add_order_by("name"):exec() + )) do + list[#list+1] = tmp_list[item.id] + end + end + return list + end + + local list = recurse(Unit:new_selector():add_where("parent_id ISNULL"):add_order_by("name"):exec()) + + return list +end diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 static/lf2.css --- a/static/lf2.css Mon Mar 07 12:15:22 2011 +0100 +++ b/static/lf2.css Sat Mar 12 19:22:50 2011 +0100 @@ -54,10 +54,13 @@ * Positioning */ -.tab1 .right +.topbox .right { float: right; } -.tab1 a { float: left; } +.topbox a, +.topbox span, +.topbox select + { float: left; } .slot_default { position: relative; width: 67%; } @@ -83,15 +86,19 @@ .box .row .col.right { float: right; } - /* * Margins und paddings */ -.tab1 a - { margin: 0 0 0 0.5em; padding: 0.5ex 0.5em 0.5ex 0.5em; } -.tab1 .right a - { margin: 0 0.5em 0 0; } +.topbox a + { margin: 0 0 0 0.5em; padding: 0.7ex 0.5em 0.3ex 0.5em; } + +.topbox select + { margin: 0.5ex 0 0.5ex 0; padding: 0.3ex 0.2em 0.2ex 0.2em;} + +.topbox .right a, +.topbox .right span + { margin: 0 0.5em 0 0; padding: 0.7ex 0.5em 0.3ex 0.3em; } .slot_default { margin: 2ex 1% 2ex 32%; } @@ -118,18 +125,26 @@ .box .row.subhead .col { margin-top: 2ex; } - /* * Colors */ -body, -.tab1 a.active -/* { background-color: #7df; color: #000 }*/ +body { background-color: #27C9FF; color: #000 } -.tab1, -.tab1 a { background-color: #444; color: #fff; } +.topbox.line1, +.topbox.line1 a, +.topbox.line1 select + { background-color: #444; color: #fff; } + +.topbox.line2, +.topbox.line2 a + { color: #000; } +.topbox.line2 span.inactive + { opacity: 0.2; } +.topbox a.active +/* { background-color: #B2ECFF; color: #000; }*/ + { background-color: #e7f0ff; color: #000; } .box { background-color: #fff; } @@ -141,7 +156,8 @@ .box .row.head, .box .row.head2, .box .row.active - { background-color: #D7F5FF;} +/* { background-color: #D7F5FF;}*/ + { background-color: #e7f0ff;} .box .row.head .col.head { color: #444; } @@ -151,7 +167,7 @@ { color: #777; } .member_content - { background-color: #fec; } + { background-color: #FFF4DC; } /* * Borders @@ -168,13 +184,14 @@ .box.issue .row.unit_name { border-bottom-color: #ccc; } + /* * Rounded corners */ .box { border-radius: 1ex; -moz-border-radius: 1ex; - -webkit-box-shadow: 2px 2px 3px 0px #444; -moz-box-shadow: 2px 2px 3px 0px #444; } + -webkit-box-shadow: 1px 1px 3px #11576F; -moz-box-shadow: 0 0 2px 1px #444; } .box .row:first-child.head, .box .row:first-child.head2 @@ -182,6 +199,19 @@ .box .row:last-child { border-radius: 0 0 1ex 1ex; } +.box .row:first-child:last-child.head, +.box .row:first-child:last-child.head2 + { border-radius: 1ex 1ex 1ex 1ex; } + +.topbox.line1 + { -webkit-box-shadow: 0 2px 3px #444; -moz-box-shadow: 0 2px 3px #444; } + +.topbox a.active + { border-radius: 0 0 1ex 1ex; + -webkit-box-shadow: 1px 1px 3px #11576F, inset 0px 7px 3px -5px #444; + -moz-box-shadow: 2px 2px 3px 0px #444; + } + /* * Text Formatting */ @@ -191,11 +221,15 @@ font-size: 100%; } -.tab1 a { - font-weight: bold; - text-decoration: none; +.topbox { + line-height: 135%; } +.topbox a, +.topbox span + { font-weight: bold; + text-decoration: none; } + .box a { text-decoration: none; } .box .row .col @@ -210,69 +244,8 @@ -/* - * Sidebar hover button - */ - -.hoverbutton_container { - position: relative; -} - - -.hoverbutton { - /* position */ - display: none; - position: absolute; - top: 0px; - left: 0px; - height: 100%; - width: 100%; - - /* color */ - background-color: #fff; - - /* text format */ - font-weight: bold; - - /* cursor */ - cursor: pointer; -} - -.hoverbutton_container:hover .hoverbutton { - /* position */ - display: block; -} - -.hoverbutton_container:hover .hoverbutton img { - /* text format */ - vertical-align: middle; -} - -.hoverbutton_container:hover .hoverbutton.noaction { - /* color */ - background-color: #ccc; - - /* cursor */ - cursor: default; -} - -.hoverbutton_container:hover .hoverbutton.green { - background-color: #cfc; -} - -.hoverbutton_container:hover .hoverbutton.red { - background-color: #fcc; -} - -.hoverbutton .content { - /* position */ - padding: 0.5ex 0.2em 0.5ex 0.5em; -} - -.box .row.last-child .hoverbutton { - border-radius: 0 0 1ex 1ex; -} - +.box .row.head .col.head select + { font-weight: bold; width: 100%; } /* * Scrolled col @@ -331,10 +304,7 @@ .avatars.normal .avatar { width: 100px; - -webkit-box-shadow: 1px 1px 1px #000; - background-color: #eee; - border-radius: 1ex; - -moz-border-radius: 1ex; + text-align: center; } .avatars.small .avatar { @@ -434,10 +404,14 @@ * Draft */ -.initiative .draft { +.member_content .draft { line-height: 135%; } +.draft h1 { + font-size: 135%; +} + .draft h2 { font-size: 135%; font-weight: bold; diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 static/lf2/back.jpg Binary file static/lf2/back.jpg has changed diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 static/lf2/icon_delegation_global.png Binary file static/lf2/icon_delegation_global.png has changed diff -r 4f6e6b213fb8 -r 73dbc9e2bfd4 static/lf2/icon_delegation_unit.png Binary file static/lf2/icon_delegation_unit.png has changed