Show More
@@ -165,7 +165,6 class ReposGroupsController(BaseControll | |||
|
165 | 165 | category='error') |
|
166 | 166 | return redirect(url('repos_groups')) |
|
167 | 167 | |
|
168 | ||
|
169 | 168 | try: |
|
170 | 169 | repos_group_model.delete(id) |
|
171 | 170 | h.flash(_('removed repos group %s' % gr.group_name), category='success') |
@@ -181,27 +180,13 class ReposGroupsController(BaseControll | |||
|
181 | 180 | """GET /repos_groups/id: Show a specific item""" |
|
182 | 181 | # url('repos_group', id=ID) |
|
183 | 182 | |
|
184 |
|
|
|
183 | c.group = Group.get(id) | |
|
185 | 184 | |
|
186 | 185 | if c.group: |
|
187 | 186 | c.group_repos = c.group.repositories.all() |
|
188 | 187 | else: |
|
189 | 188 | return redirect(url('home')) |
|
190 | 189 | |
|
191 | ||
|
192 | sortables = ['name', 'description', 'last_change', 'tip', 'owner'] | |
|
193 | current_sort = request.GET.get('sort', 'name') | |
|
194 | current_sort_slug = current_sort.replace('-', '') | |
|
195 | ||
|
196 | if current_sort_slug not in sortables: | |
|
197 | c.sort_by = 'name' | |
|
198 | current_sort_slug = c.sort_by | |
|
199 | else: | |
|
200 | c.sort_by = current_sort | |
|
201 | c.sort_slug = current_sort_slug | |
|
202 | ||
|
203 | sort_key = current_sort_slug + '_sort' | |
|
204 | ||
|
205 | 190 | #overwrite our cached list with current filter |
|
206 | 191 | gr_filter = c.group_repos |
|
207 | 192 | c.cached_repo_list = self.scm_model.get_repos(all_repos=gr_filter) |
@@ -220,13 +205,13 class ReposGroupsController(BaseControll | |||
|
220 | 205 | """GET /repos_groups/id/edit: Form to edit an existing item""" |
|
221 | 206 | # url('edit_repos_group', id=ID) |
|
222 | 207 | |
|
223 | id = int(id) | |
|
208 | id_ = int(id) | |
|
224 | 209 | |
|
225 | c.repos_group = Group.get(id) | |
|
226 | defaults = self.__load_data(id) | |
|
210 | c.repos_group = Group.get(id_) | |
|
211 | defaults = self.__load_data(id_) | |
|
227 | 212 | |
|
228 | 213 | # we need to exclude this group from the group list for editing |
|
229 | c.repo_groups = filter(lambda x:x[0] != id, c.repo_groups) | |
|
214 | c.repo_groups = filter(lambda x:x[0] != id_, c.repo_groups) | |
|
230 | 215 | |
|
231 | 216 | return htmlfill.render( |
|
232 | 217 | render('admin/repos_groups/repos_groups_edit.html'), |
@@ -43,20 +43,8 class HomeController(BaseController): | |||
|
43 | 43 | super(HomeController, self).__before__() |
|
44 | 44 | |
|
45 | 45 | def index(self): |
|
46 | sortables = ['name', 'description', 'last_change', 'tip', 'owner'] | |
|
47 | current_sort = request.GET.get('sort', 'name') | |
|
48 | current_sort_slug = current_sort.replace('-', '') | |
|
49 | 46 | |
|
50 | if current_sort_slug not in sortables: | |
|
51 | c.sort_by = 'name' | |
|
52 | current_sort_slug = c.sort_by | |
|
53 | else: | |
|
54 | c.sort_by = current_sort | |
|
55 | c.sort_slug = current_sort_slug | |
|
56 | ||
|
57 | sort_key = current_sort_slug + '_sort' | |
|
58 | ||
|
59 | c.repos_list = self.scm_model.get_repos(sort_key=sort_key) | |
|
47 | c.repos_list = self.scm_model.get_repos() | |
|
60 | 48 | |
|
61 | 49 | c.groups = Group.query().filter(Group.group_parent_id == None).all() |
|
62 | 50 |
@@ -1,18 +1,4 | |||
|
1 | 1 | <%page args="parent" /> |
|
2 | <%def name="get_sort(name)"> | |
|
3 | <%name_slug = name.lower().replace(' ','_') %> | |
|
4 | ||
|
5 | %if name_slug == c.sort_slug: | |
|
6 | %if c.sort_by.startswith('-'): | |
|
7 | <a href="?sort=${name_slug}">${name}↑</a> | |
|
8 | %else: | |
|
9 | <a href="?sort=-${name_slug}">${name}↓</a> | |
|
10 | %endif: | |
|
11 | %else: | |
|
12 | <a href="?sort=${name_slug}">${name}</a> | |
|
13 | %endif | |
|
14 | </%def> | |
|
15 | ||
|
16 | 2 | <div class="box"> |
|
17 | 3 | <!-- box / title --> |
|
18 | 4 | <div class="title"> |
@@ -67,11 +53,11 | |||
|
67 | 53 | <thead> |
|
68 | 54 | <tr> |
|
69 | 55 | <th class="left"></th> |
|
70 |
<th class="left">${ |
|
|
71 |
<th class="left">${ |
|
|
72 |
<th class="left">${ |
|
|
73 |
<th class="left">${ |
|
|
74 |
<th class="left">${ |
|
|
56 | <th class="left">${_('Name')}</th> | |
|
57 | <th class="left">${_('Description')}</th> | |
|
58 | <th class="left">${_('Last change')}</th> | |
|
59 | <th class="left">${_('Tip')}</th> | |
|
60 | <th class="left">${_('Owner')}</th> | |
|
75 | 61 | <th class="left">${_('RSS')}</th> |
|
76 | 62 | <th class="left">${_('Atom')}</th> |
|
77 | 63 | </tr> |
@@ -145,10 +131,7 | |||
|
145 | 131 | </td> |
|
146 | 132 | <td> |
|
147 | 133 | %if repo['rev']>=0: |
|
148 | ${h.link_to('r%s:%s' % (repo['rev'],h.short_id(repo['tip'])), | |
|
149 | h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']), | |
|
150 | class_="tooltip", | |
|
151 | title=h.tooltip('%s\n%s' % (repo['author'],repo['last_msg'])))} | |
|
134 | <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> | |
|
152 | 135 | %else: |
|
153 | 136 | ${_('No changesets yet')} |
|
154 | 137 | %endif |
@@ -170,7 +153,6 | |||
|
170 | 153 | </td> |
|
171 | 154 | </tr> |
|
172 | 155 | %endfor |
|
173 | ||
|
174 | 156 | </tbody> |
|
175 | 157 | </table> |
|
176 | 158 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now