Show More
@@ -66,12 +66,18 b' class GistsController(BaseController):' | |||
|
66 | 66 | """GET /admin/gists: All items in the collection""" |
|
67 | 67 | # url('gists') |
|
68 | 68 | c.show_private = request.GET.get('private') and c.rhodecode_user.username != 'default' |
|
69 | c.show_public = request.GET.get('public') and c.rhodecode_user.username != 'default' | |
|
70 | ||
|
69 | 71 | gists = Gist().query()\ |
|
70 | 72 | .filter(or_(Gist.gist_expires == -1, Gist.gist_expires >= time.time()))\ |
|
71 | 73 | .order_by(Gist.created_on.desc()) |
|
72 | 74 | if c.show_private: |
|
73 | 75 | c.gists = gists.filter(Gist.gist_type == Gist.GIST_PRIVATE)\ |
|
74 | 76 | .filter(Gist.gist_owner == c.rhodecode_user.user_id) |
|
77 | elif c.show_public: | |
|
78 | c.gists = gists.filter(Gist.gist_type == Gist.GIST_PUBLIC)\ | |
|
79 | .filter(Gist.gist_owner == c.rhodecode_user.user_id) | |
|
80 | ||
|
75 | 81 | else: |
|
76 | 82 | c.gists = gists.filter(Gist.gist_type == Gist.GIST_PUBLIC) |
|
77 | 83 | p = safe_int(request.GET.get('page', 1), 1) |
@@ -8,6 +8,8 b'' | |||
|
8 | 8 | <%def name="breadcrumbs_links()"> |
|
9 | 9 | %if c.show_private: |
|
10 | 10 | ${_('Private Gists for user %s') % c.rhodecode_user.username} |
|
11 | %elif c.show_public: | |
|
12 | ${_('Public Gists for user %s') % c.rhodecode_user.username} | |
|
11 | 13 | %else: |
|
12 | 14 | ${_('Public Gists')} |
|
13 | 15 | %endif |
@@ -292,8 +292,9 b'' | |||
|
292 | 292 | </a> |
|
293 | 293 | <ul class="admin_menu"> |
|
294 | 294 | <li>${h.link_to(_('Create new gist'),h.url('new_gist'),class_='gists-new ')}</li> |
|
295 |
<li>${h.link_to(_(' |
|
|
295 | <li>${h.link_to(_('All public gists'),h.url('gists'),class_='gists ')}</li> | |
|
296 | 296 | %if c.rhodecode_user.username != 'default': |
|
297 | <li>${h.link_to(_('My public gists'),h.url('gists', public=1),class_='gists')}</li> | |
|
297 | 298 | <li>${h.link_to(_('My private gists'),h.url('gists', private=1),class_='gists-private ')}</li> |
|
298 | 299 | %endif |
|
299 | 300 | </ul> |
General Comments 0
You need to be logged in to leave comments.
Login now