# HG changeset patch # User Daniel Poelzleithner # Date 1286504960 -7200 # Node ID eaf3db89a6e1a020d2b1d10f5f65eca6787c7781 # Parent d87097d3b6ec1eb9b8d08e4dc0b930bb59d2bd69 implement initiative pager in content_navigation this allows you to swtich between the initiatives very quickly diff -r d87097d3b6ec -r eaf3db89a6e1 app/main/issue/_show_head.lua --- a/app/main/issue/_show_head.lua Fri Oct 08 03:25:59 2010 +0200 +++ b/app/main/issue/_show_head.lua Fri Oct 08 04:29:20 2010 +0200 @@ -40,7 +40,7 @@ slot.select("content_navigation", function() if app.session.member_id then - + local records local this = 0 local issues_selector = Issue:new_selector() @@ -55,9 +55,9 @@ } - local mk_link = function(index, text, icon, ltr) + local mk_link = function(index, text, icon, module) content = function() - if ltr then + if index > 0 then slot.put(text) ui.image{ static = "icons/16/"..icon } else @@ -68,7 +68,7 @@ if records[this+index] then ui.link{ content = content, - module = "issue", + module = module, view = "show", id = records[this+index].id, } @@ -117,7 +117,7 @@ end end - mk_link(-1, _("Previous issue"), "resultset_previous.png") + mk_link(-1, _("Previous issue"), "resultset_previous.png", "issue") if issue.area then ui.link{ content = function() @@ -136,7 +136,22 @@ } } end - mk_link(1, _("Next issue"), "resultset_next.png", 1) + mk_link(1, _("Next issue"), "resultset_next.png", "issue") + + -- show pager for initiatives if available + if initiative then + ui.container{ content = function() end, attr = {class = "content_navigation_seperator"}} + + records = issue:get_reference_selector("initiatives"):exec() + for i,cissue in ipairs(records) do + if cissue.id == initiative.id then + this = i + break + end + end + mk_link(-1, _("Previous initiative"), "resultset_previous.png", "initiative") + mk_link(1, _("Next initiative"), "resultset_next.png", "initiative") + end end end diff -r d87097d3b6ec -r eaf3db89a6e1 static/style.css --- a/static/style.css Fri Oct 08 03:25:59 2010 +0200 +++ b/static/style.css Fri Oct 08 04:29:20 2010 +0200 @@ -275,6 +275,11 @@ background-color: #d7d7d7; } +.content_navigation_seperator { + height: 1.4em; + border-left: 1px solid black; +} + .actions a:hover { background-color: #d7d7d7; }