# HG changeset patch # User bsw # Date 1328658917 -3600 # Node ID 65a1f7a01e7bcc59b6ba3599b2f5650359896a4e # Parent d13b27a37ad59253ea079a2798c833219378539b More optical enhancements and repositioning of elements diff -r d13b27a37ad5 -r 65a1f7a01e7b app/main/_filter/21_auth.lua --- a/app/main/_filter/21_auth.lua Tue Feb 07 22:30:48 2012 +0100 +++ b/app/main/_filter/21_auth.lua Wed Feb 08 00:55:17 2012 +0100 @@ -49,7 +49,11 @@ end if config.public_access and not app.session.member_id and auth_needed and request.get_module() == "index" and request.get_view() == "index" then - request.redirect{ module = "area", view = "list" } + if not config.single_unit_id then + request.redirect{ module = "unit", view = "list" } + else + request.redirect{ module = "area", view = "list" } + end return end diff -r d13b27a37ad5 -r 65a1f7a01e7b app/main/_layout/default.html --- a/app/main/_layout/default.html Tue Feb 07 22:30:48 2012 +0100 +++ b/app/main/_layout/default.html Wed Feb 08 00:55:17 2012 +0100 @@ -57,15 +57,15 @@
-
- -
-
- -
-
+
+ +
+
+ +
+
diff -r d13b27a37ad5 -r 65a1f7a01e7b app/main/index/_action/login.lua --- a/app/main/index/_action/login.lua Tue Feb 07 22:30:48 2012 +0100 +++ b/app/main/index/_action/login.lua Wed Feb 08 00:55:17 2012 +0100 @@ -2,6 +2,7 @@ if member then member.last_login = "now" + member.last_activity = "now" member.active = true member:save() app.session.member = member diff -r d13b27a37ad5 -r 65a1f7a01e7b app/main/initiative/_list.lua --- a/app/main/initiative/_list.lua Tue Feb 07 22:30:48 2012 +0100 +++ b/app/main/initiative/_list.lua Wed Feb 08 00:55:17 2012 +0100 @@ -213,17 +213,4 @@ } end - if app.session.member_id and not (issue.fully_frozen or issue.closed) then - slot.put(" ") - ui.link{ - content = function() - ui.image{ static = "icons/16/script_add.png" } - slot.put(" ") - slot.put(_"Create alternative initiative") - end, - module = "initiative", - view = "new", - params = { issue_id = issue.id } - } - end end diff -r d13b27a37ad5 -r 65a1f7a01e7b app/main/initiative/_show.lua --- a/app/main/initiative/_show.lua Tue Feb 07 22:30:48 2012 +0100 +++ b/app/main/initiative/_show.lua Wed Feb 08 00:55:17 2012 +0100 @@ -1,8 +1,90 @@ local initiative = param.get("initiative", "table") local initiator = param.get("initiator", "table") +local initiators_members_selector = initiative:get_reference_selector("initiating_members") + :add_field("initiator.accepted", "accepted") + +if not (initiator and initiator.accepted) then + initiators_members_selector:add_where("initiator.accepted") +end + +local initiators = initiators_members_selector:exec() + +slot.select("initiative_head", function() + + ui.container{ + attr = { class = "initiative_name" }, + content = _("Initiative i#{id}: #{name}", { id = initiative.id, name = initiative.name }) + } + ui.tag{ + attr = { class = "initiator_names" }, + content = function() + ui.tag{ content = _"by" } + slot.put(" ") + for i, initiator in ipairs(initiators) do + if i == #initiators and i > 1 then + slot.put(" ", _"and", " ") + elseif i > 1 then + slot.put(", ") + end + ui.link{ + text = initiator.name, + module = "member", view = "show", id = initiator.id + } + end + end + } + + if initiator and initiator.accepted and not initiative.issue.fully_frozen and not initiative.issue.closed and not initiative.revoked then + slot.put(" · ") + ui.link{ + attr = { class = "action" }, + content = function() + slot.put(_"Invite initiator") + end, + module = "initiative", + view = "add_initiator", + params = { initiative_id = initiative.id } + } + if #initiators > 1 then + slot.put(" · ") + ui.link{ + content = function() + slot.put(_"Remove initiator") + end, + module = "initiative", + view = "remove_initiator", + params = { initiative_id = initiative.id } + } + end + end + if initiator and initiator.accepted == false then + slot.put(" · ") + ui.link{ + text = _"Cancel refuse of invitation", + module = "initiative", + action = "remove_initiator", + params = { + initiative_id = initiative.id, + member_id = app.session.member.id + }, + routing = { + ok = { + mode = "redirect", + module = "initiative", + view = "show", + id = initiative.id + } + } + } + end + + +end ) + util.help("initiative.show") + if initiative.issue.ranks_available and initiative.admitted then local class = initiative.rank == 1 and "admitted_info" or "not_admitted_info" ui.container{ diff -r d13b27a37ad5 -r 65a1f7a01e7b app/main/initiative/show_static.lua --- a/app/main/initiative/show_static.lua Tue Feb 07 22:30:48 2012 +0100 +++ b/app/main/initiative/show_static.lua Wed Feb 08 00:55:17 2012 +0100 @@ -11,41 +11,6 @@ initiative = initiative } } -slot.select("actions", function() - ui.link{ - content = function() - local count = Initiative:new_selector():add_where{ "issue_id = ?", initiative.issue.id}:count()-1 - ui.image{ static = "icons/16/script.png" } - if count and count > 0 then - slot.put(_("Show alternative initiatives (#{count})", {count=count})) - else - slot.put(_"Show alternative initiatives") - end - end, - module = "issue", - view = "show", - id = initiative.issue.id - } -end) - ---slot.put_into("html_head", '') - -if app.session.member_id then - slot.select("actions", function() - if not initiative.issue.fully_frozen and not initiative.issue.closed then - ui.link{ - image = { static = "icons/16/script_add.png" }, - attr = { class = "action" }, - text = _"Create alternative initiative", - module = "initiative", - view = "new", - params = { issue_id = initiative.issue.id } - } - end - end) -end - -slot.put_into("sub_title", encode.html(_("i#{id} #{name}", { id = initiative.id, name = initiative.name }) )) execute.view{ module = "initiative", diff -r d13b27a37ad5 -r 65a1f7a01e7b app/main/initiative/show_tab.lua --- a/app/main/initiative/show_tab.lua Tue Feb 07 22:30:48 2012 +0100 +++ b/app/main/initiative/show_tab.lua Wed Feb 08 00:55:17 2012 +0100 @@ -123,27 +123,6 @@ } } - local initiators_members_selector = initiative:get_reference_selector("initiating_members") - :add_field("initiator.accepted", "accepted") - - if not (initiator and initiator.accepted) then - initiators_members_selector:add_where("initiator.accepted") - end - - local initiator_count = initiators_members_selector:count() - - tabs[#tabs+1] = { - name = "initiators", - label = _"Initiators" .. " (" .. tostring(initiator_count) .. ")", - icon = { static = "icons/16/user_edit.png" }, - module = "initiative", - view = "_initiators", - params = { - initiative = initiative, - initiator = initiator, - initiators_members_selector = initiators_members_selector - } - } end local drafts_count = initiative:get_reference_selector("drafts"):count() diff -r d13b27a37ad5 -r 65a1f7a01e7b app/main/issue/_details.lua --- a/app/main/issue/_details.lua Tue Feb 07 22:30:48 2012 +0100 +++ b/app/main/issue/_details.lua Wed Feb 08 00:55:17 2012 +0100 @@ -20,8 +20,6 @@ } ui.field.timestamp{ label = _"Accepted at", name = "accepted" } ui.field.text{ label = _"Discussion time", value = issue.discussion_time } - ui.field.vote_now{ label = _"Vote now", name = "vote_now" } - ui.field.vote_later{ label = _"Vote later", name = "vote_later" } ui.field.timestamp{ label = _"Half frozen at", name = "half_frozen" } ui.field.text{ label = _"Verification time", value = issue.verification_time } ui.field.text{ diff -r d13b27a37ad5 -r 65a1f7a01e7b app/main/issue/_show_box.lua diff -r d13b27a37ad5 -r 65a1f7a01e7b app/main/issue/_show_head.lua --- a/app/main/issue/_show_head.lua Tue Feb 07 22:30:48 2012 +0100 +++ b/app/main/issue/_show_head.lua Wed Feb 08 00:55:17 2012 +0100 @@ -45,16 +45,27 @@ ui.tag{ tag = "div", content = function() - ui.tag{ - content = function() - ui.link{ - text = issue.policy.name, - module = "policy", - view = "show", - id = issue.policy.id - } - end + + local initiative_count = issue:get_reference_selector("initiatives"):count() + local text + if initiative_count == 1 then + text = _("1 initiative", { count = initiative_count }) + else + text = _("#{count} initiatives", { count = initiative_count }) + end + ui.link{ + text = text, + module = "issue", view = "show", id = issue.id } + + slot.put(" · ") + ui.link{ + text = issue.policy.name, + module = "policy", + view = "show", + id = issue.policy.id + } + slot.put(" · ") ui.tag{ content = issue.state_name } @@ -250,6 +261,20 @@ end end) +if app.session.member_id then + slot.select("actions", function() + if not issue.fully_frozen and not issue.closed then + ui.link{ + image = { static = "icons/16/script_add.png" }, + attr = { class = "action" }, + text = _"Create alternative initiative", + module = "initiative", + view = "new", + params = { issue_id = issue.id } + } + end + end) +end local issue = param.get("issue", "table") diff -r d13b27a37ad5 -r 65a1f7a01e7b app/main/member/show_tab.lua --- a/app/main/member/show_tab.lua Tue Feb 07 22:30:48 2012 +0100 +++ b/app/main/member/show_tab.lua Wed Feb 08 00:55:17 2012 +0100 @@ -162,7 +162,7 @@ local issues_selector = member:get_reference_selector("issues") tabs[#tabs+1] = { name = "issues", - label = _"Issues" .. " (" .. tostring(issues_selector:count()) .. ")", + label = _"Interessiert" .. " (" .. tostring(issues_selector:count()) .. ")", icon = { static = "icons/16/folder.png" }, module = "issue", view = "_list", @@ -173,7 +173,7 @@ tabs[#tabs+1] = { name = "supported_initiatives", - label = _"Supported initiatives" .. " (" .. tostring(supported_initiatives_selector:count()) .. ")", + label = _"Supported" .. " (" .. tostring(supported_initiatives_selector:count()) .. ")", icon = { static = "icons/16/thumb_up_green.png" }, module = "member", view = "_list_supported_initiatives", @@ -184,7 +184,7 @@ 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()) .. ")", + label = _"Initiated" .. " (" .. tostring(initiated_initiatives_selector:count()) .. ")", icon = { static = "icons/16/user_edit.png" }, module = "member", view = "_list_supported_initiatives", diff -r d13b27a37ad5 -r 65a1f7a01e7b static/style.css --- a/static/style.css Tue Feb 07 22:30:48 2012 +0100 +++ b/static/style.css Wed Feb 08 00:55:17 2012 +0100 @@ -207,9 +207,7 @@ 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) ); } @@ -258,7 +256,7 @@ } .title2 div { - margin-bottom: 2ex; + margin-bottom: 1ex; xline-height: 130%; } @@ -285,6 +283,23 @@ border-radius: 5px; } + +.slot_initiative_head { + background: -webkit-gradient(linear, left top, left bottom, + color-stop(0%,#AFEFB9), color-stop(100%,#ffffff) + ); + padding-left: 1em; + padding-top: 2ex; +} + +.initiative_name { + font-weight: bold; + font-size: 125%; + line-height: 110%; + margin-bottom: 0.7ex; +} + + .content_navigation { font-size: 75%; background-color: #eee; @@ -457,14 +472,6 @@ } -.sub_title div { - padding-top: 1ex; - margin-top: 1ex; - font-weight: bold; - font-size: 135%; - line-height: 110%; -} - /************************************************************************* * Main content */ @@ -1023,9 +1030,9 @@ .draft_content, .suggestion_content { background-color: #eee; - border: 1px solid #ccc; - padding-left: 1ex; - padding-right: 1ex; + background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,#f7f7f7), color-stop(100%,#e5e5e5)); + padding: 1ex; + border-radius: 8px; }