liquid_feedback_frontend
changeset 150:eaf3db89a6e1
implement initiative pager in content_navigation
this allows you to swtich between the initiatives very quickly
this allows you to swtich between the initiatives very quickly
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Fri Oct 08 04:29:20 2010 +0200 (2010-10-08) |
parents | d87097d3b6ec |
children | 1652c4cd3154 |
files | app/main/issue/_show_head.lua static/style.css |
line diff
1.1 --- a/app/main/issue/_show_head.lua Fri Oct 08 03:25:59 2010 +0200 1.2 +++ b/app/main/issue/_show_head.lua Fri Oct 08 04:29:20 2010 +0200 1.3 @@ -40,7 +40,7 @@ 1.4 slot.select("content_navigation", function() 1.5 1.6 if app.session.member_id then 1.7 - 1.8 + local records 1.9 local this = 0 1.10 local issues_selector = Issue:new_selector() 1.11 1.12 @@ -55,9 +55,9 @@ 1.13 } 1.14 1.15 1.16 - local mk_link = function(index, text, icon, ltr) 1.17 + local mk_link = function(index, text, icon, module) 1.18 content = function() 1.19 - if ltr then 1.20 + if index > 0 then 1.21 slot.put(text) 1.22 ui.image{ static = "icons/16/"..icon } 1.23 else 1.24 @@ -68,7 +68,7 @@ 1.25 if records[this+index] then 1.26 ui.link{ 1.27 content = content, 1.28 - module = "issue", 1.29 + module = module, 1.30 view = "show", 1.31 id = records[this+index].id, 1.32 } 1.33 @@ -117,7 +117,7 @@ 1.34 end 1.35 end 1.36 1.37 - mk_link(-1, _("Previous issue"), "resultset_previous.png") 1.38 + mk_link(-1, _("Previous issue"), "resultset_previous.png", "issue") 1.39 if issue.area then 1.40 ui.link{ 1.41 content = function() 1.42 @@ -136,7 +136,22 @@ 1.43 } 1.44 } 1.45 end 1.46 - mk_link(1, _("Next issue"), "resultset_next.png", 1) 1.47 + mk_link(1, _("Next issue"), "resultset_next.png", "issue") 1.48 + 1.49 + -- show pager for initiatives if available 1.50 + if initiative then 1.51 + ui.container{ content = function() end, attr = {class = "content_navigation_seperator"}} 1.52 + 1.53 + records = issue:get_reference_selector("initiatives"):exec() 1.54 + for i,cissue in ipairs(records) do 1.55 + if cissue.id == initiative.id then 1.56 + this = i 1.57 + break 1.58 + end 1.59 + end 1.60 + mk_link(-1, _("Previous initiative"), "resultset_previous.png", "initiative") 1.61 + mk_link(1, _("Next initiative"), "resultset_next.png", "initiative") 1.62 + end 1.63 end 1.64 end 1.65
2.1 --- a/static/style.css Fri Oct 08 03:25:59 2010 +0200 2.2 +++ b/static/style.css Fri Oct 08 04:29:20 2010 +0200 2.3 @@ -275,6 +275,11 @@ 2.4 background-color: #d7d7d7; 2.5 } 2.6 2.7 +.content_navigation_seperator { 2.8 + height: 1.4em; 2.9 + border-left: 1px solid black; 2.10 +} 2.11 + 2.12 .actions a:hover { 2.13 background-color: #d7d7d7; 2.14 }