# HG changeset patch
# User bsw
# Date 1340628034 -7200
# Node ID 7dc5ab12bfe39d0384c241b3f81e3af83d9aa16b
# Parent 56147a5153f65afe1a665bcdbd1cafdc104cdfa9
Optical enhancements :)
diff -r 56147a5153f6 -r 7dc5ab12bfe3 app/main/area/_head.lua
--- a/app/main/area/_head.lua Mon Jun 25 01:17:27 2012 +0200
+++ b/app/main/area/_head.lua Mon Jun 25 14:40:34 2012 +0200
@@ -4,7 +4,9 @@
area:load_delegation_info_once_for_member_id(app.session.member_id)
-execute.view{ module = "unit", view = "_head", params = { unit = area.unit } }
+if not param.get("hide_unit", atom.boolean) then
+ execute.view{ module = "unit", view = "_head", params = { unit = area.unit } }
+end
ui.container{ attr = { class = "area_head" }, content = function()
diff -r 56147a5153f6 -r 7dc5ab12bfe3 app/main/area/_list.lua
--- a/app/main/area/_list.lua Mon Jun 25 01:17:27 2012 +0200
+++ b/app/main/area/_list.lua Mon Jun 25 14:40:34 2012 +0200
@@ -29,13 +29,9 @@
areas_selector:add_field("0", "issues_to_vote_count")
end
-slot.put("
")
+ui.container{ attr = { class = "area_list" }, content = function()
+ for i, area in ipairs(areas_selector:exec()) do
+ execute.view { module = "area", view = "_list_entry", params = { area = area } }
+ end
+end }
-for i, area in ipairs(areas_selector:exec()) do
-
- ui.container{ attr = { class = "area_list" }, content = function()
- execute.view { module = "area", view = "_list_entry", params = { area = area } }
- end }
-
-end
-
diff -r 56147a5153f6 -r 7dc5ab12bfe3 app/main/area/_list_entry.lua
--- a/app/main/area/_list_entry.lua Mon Jun 25 01:17:27 2012 +0200
+++ b/app/main/area/_list_entry.lua Mon Jun 25 14:40:34 2012 +0200
@@ -1,17 +1,12 @@
local area = param.get("area", "table")
ui.container{ attr = { class = "area" }, content = function()
- execute.view{ module = "delegation", view = "_info", params = { area = area } }
- ui.container{ attr = { class = "title" }, content = function()
- -- area name
- ui.link{
- module = "area", view = "show", id = area.id,
- attr = { class = "area_name" }, content = area.name
- }
- end }
+ execute.view{ module = "area", view = "_head", params = { area = area, hide_unit = true, show_content = true } }
ui.container{ attr = { class = "content" }, content = function()
+ ui.tag{ content = _"Issues:" }
+ slot.put(" ")
ui.link{
module = "area", view = "show", id = area.id, params = { tab = "open", filter = "new" },
text = _("#{count} new", { count = area.issues_new_count })
diff -r 56147a5153f6 -r 7dc5ab12bfe3 app/main/area/show_tab.lua
--- a/app/main/area/show_tab.lua Mon Jun 25 01:17:27 2012 +0200
+++ b/app/main/area/show_tab.lua Mon Jun 25 14:40:34 2012 +0200
@@ -10,6 +10,8 @@
local members_selector = area:get_reference_selector("members"):add_where("member.active")
local delegations_selector = area:get_reference_selector("delegations")
+ :join("member", "truster", "truster.id = delegation.truster_id AND truster.active")
+ :join("member", "trustee", "trustee.id = delegation.trustee_id AND trustee.active")
local tabs = {
module = "area",
diff -r 56147a5153f6 -r 7dc5ab12bfe3 app/main/event/_list.lua
--- a/app/main/event/_list.lua Mon Jun 25 01:17:27 2012 +0200
+++ b/app/main/event/_list.lua Mon Jun 25 14:40:34 2012 +0200
@@ -45,23 +45,6 @@
last_event_id = event.id
event.issue:load_everything_for_member_id(app.session.member_id)
- if event.occurrence.date ~= last_event_date then
- local days_ago_text
- if event.time_ago == 0 then
- days_ago_text = _"Today"
- elseif event.time_ago == 1 then
- days_ago_text = _"Yesterday"
- else
- days_ago_text = _("#{count} days ago", { count = event.time_ago })
- end
- ui.container{ attr = { class = "date" }, content = function()
- ui.tag{ content = format.date(event.occurrence.date) }
- slot.put(" · ")
- ui.tag{ content = days_ago_text }
- end }
-
- last_event_date = event.occurrence.date
- end
local class = "issue"
if event.is_interested then
class = class .. " interested"
@@ -69,57 +52,70 @@
class = class .. " interested_by_delegation"
end
- ui.container{ attr = { class = "issue_policy_info" }, content = function()
- if (app.session.member_id or config.public_access == "pseudonym") and event.member_id then
- if app.session.member_id then
- ui.link{
- content = function()
- execute.view{
- module = "member_image",
- view = "_show",
- params = {
- member = event.member,
- image_type = "avatar",
- show_dummy = true,
- class = "micro_avatar",
- popup_text = text
- }
- }
- end,
- module = "member", view = "show", id = event.member_id
+ ui.container{ attr = { class = "issue_policy_info" }, content = function()
+ if (app.session.member_id or config.public_access == "pseudonym") and event.member_id then
+ if app.session.member_id then
+ ui.link{
+ content = function()
+ execute.view{
+ module = "member_image",
+ view = "_show",
+ params = {
+ member = event.member,
+ image_type = "avatar",
+ show_dummy = true,
+ class = "micro_avatar",
+ popup_text = text
+ }
}
- slot.put(" ")
- end
- ui.link{
- text = event.member.name,
- module = "member", view = "show", id = event.member_id
- }
- slot.put(" · ")
- end
- local event_name = event.event_name
- local event_image
- if event.event == "issue_state_changed" then
- if event.state == "discussion" then
- event_name = _"Discussion started"
- event_image = "comments.png"
- elseif event.state == "verification" then
- event_name = _"Verification started"
- event_image = "lock.png"
- elseif event.state == "voting" then
- event_name = _"Voting started"
- event_image = "email_open.png"
- else
- event_name = event.state_name
- end
- if event_image then
- ui.image{ static = "icons/16/" .. event_image }
- slot.put(" ")
- end
- end
- ui.tag{ attr = { class = "event_name" }, content = event_name }
- slot.put(" · ")
- ui.tag{ attr = { class = "time" }, content = format.time(event.occurrence) }
- end }
+ end,
+ module = "member", view = "show", id = event.member_id
+ }
+ slot.put(" ")
+ end
+ ui.link{
+ text = event.member.name,
+ module = "member", view = "show", id = event.member_id
+ }
+ slot.put(" · ")
+ end
+ local event_name = event.event_name
+ local event_image
+ if event.event == "issue_state_changed" then
+ if event.state == "discussion" then
+ event_name = _"Discussion started"
+ event_image = "comments.png"
+ elseif event.state == "verification" then
+ event_name = _"Verification started"
+ event_image = "lock.png"
+ elseif event.state == "voting" then
+ event_name = _"Voting started"
+ event_image = "email_open.png"
+ else
+ event_name = event.state_name
+ end
+ if event_image then
+ ui.image{ static = "icons/16/" .. event_image }
+ slot.put(" ")
+ end
+ end
+ local days_ago_text
+ if event.time_ago == 0 then
+ days_ago_text = _("Today at #{time}", { time = format.time(event.occurrence) })
+ elseif event.time_ago == 1 then
+ days_ago_text = _("Yesterday at #{time}", { time = format.time(event.occurrence) })
+ else
+ days_ago_text = _("#{date} at #{time}", { date = format.date(event.occurrence.date), time = format.time(event.occurrence) })
+ end
+ ui.tag{ attr = { class = "event_name" }, content = event_name }
+ slot.put(" · ")
+ ui.tag{ content = days_ago_text }
+ if event.time_ago > 1 then
+ slot.put(" (")
+ ui.tag{ content = _("#{count} days ago", { count = event.time_ago }) }
+ slot.put(")")
+ end
+ end }
ui.container{ attr = { class = class }, content = function()
diff -r 56147a5153f6 -r 7dc5ab12bfe3 app/main/index/_index_member.lua
--- a/app/main/index/_index_member.lua Mon Jun 25 01:17:27 2012 +0200
+++ b/app/main/index/_index_member.lua Mon Jun 25 14:40:34 2012 +0200
@@ -60,5 +60,10 @@
params = { members_selector = Member:new_selector():add_where("active") }
}
+if not param.get("tab") then
+ execute.view{
+ module = "index", view = "_notifications"
+ }
+end
ui.tabs(tabs)
diff -r 56147a5153f6 -r 7dc5ab12bfe3 app/main/index/_member_home.lua
--- a/app/main/index/_member_home.lua Mon Jun 25 01:17:27 2012 +0200
+++ b/app/main/index/_member_home.lua Mon Jun 25 14:40:34 2012 +0200
@@ -3,10 +3,7 @@
local filter_unit = param.get_all_cgi()["filter_unit"] or "my_areas"
if not for_member then
- execute.view{
- module = "index", view = "_notifications"
- }
-
+
ui.container{ attr = { class = "ui_filter" }, content = function()
ui.container{ attr = { class = "ui_filter_head" }, content = function()
@@ -35,8 +32,6 @@
end }
end
- slot.put("
")
-
if not for_member then
if filter_unit == "global" then
execute.view{ module = "unit", view = "_list" }
@@ -76,15 +71,40 @@
local area_count = areas_selector:count()
- ui.container{ attr = { class = "area_list" }, content = function()
- ui.container{ attr = { class = "unit_head" }, content = function()
- ui.link{
- text = unit.name,
- module = "unit", view = "show", id = unit.id
- }
+ local max_area_count = Area:new_selector()
+ :add_where{ "area.unit_id = ?", unit.id }
+ :add_where{ "area.active" }
+ :count()
+ local more_area_count = max_area_count - area_count
+ local delegated_count = Area:new_selector()
+ :add_where{ "area.unit_id = ?", unit.id }
+ :add_where{ "area.active" }
+ :left_join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ?", member.id } )
+ :add_where{ "membership.member_id ISNULL" }
+ :join("delegation", nil, { "delegation.area_id = area.id AND delegation.truster_id = ?", member.id } )
+ :add_where{ "delegation.trustee_id NOTNULL" }
+ :count()
- execute.view{ module = "delegation", view = "_info", params = { unit = unit } }
- end }
+ local more_area_text
+ if area_count == 0 and more_area_count == 1 then
+ more_area_text = _("You are not participating in the only area of the unit")
+ elseif area_count == 0 and more_area_count > 0 then
+ more_area_text = _("You are not participating in any of the #{count} areas in this unit", { count = more_area_count })
+ elseif area_count > 0 and more_area_count == 1 then
+ more_area_text = _("One more area in this unit")
+ elseif area_count > 0 and more_area_count > 0 then
+ more_area_text = _("#{count} more areas in this unit", { count = more_area_count })
+ end
+ local delegated_text
+ if delegated_count == 1 then
+ delegated_text = _("One of them have an area delegation set", { count = delegated_count })
+ elseif delegated_count > 0 then
+ delegated_text = _("#{count} of them have an area delegation set", { count = delegated_count })
+ end
+
+ ui.container{ attr = { class = "area_list" }, content = function()
+
+ execute.view{ module = "unit", view = "_head", params = { unit = unit, show_content = true } }
if area_count > 0 then
local areas = areas_selector:exec()
@@ -95,57 +115,23 @@
}
}
end
- elseif member:has_voting_right_for_unit_id(unit.id) then
+ end
+
+ if area_count == 0 and member:has_voting_right_for_unit_id(unit.id) or
+ more_area_count > 0 then
+
ui.container{ attr = { class = "area" }, content = function()
ui.container{ attr = { class = "content" }, content = function()
- slot.put("
")
- if for_member then
- ui.tag{ content = _"This member has voting privileges for this unit, but you ist not member of any of its areas." }
- else
- ui.tag{ content = _"You have voting privileges for this unit, but you are not member of any of its areas." }
+ if more_area_text then
+ ui.link{ module = "unit", view = "show", id = unit.id, text = more_area_text }
+ end
+ if delegated_text then
+ slot.put(" · ")
+ ui.tag{ content = delegated_text }
end
end }
end }
end
- local max_area_count = Area:new_selector()
- :add_where{ "area.unit_id = ?", unit.id }
- :add_where{ "area.active" }
- :count()
- local more_area_count = max_area_count - area_count
- local delegated_count = Area:new_selector()
- :add_where{ "area.unit_id = ?", unit.id }
- :add_where{ "area.active" }
- :left_join("membership", nil, { "membership.area_id = area.id AND membership.member_id = ?", member.id } )
- :add_where{ "membership.member_id ISNULL" }
- :join("delegation", nil, { "delegation.area_id = area.id AND delegation.truster_id = ?", member.id } )
- :add_where{ "delegation.trustee_id NOTNULL" }
- :count()
- if more_area_count > 0 then
- ui.container{ attr = { class = "area" }, content = function()
- ui.container{ attr = { class = "content" }, content = function()
- slot.put("
")
- local text
- if more_area_count == 1 then
- text = _("One more area in this unit")
- else
- text = _("#{count} more areas in this unit", { count = more_area_count })
- end
- ui.link{ module = "unit", view = "show", id = unit.id, text = text }
- if delegated_count > 0 then
- slot.put(" · ")
- local text
- if delegated_count == 1 then
- text = _("One of them have an area delegation set", { count = delegated_count })
- else
- text = _("#{count} of them have an area delegation set", { count = delegated_count })
- end
- ui.tag{ content = text }
- end
- end }
- end }
- end
- slot.put("
")
- slot.put("
")
end }
end
end
diff -r 56147a5153f6 -r 7dc5ab12bfe3 app/main/index/initiator_invites.lua
--- a/app/main/index/initiator_invites.lua Mon Jun 25 01:17:27 2012 +0200
+++ b/app/main/index/initiator_invites.lua Mon Jun 25 14:40:34 2012 +0200
@@ -1,13 +1,8 @@
-
+local initiatives_selector = Initiator:selector_for_invites(app.session.member_id)
-local initiatives_selector = Initiator:selector_for_invites(app.session.member_id)
+ui.title(_"Initiatives that invited you to become initiator:")
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",
diff -r 56147a5153f6 -r 7dc5ab12bfe3 app/main/member/_event_list.lua
--- a/app/main/member/_event_list.lua Mon Jun 25 01:17:27 2012 +0200
+++ b/app/main/member/_event_list.lua Mon Jun 25 14:40:34 2012 +0200
@@ -1,25 +1,25 @@
local member = param.get("member", "table")
local events = param.get_all_cgi()["events"] or "personal"
-ui.container{ attr = { class = "ui_filter_head" }, content = function()
+ui.container{ attr = { class = "ui_filter" }, content = function()
+ ui.container{ attr = { class = "ui_filter_head" }, content = function()
- ui.link{
- attr = { class = events == "personal" and "ui_tabs_link active" or nil },
- text = _"My areas and issues",
- module = "index", view = "index", params = { tab = "timeline", events = "personal" }
- }
-
- slot.put(" ")
+ ui.link{
+ attr = { class = events == "personal" and "ui_tabs_link active" or nil },
+ text = _"My areas and issues",
+ module = "index", view = "index", params = { tab = "timeline", events = "personal" }
+ }
+
+ slot.put(" ")
- ui.link{
- attr = { class = events == "global" and "active" or nil },
- text = _"Everything",
- module = "index", view = "index", params = { tab = "timeline", events = "global" }
- }
+ ui.link{
+ attr = { class = events == "global" and "active" or nil },
+ text = _"Everything",
+ module = "index", view = "index", params = { tab = "timeline", events = "global" }
+ }
+ end }
end }
-slot.put("
")
-
if events == "personal" then
execute.view{
module = "event", view = "_list"
diff -r 56147a5153f6 -r 7dc5ab12bfe3 static/style.css
--- a/static/style.css Mon Jun 25 01:17:27 2012 +0200
+++ b/static/style.css Mon Jun 25 14:40:34 2012 +0200
@@ -344,11 +344,6 @@
margin-top: 1ex;
}
-.page_head .actions {
- margin-top: 0.5ex;
- margin-bottom: 1ex;
-}
-
.slot_head {
background-color: #fff;
margin: 0px 10px 2ex 10px;
@@ -364,12 +359,24 @@
padding: 8px 10px 2px 10px;
}
+.page_head .actions,
.page_head .unit_head .content,
.page_head .area_head .content,
.issue .content,
.initiative_head .content,
+.area_list .unit_head .content,
.area_list .area .content {
- padding: 2px 10px 8px 10px;
+ padding: 10px 10px 0 10px;
+}
+
+.page_head .actions:last-child,
+.page_head .unit_head .content:last-child,
+.page_head .area_head .content:last-child,
+.issue .content:last-child,
+.initiative_head .content:last-child,
+.area_list .unit_head .content:last-child,
+.area_list .area .content:last-child {
+ padding: 10px 10px 10px 10px;
}
.page_head .initiative_list,
@@ -386,6 +393,7 @@
.page_head .title,
.issue .title,
.initiative_head .title,
+.area_list .unit_head .unit_name,
.area_list .area_name {
font-weight: bold;
font-size: 120%;
@@ -407,13 +415,12 @@
.issues .issue .content.actions a,
.area_list .area .content,
.area_list .area .content a {
- color: #777;
+ color: #000;
}
-.page_head .unit_head .title,
-.page_head .area_head .title,
-.area_list .area .title,
-.issue .title {
+x.page_head .unit_head .title,
+x.page_head .area_head .title,
+x.issue .title {
background-color: #eee;
background-image: linear-gradient(top, #eee 0%, #f7f7f7 10%, #fff 100%);
background-image: -o-linear-gradient(top, #eee 0%, #f7f7f7 10%, #fff 100%);
@@ -422,6 +429,33 @@
background-image: -ms-linear-gradient(top, #eee 0%, #f7f7f7 10%, #fff 100%);
}
+.unit_head {
+ background-color: #cdf;
+ background-image: -webkit-linear-gradient(top, #abf 0%, #cdf 20%, #f0f7ff 100%);
+}
+
+.area_head {
+ background-color: #def;
+ background-image: -webkit-linear-gradient(top, #bef 0%, #def 20%, #f7faff 100%);
+}
+
+.issue {
+ background-color: #f0f7ff;
+ background-image: -webkit-linear-gradient(top, #f0faff 0%, #f0f7ff 20%, #fff 100%);
+}
+
+.issue .initiative_list {
+ background: #fff;
+}
+
+x {
+ background-image: linear-gradient(top, #eee 0%, #f7f7f7 10%, #fff 100%);
+ background-image: -o-linear-gradient(top, #eee 0%, #f7f7f7 10%, #fff 100%);
+ background-image: -moz-linear-gradient(top, #eee 0%, #f7f7f7 10%, #fff 100%);
+ background-image: -webkit-linear-gradient(top, #dde 0%, #d7d7e7 10%, #fff 100%);
+ background-image: -ms-linear-gradient(top, #eee 0%, #f7f7f7 10%, #fff 100%);
+}
+
.page_head .area_head .title,
.page_head .issue .title {
border-top: 1px solid #ddd;
@@ -491,23 +525,25 @@
* ui.tab
*/
.ui_tabs {
- margin: 10px 0px;
+ margin: 20px 0px;
}
.ui_tabs_links a {
- padding: 0.75ex 0.6em;
+ padding: 1ex 1em;
line-height: 225%;
background-color: #f7f7f7;
+ background-color: #444;
+ background-image: -webkit-linear-gradient(top, #000 0%, #444 70%, #777 90%, #888 100%);
+ color: #fff;
white-space: nowrap;
border-radius: 5px;
- margin-right: 5px;
+ margin-right: 2px;
font-weight: bold;
}
.ui_tabs_links a:hover,
.ui_tabs_links a.selected {
- background-color: #444;
- color: #fff;
+ box-shadow: 0px 0px 3px 3px #fc0;
text-decoration: none;
}
@@ -518,29 +554,29 @@
.ui_filter {
overflow: auto;
+ margin: 2ex 0;
}
.ui_filter_head {
color: #777;
- margin-top: 1ex;
font-size: 90%;
- font-weight: bold;
float: left;
line-height: 200%;
margin-right: 2em;
}
-.ui_filter_head a {
- color: #777;
- padding: 0.5ex;
+.ui_filter a {
+ font-weight: bold;
+ margin-right: 0.5em;
}
-.ui_filter_head a:hover,
+
.ui_filter_head a.active {
+ text-decoration: none;
+ background-color: #555;
color: #fff;
- background-color: #777;
- padding: 0.5ex;
- border-radius: 5px;
+ padding: 0.5ex 0.5em;
+ border-radius: 4px;
}
/*************************************************************************
@@ -591,7 +627,7 @@
margin-top: 1ex;
background-color: #fdd;
padding: 0.5ex;
- border: 1px solid #daa;
+ border: 1px solid #fbb;
}
.notifications ul {
@@ -780,17 +816,27 @@
/*************************************************************************
* Area list
*/
-
-.area_list .unit_head {
- font-size: 120%;
- font-weight: bold;
- margin-bottom: 1ex;
+.area_list {
+ border: 1px solid #abf;
+ border-radius: 8px;
+ margin-top: 2ex;
}
.area_list .area {
- margin-bottom: 1ex;
+ border-bottom: 1px solid #cdf;
+}
+
+.area_list .unit_head {
+ border-radius: 8px 8px 0 0;
}
+.area_list .area:last-child {
+ border-radius: 0 0 8px 8px;
+}
+
+.area_list .area:first-child {
+ border-radius: 8px 8px 0 0;
+}
/*************************************************************************
@@ -1353,14 +1399,12 @@
/* shadows */
-.area_list .area,
.initiative_head,
.box,
div.notifications {
border-radius: 8px;
}
-.area_list .area,
.initiative_head,
.box {
border: 1px solid #aaa;
@@ -1371,7 +1415,7 @@
}
.slot_head,
-.area_list .area,
+.area_list,
.initiative_head,
.issues .issue,
.ui_tabs_links a,
@@ -1379,7 +1423,6 @@
.help,
.use_terms,
.motd,
-.ui_filter a.active,
.vote_info .content,
.box,
div.notifications {