# HG changeset patch # User jbe # Date 1271945033 -7200 # Node ID f77ca23f9ebdfb4702a745b4d47cc67cc36e3985 # Parent 1d08cf5dca3dc69fdd59ce832ce08ffe903c4772# Parent 7bc629bc1c204ce6d65f7bb5a0c351e1cb8b8200 merge diff -r 1d08cf5dca3d -r f77ca23f9ebd app/main/index/_initiator_invites.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/index/_initiator_invites.lua Thu Apr 22 16:03:53 2010 +0200 @@ -0,0 +1,16 @@ +local initiatives_selector = param.get("initiatives_selector", "table") + +if initiatives_selector:count() > 0 then + ui.container{ + attr = { style = "font-weight: bold;" }, + content = _"Initiatives that invited you to become initiator:" + } + + execute.view{ + module = "initiative", + view = "_list", + params = { initiatives_selector = initiatives_selector } + } +else + ui.field.text{ value = _"You are currently not invited to any initiative." } +end \ No newline at end of file diff -r 1d08cf5dca3d -r f77ca23f9ebd app/main/index/_motd.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/index/_motd.lua Thu Apr 22 16:03:53 2010 +0200 @@ -0,0 +1,15 @@ +local lang = locale.get("lang") +local basepath = request.get_app_basepath() +local file_name = basepath .. "/locale/motd/" .. lang .. ".txt" +local file = io.open(file_name) +if file ~= nil then + local help_text = file:read("*a") + if #help_text > 0 then + ui.container{ + attr = { class = "wiki" }, + content = function() + slot.put(format.wiki_text(help_text)) + end + } + end +end diff -r 1d08cf5dca3d -r f77ca23f9ebd app/main/index/_not_voted_issues.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/index/_not_voted_issues.lua Thu Apr 22 16:03:53 2010 +0200 @@ -0,0 +1,64 @@ +local areas = param.get("areas", "table") + +if #areas > 0 then + ui.container{ + attr = { style = "font-weight: bold;" }, + content = _"Current votings in areas you are member of and issues you are interested in:" + } + + ui.list{ + records = areas, + columns = { + { + name = "name" + }, + { + content = function(record) + if record.is_member and record.issues_to_vote_count > 0 then + ui.link{ + content = function() + if record.issues_to_vote_count > 1 then + slot.put(_("#{issues_to_vote_count} issue(s)", { issues_to_vote_count = record.issues_to_vote_count })) + else + slot.put(_("One issue")) + end + end, + module = "area", + view = "show", + id = record.id, + params = { + filter = "frozen", + filter_voting = "not_voted" + } + } + else + slot.put(_"Not a member") + end + end + }, + { + content = function(record) + if record.interested_issues_to_vote_count > 0 then + ui.link{ + content = function() + if record.interested_issues_to_vote_count > 1 then + slot.put(_("#{interested_issues_to_vote_count} issue(s) you are interested in", { interested_issues_to_vote_count = record.interested_issues_to_vote_count })) + else + slot.put(_"One issue you are interested in") + end + end, + module = "area", + view = "show", + id = record.id, + params = { + filter = "frozen", + filter_interest = "my", + filter_voting = "not_voted" + } + } + end + end + }, + } + } +end diff -r 1d08cf5dca3d -r f77ca23f9ebd app/main/index/_updated_drafts.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/index/_updated_drafts.lua Thu Apr 22 16:03:53 2010 +0200 @@ -0,0 +1,17 @@ +local initiatives_selector = Initiative:new_selector() + :join("issue", "_issue_state", "_issue_state.id = initiative.issue_id AND _issue_state.closed ISNULL AND _issue_state.fully_frozen ISNULL") + :join("current_draft", "_current_draft", "_current_draft.initiative_id = initiative.id") + :join("supporter", "supporter", { "supporter.member_id = ? AND supporter.initiative_id = initiative.id AND supporter.draft_id < _current_draft.id", app.session.member_id }) + +if initiatives_selector:count() > 0 then + ui.container{ + attr = { style = "font-weight: bold;" }, + content = _"Open initiatives you are supporting which has been updated their draft:" + } + + execute.view{ + module = "initiative", + view = "_list", + params = { initiatives_selector = initiatives_selector } + } +end \ No newline at end of file diff -r 1d08cf5dca3d -r f77ca23f9ebd app/main/index/index.lua --- a/app/main/index/index.lua Tue Apr 20 10:19:37 2010 +0200 +++ b/app/main/index/index.lua Thu Apr 22 16:03:53 2010 +0200 @@ -55,7 +55,6 @@ module = "member", view = "edit" } - ui.link{ content = function() ui.image{ static = "icons/16/user_gray.png" } @@ -64,12 +63,10 @@ module = "member", view = "edit_images" } - execute.view{ module = "delegation", view = "_show_box" } - ui.link{ content = function() ui.image{ static = "icons/16/wrench.png" } @@ -78,7 +75,6 @@ module = "member", view = "settings" } - if config.download_dir then ui.link{ content = function() @@ -92,133 +88,13 @@ end end) -local lang = locale.get("lang") -local basepath = request.get_app_basepath() -local file_name = basepath .. "/locale/motd/" .. lang .. ".txt" -local file = io.open(file_name) -if file ~= nil then - local help_text = file:read("*a") - if #help_text > 0 then - ui.container{ - attr = { class = "motd wiki" }, - content = function() - slot.put(format.wiki_text(help_text)) - end - } - end -end - - util.help("index.index", _"Home") -local areas = {} -if app.session.member then - local selector = Area:new_selector() - :reset_fields() - :add_field("area.id", nil, { "grouped" }) - :add_field("area.name", nil, { "grouped" }) - :add_field("membership.member_id NOTNULL", "is_member", { "grouped" }) - :add_field("count(issue.id)", "issues_to_vote_count") - :add_field("count(interest.member_id)", "interested_issues_to_vote_count") - :join("issue", nil, "issue.area_id = area.id AND issue.fully_frozen NOTNULL AND issue.closed ISNULL") - :left_join("direct_voter", nil, { "direct_voter.issue_id = issue.id AND direct_voter.member_id = ?", app.session.member.id }) - :add_where{ "direct_voter.member_id ISNULL" } - :left_join("interest", nil, { "interest.issue_id = issue.id AND interest.member_id = ?", app.session.member.id }) - :left_join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ? ", app.session.member.id }) - - for i, area in ipairs(selector:exec()) do - if area.is_member or area.interested_issues_to_vote_count > 0 then - areas[#areas+1] = area - end - end -end - -if #areas > 0 then - ui.container{ - attr = { style = "font-weight: bold;" }, - content = _"Current votings in areas you are member of and issues you are interested in:" +execute.view{ + module = "member", + view = "_show", + params = { + member = app.session.member, + show_as_homepage = true } - - ui.list{ - records = areas, - columns = { - { - name = "name" - }, - { - content = function(record) - if record.is_member and record.issues_to_vote_count > 0 then - ui.link{ - content = function() - if record.issues_to_vote_count > 1 then - slot.put(_("#{issues_to_vote_count} issue(s)", { issues_to_vote_count = record.issues_to_vote_count })) - else - slot.put(_("One issue")) - end - end, - module = "area", - view = "show", - id = record.id, - params = { - filter = "frozen", - filter_voting = "not_voted" - } - } - else - slot.put(_"Not a member") - end - end - }, - { - content = function(record) - if record.interested_issues_to_vote_count > 0 then - ui.link{ - content = function() - if record.interested_issues_to_vote_count > 1 then - slot.put(_("#{interested_issues_to_vote_count} issue(s) you are interested in", { interested_issues_to_vote_count = record.interested_issues_to_vote_count })) - else - slot.put(_"One issue you are interested in") - end - end, - module = "area", - view = "show", - id = record.id, - params = { - filter = "frozen", - filter_interest = "my", - filter_voting = "not_voted" - } - } - end - end - }, - } - } -end - -local initiatives_selector = Initiative:new_selector() - :join("issue", "_issue_state", "_issue_state.id = initiative.issue_id") - :join("initiator", nil, { "initiator.initiative_id = initiative.id AND initiator.member_id = ? AND initiator.accepted ISNULL", app.session.member.id }) - :add_where("_issue_state.closed ISNULL AND _issue_state.half_frozen ISNULL") - -if initiatives_selector:count() > 0 then - ui.container{ - attr = { style = "font-weight: bold;" }, - content = _"Initiatives that invited you to become initiator:" - } - - execute.view{ - module = "initiative", - view = "_list", - params = { initiatives_selector = initiatives_selector } - } -end - - -if app.session.member then - execute.view{ - module = "member", - view = "_show", - params = { member = app.session.member } - } -end +} diff -r 1d08cf5dca3d -r f77ca23f9ebd app/main/index/show_tab.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/main/index/show_tab.lua Thu Apr 22 16:03:53 2010 +0200 @@ -0,0 +1,72 @@ +local tabs = { + module = "index", + view = "show_tab" +} + +local selector = Area:new_selector() + :reset_fields() + :add_field("area.id", nil, { "grouped" }) + :add_field("area.name", nil, { "grouped" }) + :add_field("membership.member_id NOTNULL", "is_member", { "grouped" }) + :add_field("count(issue.id)", "issues_to_vote_count") + :add_field("count(interest.member_id)", "interested_issues_to_vote_count") + :add_field("count(interest.member_id NOTNULL OR interest.member_id NOTNULL)", "issues_to_vote_count_sum") + :join("issue", nil, "issue.area_id = area.id AND issue.fully_frozen NOTNULL AND issue.closed ISNULL") + :left_join("direct_voter", nil, { "direct_voter.issue_id = issue.id AND direct_voter.member_id = ?", app.session.member.id }) + :add_where{ "direct_voter.member_id ISNULL" } + :left_join("interest", nil, { "interest.issue_id = issue.id AND interest.member_id = ?", app.session.member.id }) + :left_join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ? ", app.session.member.id }) + +local not_voted_areas = {} +local issues_to_vote_count = 0 +for i, area in ipairs(selector:exec()) do + if area.is_member or area.interested_issues_to_vote_count > 0 then + not_voted_areas[#not_voted_areas+1] = area + end + issues_to_vote_count = issues_to_vote_count + area.issues_to_vote_count_sum +end + +tabs[#tabs+1] = { + name = "not_voted_issues", + label = _"Not voted issues" .. " (" .. tostring(issues_to_vote_count) .. ")", + icon = { static = "icons/16/email_open.png" }, + module = "index", + view = "_not_voted_issues", + params = { + areas = not_voted_areas + } +} + +local initiator_invites_selector = Initiative:new_selector() + :join("issue", "_issue_state", "_issue_state.id = initiative.issue_id") + :join("initiator", nil, { "initiator.initiative_id = initiative.id AND initiator.member_id = ? AND initiator.accepted ISNULL", app.session.member.id }) + :add_where("_issue_state.closed ISNULL AND _issue_state.half_frozen ISNULL") + +tabs[#tabs+1] = { + name = "initiator_invites", + label = _"Initiator invites" .. " (" .. tostring(initiator_invites_selector:count()) .. ")", + icon = { static = "icons/16/email_open.png" }, + module = "index", + view = "_initiator_invites", + params = { + initiatives_selector = initiator_invites_selector + } +} + +local updated_drafts_selector = Initiative:new_selector() + :join("issue", "_issue_state", "_issue_state.id = initiative.issue_id AND _issue_state.closed ISNULL AND _issue_state.fully_frozen ISNULL") + :join("current_draft", "_current_draft", "_current_draft.initiative_id = initiative.id") + :join("supporter", "supporter", { "supporter.member_id = ? AND supporter.initiative_id = initiative.id AND supporter.draft_id < _current_draft.id", app.session.member_id }) + +tabs[#tabs+1] = { + name = "updated_drafts", + label = _"Updated drafts" .. " (" .. tostring(updated_drafts_selector:count()) .. ")", + icon = { static = "icons/16/email_open.png" }, + module = "index", + view = "_updated_drafts", + params = { + initiatives_selector = updated_drafts_selector + } +} + +ui.tabs(tabs) \ No newline at end of file diff -r 1d08cf5dca3d -r f77ca23f9ebd app/main/initiative/_list.lua --- a/app/main/initiative/_list.lua Tue Apr 20 10:19:37 2010 +0200 +++ b/app/main/initiative/_list.lua Thu Apr 22 16:03:53 2010 +0200 @@ -9,7 +9,7 @@ if app.session.member_id then initiatives_selector - :left_join("initiator", "_initiator", { "_initiator.initiative_id = initiative.id AND _initiator.member_id = ?", app.session.member.id} ) + :left_join("initiator", "_initiator", { "_initiator.initiative_id = initiative.id AND _initiator.member_id = ? AND _initiator.accepted", app.session.member.id} ) :left_join("supporter", "_supporter", { "_supporter.initiative_id = initiative.id AND _supporter.member_id = ?", app.session.member.id} ) :add_field("(_initiator.member_id NOTNULL)", "is_initiator") diff -r 1d08cf5dca3d -r f77ca23f9ebd app/main/issue/_show_head.lua --- a/app/main/issue/_show_head.lua Tue Apr 20 10:19:37 2010 +0200 +++ b/app/main/issue/_show_head.lua Thu Apr 22 16:03:53 2010 +0200 @@ -102,8 +102,11 @@ -- ui.twitter("http://example.com/t" .. tostring(issue.id)) +if config.public_access_issue_head and not app.session.member_id then + config.public_access_issue_head(issue) +end -if issue.state == 'voting' and not direct_voter then +if app.session.member_id and issue.state == 'voting' and not direct_voter then ui.container{ attr = { class = "voting_active_info" }, content = function() diff -r 1d08cf5dca3d -r f77ca23f9ebd app/main/member/_show.lua --- a/app/main/member/_show.lua Tue Apr 20 10:19:37 2010 +0200 +++ b/app/main/member/_show.lua Thu Apr 22 16:03:53 2010 +0200 @@ -2,6 +2,7 @@ module = "member", view = "show_tab", params = { - member = param.get("member", "table") + member = param.get("member", "table"), + show_as_homepage = param.get("show_as_homepage", atom.boolean) } } \ No newline at end of file diff -r 1d08cf5dca3d -r f77ca23f9ebd app/main/member/show.lua --- a/app/main/member/show.lua Tue Apr 20 10:19:37 2010 +0200 +++ b/app/main/member/show.lua Thu Apr 22 16:03:53 2010 +0200 @@ -13,11 +13,12 @@ slot.put_into("title", encode.html(_"Member '#{member}'":gsub("#{member}", member.name))) -if member.id ~= app.session.member.id then - --TODO performance - local contact = Contact:by_pk(app.session.member.id, member.id) - if contact then - slot.select("actions", function() +slot.select("actions", function() + if member.id == app.session.member.id then + else + --TODO performance + local contact = Contact:by_pk(app.session.member.id, member.id) + if contact then ui.container{ attr = { class = "interest" }, content = _"You have saved this member as contact." @@ -38,9 +39,7 @@ } } } - end) - else - slot.select("actions", function() + else ui.link{ image = { static = "icons/16/book_add.png" }, text = _"Add to my contacts", @@ -57,9 +56,9 @@ } } } - end) + end end -end +end) slot.select("actions", function() ui.link{ diff -r 1d08cf5dca3d -r f77ca23f9ebd app/main/member/show_tab.lua --- a/app/main/member/show_tab.lua Tue Apr 20 10:19:37 2010 +0200 +++ b/app/main/member/show_tab.lua Thu Apr 22 16:03:53 2010 +0200 @@ -1,3 +1,5 @@ +local show_as_homepage = param.get("show_as_homepage", atom.boolean) + local member if request.get_json_request_slots() then @@ -6,84 +8,183 @@ member = param.get("member", "table") end +local tabs = { + module = "member", + view = "show_tab", + static_params = { + member_id = member.id, + show_as_homepage = show_as_homepage + } +} + +if show_as_homepage and app.session.member_id == member.id then + tabs[#tabs+1] = { + class = "yellow", + name = "motd", + label = _"Message of the day", + icon = { static = "icons/16/bell.png" }, + module = "index", + view = "_motd", + params = {} + } + + local selector = Area:new_selector() + :reset_fields() + :add_field("area.id", nil, { "grouped" }) + :add_field("area.name", nil, { "grouped" }) + :add_field("membership.member_id NOTNULL", "is_member", { "grouped" }) + :add_field("count(issue.id)", "issues_to_vote_count") + :add_field("count(interest.member_id)", "interested_issues_to_vote_count") + :add_field("count(interest.member_id NOTNULL OR interest.member_id NOTNULL)", "issues_to_vote_count_sum") + :join("issue", nil, "issue.area_id = area.id AND issue.fully_frozen NOTNULL AND issue.closed ISNULL") + :left_join("direct_voter", nil, { "direct_voter.issue_id = issue.id AND direct_voter.member_id = ?", app.session.member.id }) + :add_where{ "direct_voter.member_id ISNULL" } + :left_join("interest", nil, { "interest.issue_id = issue.id AND interest.member_id = ?", app.session.member.id }) + :left_join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ? ", app.session.member.id }) + + local not_voted_areas = {} + local issues_to_vote_count = 0 + for i, area in ipairs(selector:exec()) do + if area.is_member or area.interested_issues_to_vote_count > 0 then + not_voted_areas[#not_voted_areas+1] = area + end + issues_to_vote_count = issues_to_vote_count + area.issues_to_vote_count_sum + end + + if issues_to_vote_count > 0 then + tabs[#tabs+1] = { + class = "yellow", + name = "not_voted_issues", + label = _"Not voted issues" .. " (" .. tostring(issues_to_vote_count) .. ")", + icon = { static = "icons/16/email_open.png" }, + module = "index", + view = "_not_voted_issues", + params = { + areas = not_voted_areas + } + } + end + + local initiator_invites_selector = Initiative:new_selector() + :join("issue", "_issue_state", "_issue_state.id = initiative.issue_id") + :join("initiator", nil, { "initiator.initiative_id = initiative.id AND initiator.member_id = ? AND initiator.accepted ISNULL", app.session.member.id }) + :add_where("_issue_state.closed ISNULL AND _issue_state.half_frozen ISNULL") + + if initiator_invites_selector:count() > 0 then + tabs[#tabs+1] = { + class = "yellow", + name = "initiator_invites", + label = _"Initiator invites" .. " (" .. tostring(initiator_invites_selector:count()) .. ")", + icon = { static = "icons/16/user_add.png" }, + module = "index", + view = "_initiator_invites", + params = { + initiatives_selector = initiator_invites_selector + } + } + end + + local updated_drafts_selector = Initiative:new_selector() + :join("issue", "_issue_state", "_issue_state.id = initiative.issue_id AND _issue_state.closed ISNULL AND _issue_state.fully_frozen ISNULL") + :join("current_draft", "_current_draft", "_current_draft.initiative_id = initiative.id") + :join("supporter", "supporter", { "supporter.member_id = ? AND supporter.initiative_id = initiative.id AND supporter.draft_id < _current_draft.id", app.session.member_id }) + + if updated_drafts_selector:count() > 0 then + tabs[#tabs+1] = { + class = "yellow", + name = "updated_drafts", + label = _"Updated drafts" .. " (" .. tostring(updated_drafts_selector:count()) .. ")", + icon = { static = "icons/16/script.png" }, + module = "index", + view = "_updated_drafts", + params = { + initiatives_selector = updated_drafts_selector + } + } + end +end + +tabs[#tabs+1] = { + name = "profile", + label = _"Profile", + icon = { static = "icons/16/application_form.png" }, + module = "member", + view = "_profile", + params = { member = member }, +} + local areas_selector = member:get_reference_selector("areas") +tabs[#tabs+1] = { + name = "areas", + label = _"Areas" .. " (" .. tostring(areas_selector:count()) .. ")", + icon = { static = "icons/16/package.png" }, + module = "area", + view = "_list", + params = { areas_selector = areas_selector }, +} + local issues_selector = member:get_reference_selector("issues") +tabs[#tabs+1] = { + name = "issues", + label = _"Issues" .. " (" .. tostring(issues_selector:count()) .. ")", + icon = { static = "icons/16/folder.png" }, + module = "issue", + view = "_list", + params = { issues_selector = issues_selector }, +} + local supported_initiatives_selector = member:get_reference_selector("supported_initiatives") +tabs[#tabs+1] = { + name = "supported_initiatives", + label = _"Supported initiatives" .. " (" .. tostring(supported_initiatives_selector:count()) .. ")", + icon = { static = "icons/16/thumb_up_green.png" }, + module = "initiative", + view = "_list", + params = { initiatives_selector = supported_initiatives_selector }, +} + local initiated_initiatives_selector = member:get_reference_selector("initiated_initiatives"):add_where("initiator.accepted = true") +tabs[#tabs+1] = { + name = "initiatied_initiatives", + label = _"Initiated initiatives" .. " (" .. tostring(initiated_initiatives_selector:count()) .. ")", + icon = { static = "icons/16/user_edit.png" }, + module = "initiative", + view = "_list", + params = { initiatives_selector = initiated_initiatives_selector }, +} + local incoming_delegations_selector = member:get_reference_selector("incoming_delegations") :left_join("issue", "_member_showtab_issue", "_member_showtab_issue.id = delegation.issue_id") :add_where("_member_showtab_issue.closed ISNULL") +tabs[#tabs+1] = { + name = "incoming_delegations", + label = _"Incoming delegations" .. " (" .. tostring(incoming_delegations_selector:count()) .. ")", + icon = { static = "icons/16/table_go.png" }, + module = "delegation", + view = "_list", + params = { delegations_selector = incoming_delegations_selector, incoming = true }, +} + local outgoing_delegations_selector = member:get_reference_selector("outgoing_delegations") :left_join("issue", "_member_showtab_issue", "_member_showtab_issue.id = delegation.issue_id") :add_where("_member_showtab_issue.closed ISNULL") -local contacts_selector = member:get_reference_selector("saved_members"):add_where("public") +tabs[#tabs+1] = { + name = "outgoing_delegations", + label = _"Outgoing delegations" .. " (" .. tostring(outgoing_delegations_selector:count()) .. ")", + icon = { static = "icons/16/table_go.png" }, + module = "delegation", + view = "_list", + params = { delegations_selector = outgoing_delegations_selector, outgoing = true }, +} -ui.tabs{ +local contacts_selector = member:get_reference_selector("saved_members"):add_where("public") +tabs[#tabs+1] = { + name = "contacts", + label = _"Contacts" .. " (" .. tostring(contacts_selector:count()) .. ")", + icon = { static = "icons/16/book_edit.png" }, module = "member", - view = "show_tab", - static_params = { member_id = member.id }, - { - name = "profile", - label = _"Profile", - icon = { static = "icons/16/application_form.png" }, - module = "member", - view = "_profile", - params = { member = member }, - }, - { - name = "areas", - label = _"Areas" .. " (" .. tostring(areas_selector:count()) .. ")", - icon = { static = "icons/16/package.png" }, - module = "area", - view = "_list", - params = { areas_selector = areas_selector }, - }, - { - name = "issues", - label = _"Issues" .. " (" .. tostring(issues_selector:count()) .. ")", - icon = { static = "icons/16/folder.png" }, - module = "issue", - view = "_list", - params = { issues_selector = issues_selector }, - }, - { - name = "supported_initiatives", - label = _"Supported initiatives" .. " (" .. tostring(supported_initiatives_selector:count()) .. ")", - icon = { static = "icons/16/thumb_up_green.png" }, - module = "initiative", - view = "_list", - params = { initiatives_selector = supported_initiatives_selector }, - }, - { - name = "initiatied_initiatives", - label = _"Initiated initiatives" .. " (" .. tostring(initiated_initiatives_selector:count()) .. ")", - icon = { static = "icons/16/user_edit.png" }, - module = "initiative", - view = "_list", - params = { initiatives_selector = initiated_initiatives_selector }, - }, - { - name = "incoming_delegations", - label = _"Incoming delegations" .. " (" .. tostring(incoming_delegations_selector:count()) .. ")", - icon = { static = "icons/16/table_go.png" }, - module = "delegation", - view = "_list", - params = { delegations_selector = incoming_delegations_selector, incoming = true }, - }, - { - name = "outgoing_delegations", - label = _"Outgoing delegations" .. " (" .. tostring(outgoing_delegations_selector:count()) .. ")", - icon = { static = "icons/16/table_go.png" }, - module = "delegation", - view = "_list", - params = { delegations_selector = outgoing_delegations_selector, outgoing = true }, - }, - { - name = "contacts", - label = _"Contacts" .. " (" .. tostring(contacts_selector:count()) .. ")", - icon = { static = "icons/16/book_edit.png" }, - module = "member", - view = "_list", - params = { members_selector = contacts_selector }, - } + view = "_list", + params = { members_selector = contacts_selector }, } + +ui.tabs(tabs) \ No newline at end of file diff -r 1d08cf5dca3d -r f77ca23f9ebd config/default.lua --- a/config/default.lua Tue Apr 20 10:19:37 2010 +0200 +++ b/config/default.lua Thu Apr 22 16:03:53 2010 +0200 @@ -1,5 +1,5 @@ config.app_name = "LiquidFeedback" -config.app_version = "beta16" +config.app_version = "beta17" config.app_title = config.app_name .. " (" .. request.get_config_name() .. " environment)" diff -r 1d08cf5dca3d -r f77ca23f9ebd env/ui/tabs.lua --- a/env/ui/tabs.lua Tue Apr 20 10:19:37 2010 +0200 +++ b/env/ui/tabs.lua Thu Apr 22 16:03:53 2010 +0200 @@ -77,9 +77,9 @@ attr = { name = "tab_" .. tab.name, class = ( - tab.name == current_tab and "ui_tabs_accordeon_head selected" or - not current_tab and i == 1 and "ui_tabs_accordeon_head selected" or - "ui_tabs_accordeon_head" + tab.name == current_tab and "ui_tabs_accordeon_head selected" .. (tab.class and (" " .. tab.class) or "") or + not current_tab and i == 1 and "ui_tabs_accordeon_head selected" .. (tab.class and (" " .. tab.class) or "") or + "ui_tabs_accordeon_head" .. (tab.class and (" " .. tab.class) or "") ), id = "tab" .. unique_string .. "_head_" .. tab.name, onclick = onclick, @@ -105,7 +105,7 @@ local expanded = active or not request.get_json_request_slots() and config.user_tab_mode == "accordeon_all_expanded" and not current_tabs_string ui.container{ attr = { - class = "ui_tabs_accordeon_content", + class = "ui_tabs_accordeon_content" .. (tab.class and (" " .. tab.class) or ""), style = not expanded and "display: none;" or nil, id = "tab" .. unique_string .. "_content_" .. tab.name }, @@ -198,9 +198,9 @@ ui.link{ attr = { class = ( - tab.name == current_tab and "selected" or - not current_tab and i == 1 and "selected" or - "" + tab.name == current_tab and "selected" .. (tab.class and (" " .. tab.class) or "") or + not current_tab and i == 1 and "selected" .. (tab.class and (" " .. tab.class) or "") or + "" .. (tab.class and (" " .. tab.class) or "") ) }, module = request.get_module(), diff -r 1d08cf5dca3d -r f77ca23f9ebd static/icons/16/bell.png Binary file static/icons/16/bell.png has changed diff -r 1d08cf5dca3d -r f77ca23f9ebd static/style.css --- a/static/style.css Tue Apr 20 10:19:37 2010 +0200 +++ b/static/style.css Thu Apr 22 16:03:53 2010 +0200 @@ -503,7 +503,32 @@ font-size: 120%; } +.ui_tabs_links a.yellow { + background-color: #fec; + color: #000; +} +.ui_tabs_links a.yellow:hover { + background-color: #edb; +} + +.ui_tabs_links a.yellow.selected { + background-color: #654; + color: #fff; + text-decoration: none; + padding: 1ex; +} + +.web20 .ui_tabs_accordeon_head.yellow { + background-color: #fec; + border-color: #b96; + xpadding: 1ex; + xmargin-bottom: 2ex; +} + +.web20 .ui_tabs_accordeon_content.yellow { + border-color: #b96; +} /************************************************************************* * ui.filters @@ -955,7 +980,8 @@ .draft_updated_info, .voting_active_info, .initiator_invite_info, -.motd { +.motd, +.public_access_issue_head { background-color: #fec; border: 1px solid #b96; padding: 1ex;