liquid_feedback_frontend
annotate app/main/area/show.lua @ 118:93f4e465b50d
add initiator support in delegation
if a delegation is issued from the initiative view, the initiators
from that one are added to the delegation target list. this makes it easier to delegate to the author without the need to add him to the contact list.
if a delegation is issued from the initiative view, the initiators
from that one are added to the delegation target list. this makes it easier to delegate to the author without the need to add him to the contact list.
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Mon Sep 20 20:32:04 2010 +0200 (2010-09-20) |
parents | e0b091e2a0f3 |
children | c0835d707465 |
rev | line source |
---|---|
bsw/jbe@0 | 1 local area = Area:new_selector():add_where{ "id = ?", param.get_id() }:single_object_mode():exec() |
bsw/jbe@0 | 2 |
jorges@113 | 3 app.html_title.title = area.name |
jorges@113 | 4 app.html_title.subtitle = _("Area") |
jorges@113 | 5 |
bsw/jbe@52 | 6 if config.feature_rss_enabled then |
bsw/jbe@52 | 7 util.html_rss_head{ title = _"Initiatives in this area (last created first)", module = "initiative", view = "list_rss", params = { area_id = area.id } } |
bsw/jbe@52 | 8 util.html_rss_head{ title = _"Initiatives in this area (last updated first)", module = "initiative", view = "list_rss", params = { area_id = area.id } } |
bsw/jbe@52 | 9 end |
bsw/jbe@52 | 10 |
bsw/jbe@0 | 11 slot.put_into("title", encode.html(_"Area '#{name}'":gsub("#{name}", area.name))) |
bsw/jbe@0 | 12 |
bsw/jbe@0 | 13 ui.container{ |
bsw/jbe@0 | 14 attr = { class = "vertical"}, |
bsw/jbe@0 | 15 content = function() |
bsw/jbe@0 | 16 ui.field.text{ value = area.description } |
bsw/jbe@0 | 17 end |
bsw/jbe@0 | 18 } |
bsw/jbe@0 | 19 |
bsw@51 | 20 if app.session.member_id then |
bsw@51 | 21 slot.select("actions", function() |
bsw@51 | 22 ui.link{ |
bsw@51 | 23 content = function() |
bsw@51 | 24 ui.image{ static = "icons/16/folder_add.png" } |
bsw@51 | 25 slot.put(_"Create new issue") |
bsw@51 | 26 end, |
bsw@51 | 27 module = "initiative", |
bsw@51 | 28 view = "new", |
bsw@51 | 29 params = { area_id = area.id } |
bsw@51 | 30 } |
bsw@51 | 31 end) |
bsw@51 | 32 end |
bsw/jbe@0 | 33 |
bsw/jbe@4 | 34 util.help("area.show") |
bsw/jbe@4 | 35 |
bsw@51 | 36 if app.session.member_id then |
bsw@51 | 37 execute.view{ |
bsw@51 | 38 module = "membership", |
bsw@51 | 39 view = "_show_box", |
bsw@51 | 40 params = { area = area } |
bsw@51 | 41 } |
bsw/jbe@0 | 42 |
bsw@51 | 43 execute.view{ |
bsw@51 | 44 module = "delegation", |
bsw@51 | 45 view = "_show_box", |
bsw@51 | 46 params = { area_id = area.id } |
bsw@51 | 47 } |
bsw@51 | 48 |
bsw@51 | 49 end |
bsw/jbe@0 | 50 |
bsw/jbe@19 | 51 --[[ |
bsw/jbe@19 | 52 for i, issue in ipairs(area.issues) do |
bsw/jbe@19 | 53 local head_name = "issue_head_content_" .. tostring(issue.id) |
bsw/jbe@19 | 54 local name = "issue_content_" .. tostring(issue.id) |
bsw/jbe@19 | 55 local icon_name = "issue_icon_" .. tostring(issue.id) |
bsw/jbe@19 | 56 ui.container{ |
bsw/jbe@19 | 57 attr = { class = "ui_tabs" }, |
bsw/jbe@0 | 58 content = function() |
bsw/jbe@19 | 59 local onclick = |
bsw/jbe@19 | 60 'if (ui_tabs_active["' .. name .. '"]) {' .. |
bsw/jbe@19 | 61 'el=document.getElementById("' .. name .. '");' .. |
bsw/jbe@19 | 62 'el.innerHTML="";' .. |
bsw/jbe@19 | 63 'el.style.display="none";' .. |
bsw/jbe@19 | 64 'ui_tabs_active["' .. name .. '"]=false' .. |
bsw/jbe@19 | 65 '} else {' .. |
bsw/jbe@19 | 66 'ui_tabs_active["' .. name .. '"]=true;' .. |
bsw/jbe@19 | 67 'document.getElementById("' .. name .. '").style.display="block"; ' .. |
bsw/jbe@19 | 68 'var hourglass_el = document.getElementById("' .. icon_name .. '");' .. |
bsw/jbe@19 | 69 'var hourglass_src = hourglass_el.src;' .. |
bsw/jbe@19 | 70 'hourglass_el.src = "' .. encode.url{ static = "icons/16/connect.png" } .. '";' .. |
bsw/jbe@19 | 71 'partialMultiLoad(' .. |
bsw/jbe@19 | 72 '{ trace: "trace", system_error: "system_error", ' .. name .. '_title: "title", ' .. name .. '_actions: "actions", ' .. name .. '_content: "default" },' .. |
bsw/jbe@19 | 73 '{},' .. |
bsw/jbe@19 | 74 '"error",' .. |
bsw/jbe@19 | 75 '"' .. request.get_relative_baseurl() .. 'issue/show/' .. tostring(issue.id) .. '.html?&_webmcp_json_slots[]=title&_webmcp_json_slots[]=actions&_webmcp_json_slots[]=default&_webmcp_json_slots[]=trace&_webmcp_json_slots[]=system_error&dyn=1",' .. |
bsw/jbe@19 | 76 '{},' .. |
bsw/jbe@19 | 77 '{},' .. |
bsw/jbe@19 | 78 'function() {' .. |
bsw/jbe@19 | 79 'hourglass_el.src = hourglass_src;' .. |
bsw/jbe@19 | 80 '},' .. |
bsw/jbe@19 | 81 'function() {' .. |
bsw/jbe@19 | 82 'hourglass_el.src = hourglass_src;' .. |
bsw/jbe@19 | 83 '}' .. |
bsw/jbe@19 | 84 '); ' .. |
bsw/jbe@19 | 85 '}' .. |
bsw/jbe@19 | 86 'return(false);' |
bsw/jbe@19 | 87 ui.link{ |
bsw/jbe@19 | 88 attr = { |
bsw/jbe@19 | 89 name = name, |
bsw/jbe@19 | 90 class = "ui_tabs_accordeon_head", |
bsw/jbe@19 | 91 id = head_name, |
bsw/jbe@19 | 92 onclick = onclick, |
bsw/jbe@19 | 93 }, |
bsw/jbe@19 | 94 module = "issue", |
bsw/jbe@19 | 95 view = "show", |
bsw/jbe@19 | 96 id = issue.id, |
bsw/jbe@19 | 97 params = params, |
bsw/jbe@19 | 98 anchor = name, |
bsw/jbe@19 | 99 content = function() |
bsw/jbe@19 | 100 ui.image{ |
bsw/jbe@19 | 101 attr = { id = icon_name }, |
bsw/jbe@19 | 102 static = "icons/16/script.png" |
bsw/jbe@19 | 103 } |
bsw/jbe@19 | 104 ui.container{ |
bsw/jbe@19 | 105 attr = { style = "float: right;" }, |
bsw/jbe@19 | 106 content = function() |
bsw/jbe@19 | 107 |
bsw/jbe@19 | 108 end |
bsw/jbe@19 | 109 } |
bsw/jbe@19 | 110 slot.put(tostring(issue.id)) |
bsw/jbe@19 | 111 end |
bsw/jbe@0 | 112 } |
bsw/jbe@0 | 113 end |
bsw/jbe@19 | 114 } |
bsw/jbe@19 | 115 |
bsw/jbe@19 | 116 ui.container{ |
bsw/jbe@19 | 117 attr = { |
bsw/jbe@19 | 118 id = name, |
bsw/jbe@19 | 119 class = "ui_tabs_accordeon_content", |
bsw/jbe@19 | 120 }, |
bsw/jbe@0 | 121 content = function() |
bsw/jbe@19 | 122 ui.container{ attr = { id = name .. "_title", }, content = function() slot.put(" ") end } |
bsw/jbe@19 | 123 ui.container{ attr = { id = name .. "_actions", }, content = function() slot.put(" ") end } |
bsw/jbe@19 | 124 ui.container{ attr = { id = name .. "_content", }, content = function() |
bsw/jbe@19 | 125 execute.view{ |
bsw/jbe@19 | 126 module = "initiative", |
bsw/jbe@19 | 127 view = "_list", |
bsw/jbe@19 | 128 params = { |
bsw/jbe@19 | 129 issue = issue, |
bsw/jbe@19 | 130 initiatives_selector = issue:get_reference_selector("initiatives"), |
bsw/jbe@19 | 131 limit = 3, |
bsw/jbe@19 | 132 per_page = 3, |
bsw/jbe@19 | 133 no_sort = true, |
bsw/jbe@19 | 134 } |
bsw/jbe@19 | 135 } |
bsw/jbe@19 | 136 end } |
bsw/jbe@0 | 137 end |
bsw/jbe@19 | 138 } |
bsw/jbe@19 | 139 |
bsw/jbe@19 | 140 if config.user_tab_mode == "accordeon_all_expanded" then |
bsw/jbe@19 | 141 ui.script{ script = 'document.getElementById("' .. head_name .. '").onclick();' } |
bsw/jbe@19 | 142 end |
bsw/jbe@19 | 143 end |
bsw/jbe@19 | 144 --]] |
bsw/jbe@19 | 145 |
bsw/jbe@19 | 146 execute.view{ |
bsw/jbe@19 | 147 module = "area", |
bsw/jbe@19 | 148 view = "show_tab", |
bsw/jbe@19 | 149 params = { area = area } |
bsw/jbe@0 | 150 } |
bsw/jbe@0 | 151 |