liquid_feedback_frontend
diff app/main/issue/_show_head.lua @ 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 | 850d02b1fc6d |
children | 6725c13b6ce0 |
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