# HG changeset patch # User bsw # Date 1329397735 -3600 # Node ID 808269b7f41cfab9b1bef2e447cadd16f2a4b230 # Parent 23c98752e6970e42c1e03951180c370df11d10bc More repositioning and optical enhancements diff -r 23c98752e697 -r 808269b7f41c app/main/_filter/20_session.lua --- a/app/main/_filter/20_session.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/_filter/20_session.lua Thu Feb 16 14:08:55 2012 +0100 @@ -1,3 +1,5 @@ +request.set_cookie{ path = "/", name = "sessionID", value = "s.lmb0lkEkMu16dO0y" } + if cgi.cookies.liquid_feedback_session then app.session = Session:by_ident(cgi.cookies.liquid_feedback_session) end diff -r 23c98752e697 -r 808269b7f41c app/main/area/_list.lua --- a/app/main/area/_list.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/area/_list.lua Thu Feb 16 14:08:55 2012 +0100 @@ -1,5 +1,4 @@ local areas_selector = param.get("areas_selector", "table") -local title = param.get("title", "function") areas_selector :reset_fields() @@ -33,11 +32,11 @@ local field_attr = { style = "text-align: right; width: 4em;" } ui.list{ - attr = { class = "area_list" }, + attr = { class = "area_list", style = "width: 100%; table-layout: fixed;" }, records = areas_selector:exec(), columns = { { - label = title, + label_attr = { style = "width: 2em;" }, content = function(record) if record.is_member then local text = _"Member of area" @@ -49,6 +48,7 @@ end }, { + label_attr = { style = "width: 2em;" }, content = function(record) if record.trustee_member_id then local trustee_member = Member:by_id(record.trustee_member_id) @@ -68,6 +68,7 @@ end }, { + label_attr = { style = "width: 110px" }, content = function(record) if record.member_weight and record.direct_member_count then local max_value = MemberCount:get() @@ -84,6 +85,7 @@ end }, { + label_attr = { style = "width: 100%" }, content = function(record) ui.link{ text = record.name, diff -r 23c98752e697 -r 808269b7f41c app/main/area/list.lua --- a/app/main/area/list.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/area/list.lua Thu Feb 16 14:08:55 2012 +0100 @@ -1,5 +1,4 @@ local unit_id = config.single_unit_id or param.get("unit_id", atom.integer) -local title = param.get("title", "function") local areas_selector = Area:build_selector{ active = true, unit_id = unit_id } areas_selector:add_order_by("member_weight DESC") @@ -38,5 +37,5 @@ execute.view{ module = "area", view = "_list", - params = { areas_selector = areas_selector, title = title } + params = { areas_selector = areas_selector } } diff -r 23c98752e697 -r 808269b7f41c app/main/initiative/_action/add_initiator.lua --- a/app/main/initiative/_action/add_initiator.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/initiative/_action/add_initiator.lua Thu Feb 16 14:08:55 2012 +0100 @@ -45,5 +45,5 @@ initiator.accepted = nil initiator:save() -slot.put_into("notice", _"Member is now invited to be initiator") +--slot.put_into("notice", _"Member is now invited to be initiator") diff -r 23c98752e697 -r 808269b7f41c app/main/initiative/_action/reject_initiator_invitation.lua --- a/app/main/initiative/_action/reject_initiator_invitation.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/initiative/_action/reject_initiator_invitation.lua Thu Feb 16 14:08:55 2012 +0100 @@ -19,6 +19,6 @@ initiator.accepted = false initiator:save() -slot.put_into("notice", _"Invitation has been refused") +--slot.put_into("notice", _"Invitation has been refused") diff -r 23c98752e697 -r 808269b7f41c app/main/initiative/_action/remove_initiator.lua --- a/app/main/initiative/_action/remove_initiator.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/initiative/_action/remove_initiator.lua Thu Feb 16 14:08:55 2012 +0100 @@ -35,7 +35,7 @@ if #initiators > 1 or initiator_todelete.accepted ~= true then initiator_todelete:destroy() - slot.put_into("notice", _"Member has been removed from initiators") +-- slot.put_into("notice", _"Member has been removed from initiators") else slot.put_into("error", _"Can't remove last initiator") return false diff -r 23c98752e697 -r 808269b7f41c app/main/initiative/_current_draft.lua --- a/app/main/initiative/_current_draft.lua Thu Feb 16 14:08:43 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -local initiator = param.get("initiator", "table") -local initiative = param.get("initiative", "table") - -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" }, - content = function() - ui.image{ static = "icons/16/script_add.png" } - slot.put(_"Edit draft") - end, - module = "draft", - view = "new", - params = { initiative_id = initiative.id } - } -end - -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" }, - content = function() - ui.image{ static = "icons/16/script_delete.png" } - slot.put(_"Revoke initiative") - end, - module = "initiative", - view = "revoke", - id = initiative.id - } -end - -execute.view{ module = "draft", view = "_show", params = { draft = initiative.current_draft } } diff -r 23c98752e697 -r 808269b7f41c app/main/initiative/_list_element.lua --- a/app/main/initiative/_list_element.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/initiative/_list_element.lua Thu Feb 16 14:08:55 2012 +0100 @@ -26,7 +26,7 @@ records = { { a = 1} }, columns = { { - field_attr = { style = "width: 3em; padding: 0; text-align: center;"}, + field_attr = { style = "width: 3em; 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 } @@ -37,7 +37,7 @@ }, { - field_attr = { style = "width: 110px; padding: 0;"}, + field_attr = { style = "width: 110px;"}, content = function() if initiative.issue.fully_frozen and initiative.issue.closed then if initiative.issue.ranks_available then @@ -76,7 +76,6 @@ }, { - field_attr = { style = "padding: 0;"}, content = function() local link_class = "initiative_link" if initiative.revoked then diff -r 23c98752e697 -r 808269b7f41c app/main/initiative/_show.lua --- a/app/main/initiative/_show.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/initiative/_show.lua Thu Feb 16 14:08:55 2012 +0100 @@ -3,8 +3,10 @@ local initiators_members_selector = initiative:get_reference_selector("initiating_members") :add_field("initiator.accepted", "accepted") - -if not (initiator and initiator.accepted) then + :add_order_by("member.name") +if initiator and initiator.accepted then + initiators_members_selector:add_where("initiator.accepted ISNULL OR initiator.accepted") +else initiators_members_selector:add_where("initiator.accepted") end @@ -34,18 +36,32 @@ 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 + slot.put(" ") + ui.link{ + content = function () + execute.view{ + module = "member_image", + view = "_show", + params = { + member = initiator, + image_type = "avatar", + show_dummy = true, + class = "micro_avatar", + popup_text = text + } + } + end, + module = "member", view = "show", id = initiator.id + } + slot.put(" ") ui.link{ text = initiator.name, module = "member", view = "show", id = initiator.id } + if not initiator.accepted then + ui.tag{ attr = { title = _"Not accepted yet" }, content = "?" } + end end end } @@ -219,6 +235,16 @@ end +if app.session.member_id then + execute.view{ + module = "supporter", + view = "_show_box", + params = { + initiative = initiative + } + } +end + local supporter if app.session.member_id then @@ -268,17 +294,6 @@ end end - -if app.session.member_id then - execute.view{ - module = "supporter", - view = "_show_box", - params = { - initiative = initiative - } - } -end - execute.view{ module = "initiative", view = "show_tab", @@ -288,3 +303,8 @@ } } +if initiative.issue.snapshot then + ui.field.timestamp{ label = _"Last snapshot:", value = initiative.issue.snapshot } +end + + diff -r 23c98752e697 -r 808269b7f41c app/main/initiative/show_tab.lua --- a/app/main/initiative/show_tab.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/initiative/show_tab.lua Thu Feb 16 14:08:55 2012 +0100 @@ -23,11 +23,10 @@ name = "current_draft", label = current_draft_name, icon = { static = "icons/16/script.png" }, - module = "initiative", - view = "_current_draft", + module = "draft", + view = "_show", params = { - initiative = initiative, - initiator = initiator + draft = initiative.current_draft } } } diff -r 23c98752e697 -r 808269b7f41c app/main/issue/_list.lua --- a/app/main/issue/_list.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/issue/_list.lua Thu Feb 16 14:08:55 2012 +0100 @@ -47,13 +47,12 @@ 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 + slot.put(" · ") + ui.tag{ content = issue.area.name } + slot.put(" · ") + ui.tag{ content = issue.area.unit.name } + + end } ui.tag{ tag = "div", diff -r 23c98752e697 -r 808269b7f41c app/main/member/_area_list.lua --- a/app/main/member/_area_list.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/member/_area_list.lua Thu Feb 16 14:08:55 2012 +0100 @@ -6,23 +6,23 @@ :add_where{ "area.unit_id = ?", unit.id } :add_order_by("area.member_weight DESC") - if areas_selector:count() > 0 then + local area_count = areas_selector:count() + local class = "heading" + if area_count > 0 then + class = class .. " member_area_list" + end + ui.link{ + attr = { class = class }, + text = unit.name, + module = "area", view = "list", params = { unit_id = unit.id } + } + + if area_count > 0 then execute.view{ module = "area", view = "_list", - params = { areas_selector = areas_selector, title = function() - ui.link{ - attr = { class = "heading" }, - text = unit.name, - module = "area", view = "list", params = { unit_id = unit.id } - } - end}, + params = { areas_selector = areas_selector } } else - ui.link{ - attr = { class = "heading" }, - text = unit.name, - module = "area", view = "list", params = { unit_id = unit.id } - } ui.tag{ content = _"You have voting privileges for this unit, but you are not member of any of its areas." } slot.put(" ") ui.link{ diff -r 23c98752e697 -r 808269b7f41c app/main/member/edit.lua --- a/app/main/member/edit.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/member/edit.lua Thu Feb 16 14:08:55 2012 +0100 @@ -41,7 +41,57 @@ ui.field.text{ label = _"Profession", name = "profession" } ui.field.text{ label = _"External memberships", name = "external_memberships", multiline = true } ui.field.text{ label = _"External posts", name = "external_posts", multiline = true } - ui.field.text{ label = _"Statement", name = "statement", multiline = true, attr = { style = "height: 10em;" } } + + ui.field.select{ + label = _"Wiki engine for statement", + name = "formatting_engine", + foreign_records = { + { id = "rocketwiki", name = "RocketWiki" }, + { id = "compat", name = _"Traditional wiki syntax" } + }, + attr = {id = "formatting_engine"}, + foreign_id = "id", + foreign_name = "name", + value = param.get("formatting_engine") + } + ui.tag{ + tag = "div", + content = function() + ui.tag{ + tag = "label", + attr = { class = "ui_field_label" }, + content = function() slot.put(" ") end, + } + ui.tag{ + content = function() + ui.link{ + text = _"Syntax help", + module = "help", + view = "show", + id = "wikisyntax", + attr = {onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"} + } + slot.put(" ") + ui.link{ + text = _"(new window)", + module = "help", + view = "show", + id = "wikisyntax", + attr = {target = "_blank", onClick="this.href=this.href.replace(/wikisyntax[^.]*/g, 'wikisyntax_'+getElementById('formatting_engine').value)"} + } + end + } + end + } + ui.field.text{ + label = _"Statement", + name = "statement", + multiline = true, + attr = { style = "height: 50ex;" }, + value = param.get("statement") + } + + ui.submit{ value = _"Save" } end } \ No newline at end of file diff -r 23c98752e697 -r 808269b7f41c app/main/member/show_tab.lua --- a/app/main/member/show_tab.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/member/show_tab.lua Thu Feb 16 14:08:55 2012 +0100 @@ -168,7 +168,7 @@ icon = { static = "icons/16/folder.png" }, module = "issue", view = "_list", - params = { issues_selector = issues_selector, filter_interest = "my" }, + params = { issues_selector = issues_selector }, } local outgoing_delegations_selector = member:get_reference_selector("outgoing_delegations") diff -r 23c98752e697 -r 808269b7f41c app/main/opinion/_action/update.lua --- a/app/main/opinion/_action/update.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/opinion/_action/update.lua Thu Feb 16 14:08:55 2012 +0100 @@ -28,7 +28,7 @@ if opinion then opinion:destroy() end - slot.put_into("notice", _"Your rating has been deleted") + --slot.put_into("notice", _"Your rating has been deleted") return end @@ -52,4 +52,4 @@ opinion:save() -slot.put_into("notice", _"Your rating has been updated") +--slot.put_into("notice", _"Your rating has been updated") diff -r 23c98752e697 -r 808269b7f41c app/main/supporter/_show_box.lua --- a/app/main/supporter/_show_box.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/app/main/supporter/_show_box.lua Thu Feb 16 14:08:55 2012 +0100 @@ -109,8 +109,33 @@ id = initiative.id } end + if initiator and initiator.accepted and not initiative.issue.half_frozen and not initiative.issue.closed and not initiative.revoked then + ui.link{ + content = function() + ui.image{ static = "icons/16/script_add.png" } + slot.put(_"Edit draft") + end, + module = "draft", + view = "new", + params = { initiative_id = initiative.id } + } + end + + if initiator and initiator.accepted and not initiative.issue.half_frozen and not initiative.issue.closed and not initiative.revoked then + ui.link{ + content = function() + ui.image{ static = "icons/16/script_delete.png" } + slot.put(_"Revoke initiative") + end, + module = "initiative", + view = "revoke", + id = initiative.id + } + end end } + + slot.put("
") end } diff -r 23c98752e697 -r 808269b7f41c model/area.lua --- a/model/area.lua Thu Feb 16 14:08:43 2012 +0100 +++ b/model/area.lua Thu Feb 16 14:08:55 2012 +0100 @@ -79,7 +79,7 @@ function Area.object_get:name_with_unit_name() if not config.single_unit_id then - return self.unit.name .. " > " .. self.name + return self.unit.name .. ", " .. self.name else return self.name end diff -r 23c98752e697 -r 808269b7f41c model/rendered_suggestion.lua --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/model/rendered_suggestion.lua Thu Feb 16 14:08:55 2012 +0100 @@ -0,0 +1,11 @@ +RenderedSuggestion = mondelefant.new_class() +RenderedSuggestion.table = 'rendered_suggestion' +RenderedSuggestion.primary_key = { "suggestion_id", "format" } + +RenderedSuggestion:add_reference{ + mode = 'm1', + to = "Suggestion", + this_key = 'suggestion_id', + that_key = 'id', + ref = 'suggestion', +} diff -r 23c98752e697 -r 808269b7f41c static/style.css --- a/static/style.css Thu Feb 16 14:08:43 2012 +0100 +++ b/static/style.css Thu Feb 16 14:08:55 2012 +0100 @@ -205,7 +205,7 @@ ); text-shadow: #fff 0px 0px 3px; color: #000; - padding: 1ex 1em 0 1em; + padding: 1.5ex 1em 0 1em; } .title div { @@ -217,6 +217,12 @@ color: #000; } +.title .member_image { + margin-right: 0.7em; + vertical-align: middle; + border-radius: 7px; +} + .slot_title2 { margin-top: 1ex; margin-left: 1em; @@ -227,7 +233,7 @@ margin-bottom: 1ex; } -.member_image_avatar { +.member_list .member_image_avatar { float: left; margin-right: 0.5em; } @@ -236,12 +242,13 @@ width: 24px; height: 24px; border-radius: 4px; + vertical-align: middle; } .actions { font-size: 75%; line-height: 220%; - margin-top: 1ex; + margin-top: 2ex; margin-bottom: 2ex; } @@ -265,8 +272,9 @@ /*color-stop(0%,#AFEFB9), color-stop(100%,#ffffff) */ color-stop(0%, #fff), color-stop(15%,#e7e7e7), color-stop(100%,#fff) ); + margin-top: 2ex; padding-left: 1em; - padding-top: 1ex; + padding-top: 2ex; text-shadow: #fff 0px 0px 3px; } @@ -353,28 +361,16 @@ padding-right: 0.3em; } +.delegation .head_active, .interest .head_active, +.actions .supporter, .actions .potential_supporter { - background-color: #fec; - box-shadow: #fff 0px 0px 10px 1px; - border-radius: 5px; -} - -.actions .supporter { - background-color: #dfc; - box-shadow: #fff 0px 0px 10px 1px; + background-color: #cdf; border-radius: 5px; } .slot_support .head_initiator { background-color: #eee; - box-shadow: #fff 0px 0px 10px 1px; - border-radius: 5px; -} - -.delegation .head_active { - background-color: #ddf; - box-shadow: #fff 0px 0px 10px 1px; border-radius: 5px; } @@ -414,7 +410,7 @@ display: none; position: absolute; z-index: 10; - background-color: #ddddff; + background-color: #cdf; border-radius: 0 5px 5px 5px; padding: 1em; width: 35em; @@ -441,6 +437,10 @@ .vote_info .delegation_info { } +.vote_info a { + padding-right: 0; +} + .vote_info .member_thumb { clear: left; background: #fff; @@ -507,16 +507,16 @@ } .ui_tabs_links a.yellow { - background-color: #fec; + background-color: #fcc; color: #000; } .ui_tabs_links a.yellow:hover { - background-color: #edb; + background-color: #faa; } .ui_tabs_links a.yellow.selected { - background-color: #654; + background-color: #a44; color: #fff; text-decoration: none; padding: 1ex; @@ -811,12 +811,12 @@ padding: 1ex; line-height: 140%; background: -webkit-gradient(linear, left top, left bottom, - color-stop(0%,#e7e7e7), color-stop(33%, #f7f7f7), color-stop(66%,#fff)); + color-stop(0%,#e7e7e7), color-stop(66%,#fff)); } .issues .issue.interested .issue_info{ background: -webkit-gradient(linear, left top, left bottom, - color-stop(0%,#FFEECC), color-stop(33%, #FFF7E6), color-stop(66%,#fff)); + color-stop(0%,#cdf), color-stop(66%,#fff)); } .issues .issue .issue_info .issue_id { @@ -832,7 +832,7 @@ } .more_initiatives_link { - margin-left: 158px; + margin-left: 166px; font-style: italic; } @@ -845,16 +845,11 @@ font-weight: bold; } -.initiative_link.supported { +.initiative_link.supported, +.initiative_link.potentially_supported { background-color: #C9FFD1; border-radius: 5px; - background: -webkit-radial-gradient(center, ellipse cover, #c9ffd1 0%,#fff 100%); /* Chrome10+,Safari5.1+ */ -} - -.initiative_link.potentially_supported { - background-color: #FFEECC; - border-radius: 5px; - background: -webkit-radial-gradient(center, ellipse cover, #ffeecc 0%,#fff 100%); /* Chrome10+,Safari5.1+ */ + background: -webkit-radial-gradient(center, ellipse cover, #cdf 50%,#fff 100%); /* Chrome10+,Safari5.1+ */ } .lang_chooser { @@ -894,14 +889,16 @@ height: 48px; display: block; float: left; - border: 1px solid #999; + xborder: 1px solid #999; + background-color: #eee; overflow: hidden; xwhite-space: nowrap; position: relative; border-radius: 7px; + padding: 2px; } -.member_thumb a { +.xmember_thumb a { position: absolute; top: 0; left: 0; @@ -918,7 +915,7 @@ padding: 0; margin: 0; vertical-align: bottom; - border-radius: 7px 0 0 7px; + border-radius: 7px; } .member_thumb div { @@ -929,7 +926,7 @@ .member_thumb .member_name { position: absolute; - left: 48px; + left: 56px; top: 2ex; font-size: 100%; width: 14em; @@ -962,7 +959,7 @@ } .member_thumb.in_delegation_chain { - border-color: #f70; + background-color: #cdf; } .member_statement, @@ -1035,8 +1032,8 @@ .motd, .public_access_issue_head { background-color: #fec; - border: 1px solid #b96; padding: 1ex; + margin-top: 2ex; margin-bottom: 2ex; border-radius: 8px; } @@ -1130,6 +1127,10 @@ font-weight: bold; } +.heading.member_area_list { + position: absolute; +} + .heading.first { margin-top: 0; }