# HG changeset patch
# User bsw
# Date 1328723362 -3600
# Node ID 7196685f9dd71b2e8bc5152103a68e8fde6405cc
# Parent 65a1f7a01e7bcc59b6ba3599b2f5650359896a4e
More optical enhancements, more repositioning
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/_filter_view/30_navigation.lua
--- a/app/main/_filter_view/30_navigation.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/_filter_view/30_navigation.lua Wed Feb 08 18:49:22 2012 +0100
@@ -4,7 +4,7 @@
if app.session.member then
ui.link{
- image = { static = "icons/16/house.png" },
+-- image = { static = "icons/16/house.png" },
text = _"Home",
module = 'index',
view = 'index'
@@ -15,14 +15,14 @@
if not config.single_unit_id then
ui.link{
- image = { static = "icons/16/package.png" },
+-- image = { static = "icons/16/package.png" },
text = _"Units",
module = 'unit',
view = 'list'
}
else
ui.link{
- image = { static = "icons/16/package.png" },
+-- image = { static = "icons/16/package.png" },
text = _"Areas",
module = 'area',
view = 'list'
@@ -32,7 +32,7 @@
if app.session.member == nil then
ui.link{
- image = { static = "icons/16/key.png" },
+-- image = { static = "icons/16/key.png" },
text = _"Login",
module = 'index',
view = 'login',
@@ -43,19 +43,19 @@
}
}
ui.link{
- image = { static = "icons/16/book_edit.png" },
+-- image = { static = "icons/16/book_edit.png" },
text = _"Registration",
module = 'index',
view = 'register'
}
ui.link{
- image = { static = "icons/16/key_forgot.png" },
+-- image = { static = "icons/16/key_forgot.png" },
text = _"Reset password",
module = 'index',
view = 'reset_password'
}
ui.link{
- image = { static = "icons/16/information.png" },
+-- image = { static = "icons/16/information.png" },
text = _"About / Impressum",
module = 'index',
view = 'about'
@@ -63,14 +63,14 @@
else
ui.link{
- image = { static = "icons/16/time.png" },
+-- image = { static = "icons/16/time.png" },
text = _"Timeline",
module = "timeline",
view = "index"
}
ui.link{
- image = { static = "icons/16/group.png" },
+-- image = { static = "icons/16/group.png" },
text = _"Members",
module = 'member',
view = 'list',
@@ -78,14 +78,20 @@
}
ui.link{
- image = { static = "icons/16/book_edit.png" },
+-- image = { static = "icons/16/book_edit.png" },
text = _"Contacts",
module = 'contact',
view = 'list'
}
ui.link{
- image = { static = "icons/16/information.png" },
+ text = (_"Settings"),
+ module = "member",
+ view = "settings"
+ }
+
+ ui.link{
+-- image = { static = "icons/16/information.png" },
text = _"About",
module = 'index',
view = 'about'
@@ -97,7 +103,7 @@
ui.link{
attr = { class = { "admin_only" } },
- image = { static = "icons/16/cog.png" },
+-- image = { static = "icons/16/cog.png" },
text = _"Admin",
module = 'admin',
view = 'index'
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/_filter_view/31_logout_button.lua
--- a/app/main/_filter_view/31_logout_button.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/_filter_view/31_logout_button.lua Wed Feb 08 18:49:22 2012 +0100
@@ -5,7 +5,7 @@
slot.select('logout_button', function()
ui.link{
- image = { static = "icons/16/stop.png" },
+-- image = { static = "icons/16/stop.png" },
text = _"Logout",
module = 'index',
action = 'logout',
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/_layout/default.html
--- a/app/main/_layout/default.html Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/_layout/default.html Wed Feb 08 18:49:22 2012 +0100
@@ -56,7 +56,6 @@
-
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/area/list.lua
--- a/app/main/area/list.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/area/list.lua Wed Feb 08 18:49:22 2012 +0100
@@ -1,6 +1,7 @@
local unit_id = config.single_unit_id or param.get("unit_id", atom.integer)
local areas_selector = Area:build_selector{ active = true, unit_id = unit_id }
+areas_selector:add_order_by("member_weight DESC")
local unit = Unit:by_id(unit_id)
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/area/show_tab.lua
--- a/app/main/area/show_tab.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/area/show_tab.lua Wed Feb 08 18:49:22 2012 +0100
@@ -20,7 +20,8 @@
params = {
issues_selector = issues_selector,
filter = cgi.params["filter"],
- filter_voting = param.get("filter_voting")
+ filter_voting = param.get("filter_voting"),
+ for_area_list = true
}
}
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/delegation/_show_box.lua
--- a/app/main/delegation/_show_box.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/delegation/_show_box.lua Wed Feb 08 18:49:22 2012 +0100
@@ -71,6 +71,8 @@
unit_id = param.get("unit_id", atom.integer)
+local inline = param.get("inline", atom.boolean)
+
if param.get("initiative_id", atom.integer) then
initiative_id = param.get("initiative_id", atom.integer)
issue_id = Initiative:by_id(initiative_id).issue_id
@@ -98,16 +100,28 @@
if not delegation then
delegation = Delegation:by_pk(app.session.member.id, nil, issue.area_id)
end
+ if not delegation then
+ delegation = Delegation:by_pk(app.session.member.id, issue.area.unit_id)
+ end
elseif area_id then
delegation = Delegation:by_pk(app.session.member.id, nil, area_id)
+ if not delegation then
+ local area = Area:by_id(area_id)
+ delegation = Delegation:by_pk(app.session.member.id, area.unit_id)
+ end
end
if not delegation then
delegation = Delegation:by_pk(app.session.member.id, unit_id)
end
+local slot_name = "actions"
-slot.select("actions", function()
+if inline then
+ slot_name = "default"
+end
+
+slot.select(slot_name, function()
if delegation then
ui.container{
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/delegation/new.lua
--- a/app/main/delegation/new.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/delegation/new.lua Wed Feb 08 18:49:22 2012 +0100
@@ -69,9 +69,10 @@
routing = {
default = {
mode = "redirect",
- module = area and "area" or issue and "issue" or "index",
- view = (area or issue) and "show" or "index",
+ module = area and "area" or issue and "issue" or "area",
+ view = (area or issue) and "show" or "list",
id = area and area.id or issue and issue.id or nil,
+ params = { unit_id = unit and unit.id or nil }
}
},
content = function()
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/index/index.lua
--- a/app/main/index/index.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/index/index.lua Wed Feb 08 18:49:22 2012 +0100
@@ -45,50 +45,10 @@
slot.put_into("title", encode.html(config.app_title))
if app.session.member then
- app.html_title.title = app.session.member.name
+ app.html_title.title = app.session.member.name
end
-slot.select("actions", function()
-
- if app.session.member then
- ui.link{
- content = function()
- ui.image{ static = "icons/16/application_form.png" }
- slot.put(_"Edit my profile")
- end,
- module = "member",
- view = "edit"
- }
- ui.link{
- content = function()
- ui.image{ static = "icons/16/user_gray.png" }
- slot.put(_"Upload images")
- end,
- module = "member",
- view = "edit_images"
- }
- ui.link{
- content = function()
- ui.image{ static = "icons/16/wrench.png" }
- slot.put(_"Settings")
- end,
- module = "member",
- view = "settings"
- }
- if config.download_dir then
- ui.link{
- content = function()
- ui.image{ static = "icons/16/database_save.png" }
- slot.put(_"Download")
- end,
- module = "index",
- view = "download"
- }
- end
- end
-end)
-
util.help("index.index", _"Home")
execute.view{
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/initiative/_list_element.lua
--- a/app/main/initiative/_list_element.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/initiative/_list_element.lua Wed Feb 08 18:49:22 2012 +0100
@@ -65,7 +65,7 @@
records = { { a = 1} },
columns = {
{
- field_attr = { style = "width: 4em; padding: 0;"},
+ field_attr = { style = "width: 3em; padding: 0; text-align: center;"},
content = function()
if initiative.issue.accepted and initiative.issue.closed and initiative.issue.ranks_available or initiative.admitted == false then
ui.field.rank{ image_attr = { id = icon_name }, attr = { class = "rank" }, value = initiative.rank }
@@ -107,8 +107,8 @@
else
slot.put(_"Counting of votes")
end
- elseif initiative.issue.population then
- local max_value = initiative.issue.population
+ else
+ local max_value = initiative.issue.population or 0
ui.bargraph{
max_value = max_value,
width = 100,
@@ -120,8 +120,6 @@
{ color = "#eee", value = max_value - (initiative.supporter_count or 0) },
}
}
- else
- slot.put(" ")
end
end
},
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/initiative/_show.lua
--- a/app/main/initiative/_show.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/initiative/_show.lua Wed Feb 08 18:49:22 2012 +0100
@@ -274,52 +274,6 @@
}
end
-if (initiative.discussion_url and #initiative.discussion_url > 0)
- or (initiator and initiator.accepted and not initiative.issue.half_frozen and not initiative.issue.closed and not initiative.revoked) then
- ui.container{
- attr = { class = "vertical" },
- content = function()
- ui.container{
- attr = { class = "ui_field_label" },
- content = _"Discussion with initiators"
- }
- ui.tag{
- tag = "span",
- content = function()
- if initiative.discussion_url:find("^https?://") then
- if initiative.discussion_url and #initiative.discussion_url > 0 then
- ui.link{
- attr = {
- class = "actions",
- target = "_blank",
- title = initiative.discussion_url
- },
- content = function()
- slot.put(encode.html(initiative.discussion_url))
- end,
- external = initiative.discussion_url
- }
- end
- else
- slot.put(encode.html(initiative.discussion_url))
- end
- slot.put(" ")
- if initiator and initiator.accepted and not initiative.issue.half_frozen and not initiative.issue.closed and not initiative.revoked then
- ui.link{
- attr = { class = "actions" },
- text = _"(change URL)",
- module = "initiative",
- view = "edit",
- id = initiative.id
- }
- end
- end
- }
- end
- }
-end
-
-
execute.view{
module = "initiative",
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/initiative/show_support.lua
--- a/app/main/initiative/show_support.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/initiative/show_support.lua Wed Feb 08 18:49:22 2012 +0100
@@ -9,21 +9,107 @@
id = initiative.id,
target = "initiative_" .. tostring(initiative.id) .. "_support",
content = function()
+
ui.container{
- attr = {
- class = "slot_support vote_info",
- },
+ attr = { class = "actions" },
content = function()
- ui.container{
- attr = { class = "actions" },
- content = function()
- execute.view{
- module = "supporter",
- view = "_show_box",
- params = { initiative = initiative }
+
+ local initiative = param.get("initiative", "table")
+ local supporter = Supporter:by_pk(initiative.id, app.session.member.id)
+
+ local unique_string = multirand.string(16, '0123456789abcdef')
+
+
+ local partial = {
+ routing = {
+ default = {
+ mode = "redirect",
+ module = "initiative",
+ view = "show_support",
+ id = initiative.id
}
+ }
+ }
+
+ local routing = {
+ default = {
+ mode = "redirect",
+ module = request.get_module(),
+ view = request.get_view(),
+ id = param.get_id_cgi(),
+ params = param.get_all_cgi()
+ }
+ }
+
+ if not initiative.issue.fully_frozen and not initiative.issue.closed then
+ if supporter then
+ if not supporter:has_critical_opinion() then
+ ui.tag{ content = function()
+ ui.image{
+ static = "icons/16/thumb_up_green.png"
+ }
+ slot.put(_"Your are supporter")
+ end }
+ else
+ ui.tag{ content = function()
+ ui.image{
+ static = "icons/16/thumb_up.png"
+ }
+ slot.put(_"Your are potential supporter")
+ end }
+ end
+ slot.put(" · ")
+ ui.link{
+ text = _"Remove my support from this initiative",
+ module = "initiative",
+ action = "remove_support",
+ id = initiative.id,
+ routing = routing,
+ partial = partial
+ }
+ else
+
+ if not initiative.revoked then
+ local params = param.get_all_cgi()
+ params.dyn = nil
+ ui.link{
+ text = _"Support this initiative",
+ module = "initiative",
+ action = "add_support",
+ id = initiative.id,
+ routing = routing,
+ partial = partial
+ }
+ end
end
- }
+ end
+
+
+ if (initiative.discussion_url and #initiative.discussion_url > 0) then
+ if initiative.discussion_url:find("^https?://") then
+ if initiative.discussion_url and #initiative.discussion_url > 0 then
+ ui.link{
+ attr = {
+ target = "_blank",
+ title = _"Discussion with initiators"
+ },
+ image = { static = "icons/16/comments.png" },
+ text = _"Discuss with initiators",
+ external = initiative.discussion_url
+ }
+ end
+ else
+ slot.put(encode.html(initiative.discussion_url))
+ end
+ end
+ if initiator and initiator.accepted and not initiative.issue.half_frozen and not initiative.issue.closed and not initiative.revoked then
+ ui.link{
+ text = _"change discussion URL",
+ module = "initiative",
+ view = "edit",
+ id = initiative.id
+ }
+ end
end
}
slot.put("
")
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/issue/_list.lua
--- a/app/main/issue/_list.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/issue/_list.lua Wed Feb 08 18:49:22 2012 +0100
@@ -28,66 +28,65 @@
local highlight_string = param.get("highlight_string", "string")
local issues = issues or issues_selector:exec()
-- issues:load(initiatives)
- ui.list{
- attr = { class = "issues" },
- records = issues,
- columns = {
- {
- label = _"Issue",
- content = function(record)
- if not param.get("for_area_list", atom.boolean) then
- ui.field.text{
- value = record.area.name
- }
- slot.put("
")
- end
- if record.is_interested then
- local label = _"You are interested in this issue",
- ui.image{
- attr = { alt = label, title = label },
- static = "icons/16/eye.png"
- }
- slot.put(" ")
- end
- ui.link{
- text = _("Issue ##{id}", { id = tostring(record.id) }),
- module = "issue",
- view = "show",
- id = record.id
+ ui.container{ attr = { class = "issues" }, content = function()
+
+ for i, issue in ipairs(issues) do
+
+ local class = "issue"
+ if issue.is_interested then
+ class = class .. " interested"
+ end
+ ui.container{ attr = { class = class }, content = function()
+
+ ui.container{ attr = { class = "issue_info" }, content = function()
+
+ ui.tag{
+ tag = "div",
+ content = function()
+ ui.link{
+ attr = { class = "issue_id" },
+ text = _("Issue ##{id}", { id = tostring(issue.id) }),
+ module = "issue",
+ view = "show",
+ id = issue.id
+ }
+
+-- if not param.get("for_area_list", atom.boolean) then
+ slot.put(" · ")
+ ui.tag{ content = issue.area.unit.name }
+ slot.put(" · ")
+ ui.tag{ content = issue.area.name }
+-- end
+ end
}
- if record.state == "new" then
- ui.image{
- static = "icons/16/new.png"
- }
- end
- slot.put("
")
- slot.put("
")
- if record.old_state then
- ui.field.text{ value = format.time(record.sort) }
- ui.field.text{ value = Issue:get_state_name_for_state(record.old_state) .. " > " .. Issue:get_state_name_for_state(record.new_state) }
+ ui.tag{
+ tag = "div",
+ content = function()
+
+ ui.tag{ content = issue.policy.name }
+
+ slot.put(" · ")
+ ui.tag{ content = issue.state_name }
+
+ if issue.state_time_left then
+ slot.put(" · ")
+ ui.tag{ content = _("#{time_left} left", { time_left = issue.state_time_left }) }
+ end
+
+ end
+ }
+
+
+ if issue.old_state then
+ ui.field.text{ value = format.time(issue.sort) }
+ ui.field.text{ value = Issue:get_state_name_for_state(issue.old_state) .. " > " .. Issue:get_state_name_for_state(issue.new_state) }
else
end
- end
- },
- {
- label = _"State",
- content = function(record)
- if record.state == "voting" then
- ui.link{
- content = _"Voting",
- module = "vote",
- view = "list",
- params = { issue_id = record.id }
- }
- else
- ui.field.issue_state{ value = record.state }
- end
- end
- },
- {
- label = _"Initiatives",
- content = function(record)
- local initiatives_selector = record:get_reference_selector("initiatives")
+ end }
+
+ ui.container{ attr = { class = "initiative_list" }, content = function()
+
+ local initiatives_selector = issue:get_reference_selector("initiatives")
local highlight_string = param.get("highlight_string")
if highlight_string then
initiatives_selector:add_field( {'"highlight"("initiative"."name", ?)', highlight_string }, "name_highlighted")
@@ -96,7 +95,7 @@
module = "initiative",
view = "_list",
params = {
- issue = record,
+ issue = issue,
initiatives_selector = initiatives_selector,
highlight_string = highlight_string,
per_page = app.session.member_id and tonumber(app.session.member:get_setting_value("initiatives_preview_limit") or 3) or 3,
@@ -104,10 +103,10 @@
limit = app.session.member_id and tonumber(app.session.member:get_setting_value("initiatives_preview_limit") or 3) or 3
}
}
- end
- },
- }
- }
+ end }
+ end }
+ end
+ end }
end
}
end
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/issue/_list_initiatives.lua
--- a/app/main/issue/_list_initiatives.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/issue/_list_initiatives.lua Wed Feb 08 18:49:22 2012 +0100
@@ -1,10 +1,21 @@
local issue = param.get("issue", "table")
-execute.view{
- module = "initiative",
- view = "_list",
- params = {
- issue = issue,
- initiatives_selector = issue:get_reference_selector("initiatives")
- }
+ui.container{
+ attr = { class = "issue_initiative_list" },
+ content = function()
+ execute.view{
+ module = "initiative",
+ view = "_list",
+ params = {
+ initiatives_selector = issue:get_reference_selector("initiatives"),
+ issue = issue,
+ expandable = true,
+ for_initiative_id = param.get("for_initiative_id", atom.number),
+ xshow_for_issue = true,
+ no_sort = true
+ }
+ }
+ end
}
+
+slot.put("
")
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/issue/_show_head.lua
--- a/app/main/issue/_show_head.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/issue/_show_head.lua Wed Feb 08 18:49:22 2012 +0100
@@ -22,7 +22,7 @@
view = "show",
id = issue.id
}
- slot.put(" · ")
+ slot.put(" · ")
ui.link{
content = issue.area.name,
module = "area",
@@ -69,16 +69,14 @@
slot.put(" · ")
ui.tag{ content = issue.state_name }
- slot.put(" · ")
- local time_left = issue.state_time_left
- if time_left then
- ui.tag{ content = _("#{time_left} left", { time_left = time_left }) }
+ if issue.state_time_left then
+ slot.put(" · ")
+ ui.tag{ content = _("#{time_left} left", { time_left = issue.state_time_left }) }
end
- slot.put(" · ")
- local next_state_names = issue.next_states_names
- if next_state_names then
- ui.tag{ content = _("Next state: #{state}", { state = next_state_names }) }
+ if issue.next_states_names then
+ slot.put(" · ")
+ ui.tag{ content = _("Next state: #{state}", { state = issue.next_states_names }) }
end
end
}
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/issue/show.lua
--- a/app/main/issue/show.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/issue/show.lua Wed Feb 08 18:49:22 2012 +0100
@@ -36,24 +36,6 @@
}
end
-ui.container{
- attr = { class = "issue_initiative_list" },
- content = function()
- execute.view{
- module = "initiative",
- view = "_list",
- params = {
- initiatives_selector = issue:get_reference_selector("initiatives"),
- issue = issue,
- expandable = true,
- for_initiative_id = param.get("for_initiative_id", atom.number),
- show_for_issue = true
- }
- }
- end
-}
-
-slot.put("
")
execute.view{
module = "issue",
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/issue/show_tab.lua
--- a/app/main/issue/show_tab.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/issue/show_tab.lua Wed Feb 08 18:49:22 2012 +0100
@@ -18,6 +18,19 @@
static_params = { issue_id = issue.id },
}
+tabs[#tabs+1] =
+ {
+ name = "initiatives",
+ label = _"Initiatives",
+ icon = { static = "icons/16/script.png" },
+ module = "issue",
+ view = "_list_initiatives",
+ params = {
+ issue = issue
+ }
+ }
+
+
if app.session.member_id then
tabs[#tabs+1] =
{
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/member/_area_list.lua
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/app/main/member/_area_list.lua Wed Feb 08 18:49:22 2012 +0100
@@ -0,0 +1,18 @@
+local units = app.session.member.units_with_voting_right
+local member = param.get("member", "table")
+for i, unit in ipairs(units) do
+ local areas_selector = Area:new_selector()
+ :join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ?", member.id })
+ :add_where{ "area.unit_id = ?", unit.id }
+ :add_order_by("area.member_weight DESC")
+ ui.link{
+ text = unit.name,
+ module = "area", view = "list", params = { unit_id = unit.id }
+ }
+
+ execute.view{
+ module = "area", view = "_list",
+ params = { areas_selector = areas_selector },
+ }
+end
+
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/member/_profile.lua
--- a/app/main/member/_profile.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/member/_profile.lua Wed Feb 08 18:49:22 2012 +0100
@@ -7,6 +7,41 @@
end
end
+--slot.select("actions", function()
+
+ if app.session.member and app.session.member_id == member.id then
+ ui.link{
+ attr = { class = "actions" },
+ content = function()
+ ui.image{ static = "icons/16/application_form.png" }
+ slot.put(_"Edit my profile")
+ end,
+ module = "member",
+ view = "edit"
+ }
+ ui.link{
+ attr = { class = "actions" },
+ content = function()
+ ui.image{ static = "icons/16/user_gray.png" }
+ slot.put(_"Upload images")
+ end,
+ module = "member",
+ view = "edit_images"
+ }
+ if config.download_dir then
+ ui.link{
+ attr = { class = "actions" },
+ content = function()
+ ui.image{ static = "icons/16/database_save.png" }
+ slot.put(_"Download")
+ end,
+ module = "index",
+ view = "download"
+ }
+ end
+ slot.put("
")
+ end
+--end)
ui.form{
attr = { class = "member vertical" },
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/member/settings.lua
--- a/app/main/member/settings.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/member/settings.lua Wed Feb 08 18:49:22 2012 +0100
@@ -17,12 +17,14 @@
}
local pages = {
- { view = "settings_display", text = _"Display settings" },
- { view = "settings_email", text = _"Change your notification email address" },
- { view = "settings_name", text = _"Change your name" },
- { view = "settings_login", text = _"Change your login" },
- { view = "settings_password", text = _"Change your password" },
- { view = "developer_settings", text = _"Developer settings" },
+ { module = "member", view = "edit", text = _"Edit profile" },
+ { module = "member", view = "edit_images", text = _"Upload images" },
+ { view = "settings_display", text = _"Display settings" },
+ { view = "settings_email", text = _"Change your notification email address" },
+ { view = "settings_name", text = _"Change your name" },
+ { view = "settings_login", text = _"Change your login" },
+ { view = "settings_password", text = _"Change your password" },
+ { view = "developer_settings", text = _"Developer settings" },
}
ui.list{
@@ -33,7 +35,7 @@
{
content = function(page)
ui.link{
- module = "member",
+ module = page.module or "member",
view = page.view,
text = page.text
}
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/member/show_tab.lua
--- a/app/main/member/show_tab.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/member/show_tab.lua Wed Feb 08 18:49:22 2012 +0100
@@ -140,29 +140,31 @@
end
end
-tabs[#tabs+1] = {
- name = "profile",
- label = _"Profile",
- icon = { static = "icons/16/application_form.png" },
- module = "member",
- view = "_profile",
- params = { member = member },
-}
+if not show_as_homepage then
+ tabs[#tabs+1] = {
+ name = "profile",
+ label = _"Profile",
+ icon = { static = "icons/16/application_form.png" },
+ module = "member",
+ view = "_profile",
+ params = { member = member },
+ }
+end
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 },
+ module = "member",
+ view = "_area_list",
+ params = { areas_selector = areas_selector, member = member },
}
local issues_selector = member:get_reference_selector("issues")
tabs[#tabs+1] = {
name = "issues",
- label = _"Interessiert" .. " (" .. tostring(issues_selector:count()) .. ")",
+ label = _"Issues" .. " (" .. tostring(issues_selector:count()) .. ")",
icon = { static = "icons/16/folder.png" },
module = "issue",
view = "_list",
@@ -226,4 +228,15 @@
params = { members_selector = contacts_selector },
}
+if show_as_homepage then
+ tabs[#tabs+1] = {
+ name = "profile",
+ label = _"Profile",
+ icon = { static = "icons/16/application_form.png" },
+ module = "member",
+ view = "_profile",
+ params = { member = member },
+ }
+end
+
ui.tabs(tabs)
diff -r 65a1f7a01e7b -r 7196685f9dd7 app/main/unit/list.lua
--- a/app/main/unit/list.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/app/main/unit/list.lua Wed Feb 08 18:49:22 2012 +0100
@@ -1,6 +1,6 @@
local units = Unit:get_flattened_tree{ active = true }
-slot.put_into("title", encode.html(config.app_title))
+slot.put_into("title", _"Unit list")
if not app.session.member_id and config.motd_public then
local help_text = config.motd_public
@@ -18,7 +18,6 @@
records = units,
columns = {
{
- label = "name",
content = function(unit)
ui.link{ text = unit.name, module = "area", view = "list", params = { unit_id = unit.id } }
end
diff -r 65a1f7a01e7b -r 7196685f9dd7 config/default.lua
--- a/config/default.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/config/default.lua Wed Feb 08 18:49:22 2012 +0100
@@ -78,7 +78,7 @@
-- open and set default database handle
db = assert(mondelefant.connect{
engine='postgresql',
- dbname='liquid_feedback'
+ dbname='liquid_feedback_p'
})
at_exit(function()
db:close()
diff -r 65a1f7a01e7b -r 7196685f9dd7 model/member.lua
--- a/model/member.lua Wed Feb 08 00:55:17 2012 +0100
+++ b/model/member.lua Wed Feb 08 18:49:22 2012 +0100
@@ -405,6 +405,13 @@
)
end
+function Member.object_get:units_with_voting_right()
+ return(Unit:new_selector()
+ :join("privilege", nil, { "privilege.unit_id = unit.id AND privilege.member_id = ? AND privilege.voting_right", self.id })
+ :exec()
+ )
+end
+
function Member.object:ui_field_text(args)
args = args or {}
if app.session.member_id or config.public_access == "pseudonym" then
diff -r 65a1f7a01e7b -r 7196685f9dd7 static/style.css
--- a/static/style.css Wed Feb 08 00:55:17 2012 +0100
+++ b/static/style.css Wed Feb 08 18:49:22 2012 +0100
@@ -113,23 +113,15 @@
*/
.topbar {
- xbackground-color: #444;
+ background-color: #444;
color: #fff;
- font-size: 75%;
+ font-size: 90%;
line-height: 140%;
- background: -webkit-gradient(
- linear, left bottom, left top,
- color-stop(0%,#4c4c4c),
- color-stop(12%,#595959),
- color-stop(25%,#666666),
- color-stop(39%,#474747),
- color-stop(50%,#2c2c2c),
- color-stop(51%,#000000),
- color-stop(60%,#111111),
- color-stop(76%,#2b2b2b),
- color-stop(91%,#1c1c1c),
- color-stop(100%,#131313)
- );
+ padding-left: 10px;
+}
+
+.topbar .logolf {
+ font-weight: bold;
}
.topbar a {
@@ -207,7 +199,8 @@
padding-bottom: 1ex;
xbackground-color: #def;
background: -webkit-gradient(linear, left top, left bottom,
- color-stop(0%,#abd3ee), color-stop(100%,#ffffff)
+ /*color-stop(0%,#abd3ee), color-stop(100%,#ffffff)*/
+ color-stop(0%,#ddd), color-stop(100%,#fff)
);
}
@@ -274,19 +267,20 @@
display: inline;
}
+.actions {
+}
+
.actions a {
- float: left;
- display: block;
padding: 1px 0.5em 1px 0.0em;
margin-right: 1em;
- vertical-align: middle;
border-radius: 5px;
}
.slot_initiative_head {
- background: -webkit-gradient(linear, left top, left bottom,
- color-stop(0%,#AFEFB9), color-stop(100%,#ffffff)
+ xbackground: -webkit-gradient(linear, left top, left bottom,
+ /*color-stop(0%,#AFEFB9), color-stop(100%,#ffffff) */
+ color-stop(0%,#ddd), color-stop(100%,#fff)
);
padding-left: 1em;
padding-top: 2ex;
@@ -295,8 +289,8 @@
.initiative_name {
font-weight: bold;
font-size: 125%;
- line-height: 110%;
- margin-bottom: 0.7ex;
+ xline-height: 110%;
+ xmargin-bottom: 0.7ex;
}
@@ -373,26 +367,25 @@
.slot_support .head_potential_supporter{
background-color: #fec;
border: 1px solid #b96;
-}
-
-.interest .head_autoreject {
- background-color: #fdd;
- border: 1px solid #b77;
+ border-radius: 5px;
}
.slot_support .head_supporter {
background-color: #dfc;
border: 1px solid #8b8;
+ border-radius: 5px;
}
.slot_support .head_initiator {
background-color: #eee;
border: 1px solid #999;
+ border-radius: 5px;
}
.delegation .head_active {
background-color: #ddf;
border: 1px solid #88b;
+ border-radius: 5px;
}
.delegation .change_delegation {
@@ -912,12 +905,43 @@
* Issues
*/
-.issues tr {
- border: 1px solid #ccc;
+.issues .issue {
+ xborder: 1px solid #ccc;
+ background: -webkit-gradient(linear, left top, left bottom,
+ color-stop(0%,#e7e7e7), color-stop(33%, #f7f7f7), color-stop(100%,#fff));
+ overflow: hidden;
+ margin-bottom: 2ex;
+ border-radius: 8px;
+}
+
+.issues .issue.interested {
+ background: -webkit-gradient(linear, left top, left bottom,
+ color-stop(0%,#eec), color-stop(25%, #ffe), color-stop(100%,#fff));
+}
+
+.issues .issue .issue_info {
+ xfloat: left;
+ xwidth: 25%;
+ padding: 1ex;
+ line-height: 140%;
+ xoverflow: hidden;
+}
+
+.issues .issue .issue_info .issue_id {
+ font-size: 125%;
+}
+
+.issues .issue .initiative_list a {
+ font-weight: bold;
+}
+
+.issue_initiative_list a {
+ font-weight: bold;
}
.issues tr tr {
border: none;
+ background: none;
}
.lang_chooser {
@@ -961,6 +985,7 @@
overflow: hidden;
xwhite-space: nowrap;
position: relative;
+ border-radius: 7px;
}
.member_thumb a{
@@ -980,6 +1005,7 @@
padding: 0;
margin: 0;
vertical-align: bottom;
+ border-radius: 7px 0 0 7px;
}
.member_thumb div {
@@ -1030,7 +1056,7 @@
.draft_content,
.suggestion_content {
background-color: #eee;
- background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,#f7f7f7), color-stop(100%,#e5e5e5));
+ xbackground: -webkit-gradient(linear, left top, right bottom, color-stop(0%,#f7f7f7), color-stop(100%,#e5e5e5));
padding: 1ex;
border-radius: 8px;
}
@@ -1099,6 +1125,7 @@
border: 1px solid #b96;
padding: 1ex;
margin-bottom: 2ex;
+ border-radius: 8px;
}
.suggestion_fulfilled {