# HG changeset patch
# User bsw
# Date 1340818119 -7200
# Node ID cdd0bcbbef8b472fd9179d600848c90daa6d7145
# Parent 17a33bd0d48a86a78b4daaa17d13bfe05170bc25
Improved paginators on initiative view, optical improvements
diff -r 17a33bd0d48a -r cdd0bcbbef8b app/main/initiative/show.lua
--- a/app/main/initiative/show.lua Wed Jun 27 14:48:35 2012 +0200
+++ b/app/main/initiative/show.lua Wed Jun 27 19:28:39 2012 +0200
@@ -348,8 +348,8 @@
:add_field("coalesce(vote.grade, 0) as grade")
:left_join("initiative", nil, "initiative.id = vote.initiative_id")
:left_join("issue", nil, "issue.id = initiative.issue_id")
-
- ui.container{ attr = { class = "heading"}, content = _"Member voting" }
+
+ ui.anchor{ name = "voter", attr = { class = "heading" }, content = _"Member voter" }
execute.view{
module = "member",
@@ -357,7 +357,8 @@
params = {
initiative = initiative,
for_votes = true,
- members_selector = members_selector
+ members_selector = members_selector,
+ paginator_name = "voter"
}
}
end
@@ -370,29 +371,27 @@
:add_where("direct_supporter_snapshot.satisfied")
:add_field("direct_supporter_snapshot.informed", "is_informed")
-
-
if members_selector:count() > 0 then
if issue.fully_frozen then
- ui.container{ attr = { class = "heading"}, content = _"Supporters (before begin of voting)" }
+ ui.anchor{ name = "supporters", attr = { class = "heading" }, content = _"Supporters (before begin of voting)" }
else
- ui.container{ attr = { class = "heading"}, content = _"Supporters" }
+ ui.anchor{ name = "supporters", attr = { class = "heading" }, content = _"Supporters" }
end
execute.view{
module = "member",
view = "_list",
params = {
-
initiative = initiative,
- members_selector = members_selector
+ members_selector = members_selector,
+ paginator_name = "supporters"
}
}
else
if issue.fully_frozen then
- ui.container{ attr = { class = "heading"}, content = _"No supporters (before begin of voting)" }
+ ui.anchor{ name = "supporters", attr = { class = "heading" }, content = _"No supporters (before begin of voting)" }
else
- ui.container{ attr = { class = "heading"}, content = _"No supporters" }
+ ui.anchor{ name = "supporters", attr = { class = "heading" }, content = _"No supporters" }
end
slot.put("
")
end
@@ -405,33 +404,32 @@
:add_where("NOT direct_supporter_snapshot.satisfied")
:add_field("direct_supporter_snapshot.informed", "is_informed")
-
if members_selector:count() > 0 then
if issue.fully_frozen then
- ui.container{ attr = { class = "heading"}, content = _"Potential supporters (before begin of voting" }
+ ui.anchor{ name = "potential_supporters", attr = { class = "heading" }, content = _"Potential supporters (before begin of voting)" }
else
- ui.container{ attr = { class = "heading"}, content = _"Potential supporters" }
+ ui.anchor{ name = "potential_supporters", attr = { class = "heading" }, content = _"Potential supporters" }
end
execute.view{
module = "member",
view = "_list",
params = {
-
initiative = initiative,
- members_selector = members_selector
+ members_selector = members_selector,
+ paginator_name = "potential_supporters"
}
}
else
if issue.fully_frozen then
- ui.container{ attr = { class = "heading"}, content = _"No potential supporters (before begin of voting)" }
+ ui.anchor{ name = "potential_supporters", attr = { class = "heading" }, content = _"No potential supporters (before begin of voting)" }
else
- ui.container{ attr = { class = "heading"}, content = _"No potential supporters" }
+ ui.anchor{ name = "potential_supporters", attr = { class = "heading" }, content = _"No potential supporters" }
end
slot.put("
")
end
- ui.container{ attr = { class = "heading"}, content = _"Details" }
+ ui.container{ attr = { class = "heading" }, content = _"Details" }
execute.view {
module = "initiative",
view = "_details",
@@ -442,22 +440,3 @@
}
end
-
-
---[[
-execute.view{
- module = "initiative",
- view = "show_tab",
- params = {
- initiative = initiative,
- initiator = initiator
- }
-}
-
-if initiative.issue.snapshot then
- slot.put("
")
- ui.field.timestamp{ label = _"Last snapshot:", value = initiative.issue.snapshot }
-end
-
-
---]]
diff -r 17a33bd0d48a -r cdd0bcbbef8b app/main/member/_list.lua
--- a/app/main/member/_list.lua Wed Jun 27 14:48:35 2012 +0200
+++ b/app/main/member/_list.lua Wed Jun 27 19:28:39 2012 +0200
@@ -7,6 +7,8 @@
local initiator = param.get("initiator", "table")
local for_votes = param.get("for_votes", atom.boolean)
+local paginator_name = param.get("paginator_name")
+
if initiative or issue then
if for_votes then
members_selector:left_join("delegating_voter", "_member_list__delegating_voter", { "_member_list__delegating_voter.issue_id = issue.id AND _member_list__delegating_voter.member_id = ?", app.session.member_id })
@@ -62,8 +64,10 @@
filter,
content = function()
ui.paginate{
+ name = paginator_name,
+ anchor = paginator_name,
selector = members_selector,
- per_page = 100,
+ per_page = 50,
content = function()
ui.container{
attr = { class = "member_list" },
diff -r 17a33bd0d48a -r cdd0bcbbef8b app/main/member_image/_show.lua
--- a/app/main/member_image/_show.lua Wed Jun 27 14:48:35 2012 +0200
+++ b/app/main/member_image/_show.lua Wed Jun 27 19:28:39 2012 +0200
@@ -2,7 +2,6 @@
local member_id = member and member.id or param.get("member_id", atom.integer)
local image_type = param.get("image_type")
-local show_dummy = param.get("show_dummy", atom.boolean)
local class = param.get("class")
local popup_text = param.get("popup_text")
@@ -12,38 +11,21 @@
class = ""
end
---[[
-local image = member:get_reference_selector("images")
- :add_where{ "image_type = ?", image_type }
- :optional_object_mode()
- :exec()
-if image or show_dummy then
- if config.fastpath_url_func then
- ui.image{
- attr = { title = popup_text, class = "member_image member_image_" .. image_type .. class },
- external = config.fastpath_url_func(member.id, image_type)
+if config.fastpath_url_func then
+ ui.image{
+ attr = { title = popup_text, class = "member_image member_image_" .. image_type .. class },
+ external = config.fastpath_url_func(member.id, image_type)
+ }
+else
+ ui.image{
+ attr = { title = popup_text, class = "member_image member_image_" .. image_type .. class },
+ module = "member_image",
+ view = "show",
+ extension = "jpg",
+ id = member_id,
+ params = {
+ image_type = image_type
}
- else
- if not image then
- ui.image{
- attr = { title = popup_text, class = "member_image member_image_" .. image_type .. class },
- external = encode.url{ static = (config.member_image_default_file[image_type] or 'icons/16/lightning.png')},
- }
- else
---]]
- ui.image{
- attr = { title = popup_text, class = "member_image member_image_" .. image_type .. class },
- module = "member_image",
- view = "show",
- extension = "jpg",
- id = member_id,
- params = {
- image_type = image_type
- }
- }
- --[[
- end
- end
+ }
end
---]]
\ No newline at end of file
diff -r 17a33bd0d48a -r cdd0bcbbef8b app/main/suggestion/_list.lua
--- a/app/main/suggestion/_list.lua Wed Jun 27 14:48:35 2012 +0200
+++ b/app/main/suggestion/_list.lua Wed Jun 27 19:28:39 2012 +0200
@@ -86,7 +86,12 @@
end
}
end }
- if not initiative.issue.fully_frozen and not initiative.issue.closed then
+ if app.session.member_id
+ and not initiative.issue.half_frozen
+ and not initiative.issue.closed
+ and not initiative.revoked
+ and app.session.member:has_voting_right_for_unit_id(initiative.issue.area.unit_id)
+ then
ui.container{ attr = { class = "content" }, content = function()
ui.link{
module = "suggestion", view = "new", params = { initiative_id = initiative.id },
diff -r 17a33bd0d48a -r cdd0bcbbef8b app/main/supporter/_show_box.lua
--- a/app/main/supporter/_show_box.lua Wed Jun 27 14:48:35 2012 +0200
+++ b/app/main/supporter/_show_box.lua Wed Jun 27 19:28:39 2012 +0200
@@ -77,25 +77,6 @@
end
end
-if app.session.member_id
- and not initiative.issue.half_frozen
- and not initiative.issue.closed
- and not initiative.revoked
- and app.session.member:has_voting_right_for_unit_id(initiative.issue.area.unit_id)
-then
- ui.link{
- content = function()
- slot.put(_"Add suggestion")
- end,
- module = "suggestion",
- view = "new",
- params = {
- initiative_id = initiative.id
- }
- }
- slot.put(" ")
-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
diff -r 17a33bd0d48a -r cdd0bcbbef8b static/style.css
--- a/static/style.css Wed Jun 27 14:48:35 2012 +0200
+++ b/static/style.css Wed Jun 27 19:28:39 2012 +0200
@@ -370,7 +370,7 @@
}
.initiative_head {
- margin-bottom: 10px;
+ margin-bottom: 2ex;
}
.page_head .actions:last-child,
@@ -634,6 +634,11 @@
.ui_paginate_foot {
margin-top: 1ex;
+ margin-bottom: 4ex;
+}
+
+.initiative_head .ui_paginate_foot {
+ margin-bottom: 1ex;
}
.ui_paginate_select a {
@@ -1339,6 +1344,7 @@
font-size: 115%;
font-weight: bold;
margin-bottom: 10px;
+ text-decoration: none;
}
.heading.first {