liquid_feedback_frontend
changeset 1602:a3a7120a67be
Show unit and area head in sidebar
author | bsw |
---|---|
date | Mon Feb 01 14:32:47 2021 +0100 (2021-02-01) |
parents | 7da942c0ed5d |
children | d14462e2b38b |
files | app/main/area/_head.lua app/main/index/_head.lua app/main/index/index.lua app/main/initiative/show.lua app/main/issue/_list.lua app/main/issue/show.lua app/main/unit/_head.lua |
line diff
1.1 --- a/app/main/area/_head.lua Mon Feb 01 12:58:17 2021 +0100 1.2 +++ b/app/main/area/_head.lua Mon Feb 01 14:32:47 2021 +0100 1.3 @@ -1,5 +1,4 @@ 1.4 local area = param.get("area", "table") 1.5 -local member = param.get("member", "table") 1.6 1.7 ui.title ( function () 1.8 1.9 @@ -10,30 +9,13 @@ 1.10 ui.tag{ attr = { class = "name" }, content = area.unit.name } 1.11 end, 1.12 module = "index", view = "index", 1.13 - unit = area.unit_id 1.14 + params = { unit = area.unit_id } 1.15 } 1.16 1.17 ui.tag { attr = { class = "spacer" }, content = function() 1.18 slot.put ( " ยป " ) 1.19 end } 1.20 1.21 - ui.tag { attr = { class = "area" }, content = function() 1.22 - -- area link 1.23 - ui.link { 1.24 - content = function() 1.25 - ui.tag{ attr = { class = "name" }, content = area.name } 1.26 - end, 1.27 - module = "index", view = "index", 1.28 - params = { unit = area.unit_id, area = area.id } 1.29 - } 1.30 - 1.31 - slot.put ( " " ) 1.32 - 1.33 - execute.view { 1.34 - module = "delegation", view = "_info", params = { 1.35 - area = area, member = member, for_title = true 1.36 - } 1.37 - } 1.38 - end } 1.39 + ui.tag{ content = area.name } 1.40 1.41 end )
2.1 --- a/app/main/index/_head.lua Mon Feb 01 12:58:17 2021 +0100 2.2 +++ b/app/main/index/_head.lua Mon Feb 01 14:32:47 2021 +0100 2.3 @@ -1,5 +1,13 @@ 2.4 local unit_id = config.single_unit_id or request.get_param{ name = "unit" } 2.5 local area_id = config.single_area_id or request.get_param{ name = "area" } 2.6 + 2.7 +local initiative = param.get("initiative", "table") 2.8 +local issue = param.get("issue", "table") 2.9 +if issue then 2.10 + area_id = issue.area_id 2.11 + unit_id = issue.area.unit_id 2.12 +end 2.13 + 2.14 if unit_id == "all" then 2.15 unit_id = nil 2.16 area_id = nil
3.1 --- a/app/main/index/index.lua Mon Feb 01 12:58:17 2021 +0100 3.2 +++ b/app/main/index/index.lua Mon Feb 01 14:32:47 2021 +0100 3.3 @@ -25,6 +25,7 @@ 3.4 request.set_status("404 Not Found") 3.5 return 3.6 end 3.7 + unit:load_delegation_info_once_for_member_id(app.session.member_id) 3.8 end 3.9 3.10 3.11 @@ -35,17 +36,27 @@ 3.12 request.set_status("404 Not Found") 3.13 return 3.14 end 3.15 + area:load_delegation_info_once_for_member_id(app.session.member_id) 3.16 end 3.17 3.18 +if area then 3.19 + execute.view{ module = "area", view = "_head", params = { area = area } } 3.20 +elseif unit then 3.21 + execute.view{ module = "unit", view = "_head", params = { unit = unit } } 3.22 +end 3.23 + 3.24 + 3.25 ui.grid{ content = function() 3.26 ui.cell_main{ content = function() 3.27 3.28 execute.view{ module = "index", view = "_sidebar_motd_public" } 3.29 - 3.30 + 3.31 execute.view{ module = "issue", view = "_list" } 3.32 end } 3.33 3.34 ui.cell_sidebar{ content = function() 3.35 + execute.view{ module = "index", view = "_head" } 3.36 + 3.37 execute.view{ module = "index", view = "_sidebar_motd" } 3.38 if app.session.member then 3.39 execute.view{ module = "index", view = "_sidebar_notifications" }
4.1 --- a/app/main/initiative/show.lua Mon Feb 01 12:58:17 2021 +0100 4.2 +++ b/app/main/initiative/show.lua Mon Feb 01 14:32:47 2021 +0100 4.3 @@ -202,6 +202,9 @@ 4.4 if config.logo then 4.5 config.logo() 4.6 end 4.7 + execute.view{ module = "index", view = "_head", params = { 4.8 + issue = initiative.issue, initiative = initiative 4.9 + } } 4.10 execute.view { 4.11 module = "issue", view = "_sidebar", 4.12 params = {
5.1 --- a/app/main/issue/_list.lua Mon Feb 01 12:58:17 2021 +0100 5.2 +++ b/app/main/issue/_list.lua Mon Feb 01 14:32:47 2021 +0100 5.3 @@ -386,7 +386,6 @@ 5.4 if mode == "timeline" then 5.5 --dotabs() 5.6 filters.content = function() 5.7 - execute.view{ module = "index", view = "_head" } 5.8 doit() 5.9 end 5.10 else 5.11 @@ -405,7 +404,7 @@ 5.12 selector:add_order_by ( "id" ) 5.13 end 5.14 if not search then 5.15 - execute.view{ module = "index", view = "_head" } 5.16 +-- execute.view{ module = "index", view = "_head" } 5.17 end 5.18 ui.paginate{ 5.19 selector = selector,
6.1 --- a/app/main/issue/show.lua Mon Feb 01 12:58:17 2021 +0100 6.2 +++ b/app/main/issue/show.lua Mon Feb 01 14:32:47 2021 +0100 6.3 @@ -108,6 +108,9 @@ 6.4 if config.logo then 6.5 config.logo() 6.6 end 6.7 + 6.8 + execute.view{ module = "index", view = "_head", params = { issue = issue } } 6.9 + 6.10 execute.view { 6.11 module = "issue", view = "_sidebar", 6.12 params = {
7.1 --- a/app/main/unit/_head.lua Mon Feb 01 12:58:17 2021 +0100 7.2 +++ b/app/main/unit/_head.lua Mon Feb 01 14:32:47 2021 +0100 7.3 @@ -2,31 +2,6 @@ 7.4 7.5 ui.title ( function () 7.6 7.7 - ui.tag{ attr = { class = "unit" }, content = function() 7.8 - -- unit link 7.9 - ui.link { 7.10 - attr = { class = "unit" }, 7.11 - content = function() 7.12 - ui.tag{ attr = { class = "name" }, content = unit.name } 7.13 - end, 7.14 - module = "unit", view = "show", 7.15 - id = unit.id 7.16 - } 7.17 - 7.18 - execute.view { 7.19 - module = "delegation", view = "_info", params = { 7.20 - unit = unit, member = member 7.21 - } 7.22 - } 7.23 - 7.24 - if config.single_unit_id and not app.session.member_id and config.motd_public then 7.25 - ui.container{ 7.26 - attr = { class = "wiki motd" }, 7.27 - content = function() 7.28 - slot.put(config.motd_public) 7.29 - end 7.30 - } 7.31 - end 7.32 - end } 7.33 + ui.tag{ content = unit.name } 7.34 7.35 end )