Skip to content

Commit

Permalink
Merge branch 'hotfix/0.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
mitechie committed May 10, 2011
2 parents 6e0e4e5 + 430d525 commit 7277305
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 3 additions & 3 deletions bookie/templates/bmark/func.mako
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
</div> </div>
</%def> </%def>


<%def name="bmarknextprev(page, max_count, count, next_url, url_params=None)"> <%def name="bmarknextprev(page, max_count, count, next_url, url_params=None, tags=None)">
<% <%
if max_count == count: if max_count == count:
show_next = True show_next = True
Expand All @@ -116,12 +116,12 @@
%> %>
% if page != 0: % if page != 0:
<a href="${request.route_url(next_url, **url_params)}?page=${prev}" <a href="${request.route_url(next_url, tags=tags, **url_params)}?page=${prev}"
class="button">Prev</a> class="button">Prev</a>
% endif % endif
% if show_next: % if show_next:
<a href="${request.route_url(next_url, **url_params)}?page=${next}" <a href="${request.route_url(next_url, tags=tags, **url_params)}?page=${next}"
class="button">Next</a> class="button">Next</a>
% endif % endif
Expand Down
10 changes: 8 additions & 2 deletions bookie/templates/bmark/recent.mako
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
<h1></h1> <h1></h1>


<!-- Show the tag filter ui --> <!-- Show the tag filter ui -->
<%
if tags:
url = 'bmark_recent_tags'
else:
url = 'bmark_recent'
%>
<div class="yui3-g data_list"> <div class="yui3-g data_list">
<div class="yui3-u-2-3"> <div class="yui3-u-2-3">
${tag_filter(tags)} ${tag_filter(tags)}
Expand All @@ -14,7 +20,7 @@


<div class="yui3-u-7-8">&nbsp;</div> <div class="yui3-u-7-8">&nbsp;</div>
<div class="yui3-u-1-8 col_end buttons"> <div class="yui3-u-1-8 col_end buttons">
${bmarknextprev(page, max_count, count, 'bmark_recent')} ${bmarknextprev(page, max_count, count, url, tags=tags)}
</div> </div>


<div class="yui3-u-1 data_body"> <div class="yui3-u-1 data_body">
Expand All @@ -24,6 +30,6 @@
<div class="yui3-u-7-8">&nbsp;</div> <div class="yui3-u-7-8">&nbsp;</div>


<div class="yui3-u-1-8 col_end buttons"> <div class="yui3-u-1-8 col_end buttons">
${bmarknextprev(page, max_count, count, 'bmark_recent')} ${bmarknextprev(page, max_count, count, url, tags=tags)}
</div> </div>
</div> </div>
6 changes: 3 additions & 3 deletions bookie/views/bmarks.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def recent(request):
# do we have any tags to filter upon # do we have any tags to filter upon
tags = rdict.get('tags', None) tags = rdict.get('tags', None)


if isinstance(tags, str):
tags = [tags]

# if we don't have tags, we might have them sent by a non-js browser as a # if we don't have tags, we might have them sent by a non-js browser as a
# string in a query string # string in a query string
if not tags and 'tag_filter' in params: if not tags and 'tag_filter' in params:
Expand All @@ -37,7 +40,6 @@ def recent(request):
LOG.debug('tags') LOG.debug('tags')
LOG.debug(tags) LOG.debug(tags)



recent_list = BmarkMgr.find(limit=RESULTS_MAX, recent_list = BmarkMgr.find(limit=RESULTS_MAX,
order_by=Bmark.stored.desc(), order_by=Bmark.stored.desc(),
tags=tags, tags=tags,
Expand All @@ -54,8 +56,6 @@ def recent(request):
'allow_edit': access.edit_enabled(request.registry.settings), 'allow_edit': access.edit_enabled(request.registry.settings),
} }


LOG.debug('RET')
LOG.debug(ret)
return ret return ret




Expand Down

0 comments on commit 7277305

Please sign in to comment.