Changeset - a39c0e5fca89
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 14 years ago 2011-09-22 02:08:02
marcin@python-works.com
removed obsolete sort code
3 files changed with 13 insertions and 58 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/admin/repos_groups.py
Show inline comments
 
@@ -165,11 +165,10 @@ class ReposGroupsController(BaseControll
 
                    category='error')
 
            return redirect(url('repos_groups'))
 

	
 

	
 
        try:
 
            repos_group_model.delete(id)
 
            h.flash(_('removed repos group %s' % gr.group_name), category='success')
 
            #TODO: in futureaction_logger(, '', '', '', self.sa)
 
            #TODO: in future action_logger(, '', '', '', self.sa)
 
        except Exception:
 
            log.error(traceback.format_exc())
 
            h.flash(_('error occurred during deletion of repos group %s' % gr.group_name),
 
@@ -181,27 +180,13 @@ class ReposGroupsController(BaseControll
 
        """GET /repos_groups/id: Show a specific item"""
 
        # url('repos_group', id=ID)
 

	
 
        gr = c.group = Group.get(id)
 
        c.group = Group.get(id)
 

	
 
        if c.group:
 
            c.group_repos = c.group.repositories.all()
 
        else:
 
            return redirect(url('home'))
 

	
 

	
 
        sortables = ['name', 'description', 'last_change', 'tip', 'owner']
 
        current_sort = request.GET.get('sort', 'name')
 
        current_sort_slug = current_sort.replace('-', '')
 

	
 
        if current_sort_slug not in sortables:
 
            c.sort_by = 'name'
 
            current_sort_slug = c.sort_by
 
        else:
 
            c.sort_by = current_sort
 
        c.sort_slug = current_sort_slug
 

	
 
        sort_key = current_sort_slug + '_sort'
 

	
 
        #overwrite our cached list with current filter
 
        gr_filter = c.group_repos
 
        c.cached_repo_list = self.scm_model.get_repos(all_repos=gr_filter)
 
@@ -220,13 +205,13 @@ class ReposGroupsController(BaseControll
 
        """GET /repos_groups/id/edit: Form to edit an existing item"""
 
        # url('edit_repos_group', id=ID)
 

	
 
        id = int(id)
 
        id_ = int(id)
 

	
 
        c.repos_group = Group.get(id)
 
        defaults = self.__load_data(id)
 
        c.repos_group = Group.get(id_)
 
        defaults = self.__load_data(id_)
 

	
 
        # we need to exclude this group from the group list for editing
 
        c.repo_groups = filter(lambda x:x[0] != id, c.repo_groups)
 
        c.repo_groups = filter(lambda x:x[0] != id_, c.repo_groups)
 

	
 
        return htmlfill.render(
 
            render('admin/repos_groups/repos_groups_edit.html'),
rhodecode/controllers/home.py
Show inline comments
 
@@ -43,20 +43,8 @@ class HomeController(BaseController):
 
        super(HomeController, self).__before__()
 

	
 
    def index(self):
 
        sortables = ['name', 'description', 'last_change', 'tip', 'owner']
 
        current_sort = request.GET.get('sort', 'name')
 
        current_sort_slug = current_sort.replace('-', '')
 

	
 
        if current_sort_slug not in sortables:
 
            c.sort_by = 'name'
 
            current_sort_slug = c.sort_by
 
        else:
 
            c.sort_by = current_sort
 
        c.sort_slug = current_sort_slug
 

	
 
        sort_key = current_sort_slug + '_sort'
 

	
 
        c.repos_list = self.scm_model.get_repos(sort_key=sort_key)
 
        c.repos_list = self.scm_model.get_repos()
 

	
 
        c.groups = Group.query().filter(Group.group_parent_id == None).all()
 

	
rhodecode/templates/index_base.html
Show inline comments
 
<%page args="parent" /> 
 
    <%def name="get_sort(name)">
 
        <%name_slug = name.lower().replace(' ','_') %>
 
        
 
        %if name_slug == c.sort_slug:
 
          %if c.sort_by.startswith('-'):
 
            <a href="?sort=${name_slug}">${name}&uarr;</a>
 
          %else:
 
            <a href="?sort=-${name_slug}">${name}&darr;</a>
 
          %endif:
 
        %else:
 
            <a href="?sort=${name_slug}">${name}</a>
 
        %endif
 
    </%def>
 
    
 
    <div class="box">
 
        <!-- box / title -->
 
        <div class="title">
 
@@ -67,11 +53,11 @@
 
            <thead>
 
                <tr>
 
                    <th class="left"></th>
 
                    <th class="left">${get_sort(_('Name'))}</th>
 
                    <th class="left">${get_sort(_('Description'))}</th>
 
                    <th class="left">${get_sort(_('Last change'))}</th>
 
                    <th class="left">${get_sort(_('Tip'))}</th>
 
                    <th class="left">${get_sort(_('Owner'))}</th>
 
                    <th class="left">${_('Name')}</th>
 
                    <th class="left">${_('Description')}</th>
 
                    <th class="left">${_('Last change')}</th>
 
                    <th class="left">${_('Tip')}</th>
 
                    <th class="left">${_('Owner')}</th>
 
                    <th class="left">${_('RSS')}</th>
 
                    <th class="left">${_('Atom')}</th>
 
                </tr>
 
@@ -145,10 +131,7 @@
 
                    </td>
 
                    <td>
 
                        %if repo['rev']>=0:
 
                        ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])),
 
                        h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']),
 
                        class_="tooltip",
 
                        title=h.tooltip('%s\n%s' % (repo['author'],repo['last_msg'])))}
 
                        <a title="${h.tooltip('%s\n%s' % (repo['author'],repo['last_msg']))}" class="tooltip" href="${h.url('changeset_home',repo_name=repo['name'],revision=repo['tip'])}">${'r%s:%s' % (repo['rev'],h.short_id(repo['tip']))}</a>
 
                        %else:
 
                            ${_('No changesets yet')}
 
                        %endif    
 
@@ -170,7 +153,6 @@
 
                    </td>
 
                </tr>
 
            %endfor
 
            
 
            </tbody>
 
            </table>
 
            </div>
0 comments (0 inline, 0 general)