[ADD] added pager in bottom of list

bzr revid: tpa@tinyerp.com-20140224122726-g87zfwm5jlq5k2dc
This commit is contained in:
Turkesh Patel (Open ERP) 2014-02-24 17:57:26 +05:30
parent 45f6505bce
commit d2c447c80f
2 changed files with 8 additions and 3 deletions

View File

@ -36,7 +36,7 @@ controllers = controllers()
class website_forum(http.Controller):
@http.route(['/questions/', '/question/page/<int:page>'], type='http', auth="public", website=True, multilang=True)
@http.route(['/questions/', '/questions/page/<int:page>'], type='http', auth="public", website=True, multilang=True)
def questions(self, page=1, **searches):
cr, uid, context = request.cr, request.uid, request.context
forum_obj = request.registry['website.forum.post']
@ -46,7 +46,7 @@ class website_forum(http.Controller):
question_count = forum_obj.search(
request.cr, request.uid, [], count=True,
context=request.context)
pager = request.website.pager(url="/questions/", total=question_count, page=page, step=step, scope=5)
pager = request.website.pager(url="/questions/", total=question_count, page=page, step=step, scope=10)
obj_ids = forum_obj.search(
request.cr, request.uid, [], limit=step,
@ -118,7 +118,7 @@ class website_forum(http.Controller):
def tag_questions(self, tag, page=1, **kwargs):
cr, uid, context = request.cr, request.uid, request.context
step = 10
pager = request.website.pager(url="/questions/", total=len(tag.post_ids), page=page, step=step, scope=5)
pager = request.website.pager(url="/questions/", total=len(tag.post_ids), page=page, step=step, scope=10)
values = {
'question_ids': tag.post_ids,

View File

@ -189,6 +189,11 @@
<t t-call="website_forum.post_list" />
</li>
</ul>
<div class="col-sm-7">
<t t-call="website.pager" >
<t t-set="classname">pull-right</t>
</t>
</div>
</div>
</t>
</template>