Changeset - bec04f371579
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 13 years ago 2013-05-12 14:14:59
marcin@python-works.com
Gist: added shortcut for my public gists
3 files changed with 10 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/admin/gists.py
Show inline comments
 
@@ -66,12 +66,18 @@ class GistsController(BaseController):
 
        """GET /admin/gists: All items in the collection"""
 
        # url('gists')
 
        c.show_private = request.GET.get('private') and c.rhodecode_user.username != 'default'
 
        c.show_public = request.GET.get('public') and c.rhodecode_user.username != 'default'
 

	
 
        gists = Gist().query()\
 
            .filter(or_(Gist.gist_expires == -1, Gist.gist_expires >= time.time()))\
 
            .order_by(Gist.created_on.desc())
 
        if c.show_private:
 
            c.gists = gists.filter(Gist.gist_type == Gist.GIST_PRIVATE)\
 
                             .filter(Gist.gist_owner == c.rhodecode_user.user_id)
 
        elif c.show_public:
 
            c.gists = gists.filter(Gist.gist_type == Gist.GIST_PUBLIC)\
 
                             .filter(Gist.gist_owner == c.rhodecode_user.user_id)
 

	
 
        else:
 
            c.gists = gists.filter(Gist.gist_type == Gist.GIST_PUBLIC)
 
        p = safe_int(request.GET.get('page', 1), 1)
rhodecode/templates/admin/gists/index.html
Show inline comments
 
@@ -8,6 +8,8 @@
 
<%def name="breadcrumbs_links()">
 
    %if c.show_private:
 
        ${_('Private Gists for user %s') % c.rhodecode_user.username}
 
    %elif c.show_public:
 
        ${_('Public Gists for user %s') % c.rhodecode_user.username}
 
    %else:
 
        ${_('Public Gists')}
 
    %endif
rhodecode/templates/base/base.html
Show inline comments
 
@@ -292,8 +292,9 @@
 
              </a>
 
                <ul class="admin_menu">
 
                  <li>${h.link_to(_('Create new gist'),h.url('new_gist'),class_='gists-new ')}</li>
 
                  <li>${h.link_to(_('Public gists'),h.url('gists'),class_='gists ')}</li>
 
                  <li>${h.link_to(_('All public gists'),h.url('gists'),class_='gists ')}</li>
 
                  %if c.rhodecode_user.username != 'default':
 
                    <li>${h.link_to(_('My public gists'),h.url('gists', public=1),class_='gists')}</li>
 
                    <li>${h.link_to(_('My private gists'),h.url('gists', private=1),class_='gists-private ')}</li>
 
                  %endif
 
                </ul>
0 comments (0 inline, 0 general)