##// END OF EJS Templates
added proper groups names in add repo from settings
marcink -
r1161:f3c25bbd beta
parent child Browse files
Show More
@@ -127,7 +127,8 b' class ReposController(BaseController):'
127 defaults = c.repo_info.get_dict()
127 defaults = c.repo_info.get_dict()
128 group, repo_name = c.repo_info.groups_and_repo
128 group, repo_name = c.repo_info.groups_and_repo
129 defaults['repo_name'] = repo_name
129 defaults['repo_name'] = repo_name
130 defaults['repo_group'] = getattr(group[-1] if group else None, 'group_id', None)
130 defaults['repo_group'] = getattr(group[-1] if group else None,
131 'group_id', None)
131
132
132 #fill owner
133 #fill owner
133 if c.repo_info.user:
134 if c.repo_info.user:
@@ -319,10 +319,21 b' class SettingsController(BaseController)'
319 @HasPermissionAnyDecorator('hg.admin', 'hg.create.repository')
319 @HasPermissionAnyDecorator('hg.admin', 'hg.create.repository')
320 def create_repository(self):
320 def create_repository(self):
321 """GET /_admin/create_repository: Form to create a new item"""
321 """GET /_admin/create_repository: Form to create a new item"""
322
323 c.repo_groups = [('', '')]
324 parents_link = lambda k:h.literal('»'.join(
325 map(lambda k:k.group_name,
326 k.parents + [k])
327 )
328 )
329
330 c.repo_groups.extend([(x.group_id, parents_link(x)) for \
331 x in self.sa.query(Group).all()])
332 c.repo_groups_choices = map(lambda k: unicode(k[0]), c.repo_groups)
333
322 new_repo = request.GET.get('repo', '')
334 new_repo = request.GET.get('repo', '')
323 c.new_repo = repo_name_slug(new_repo)
335 c.new_repo = repo_name_slug(new_repo)
324 c.repo_groups = [('', '')]
336
325 c.repo_groups.extend([(x.group_id, x.group_name) for x in self.sa.query(Group).all()])
326 return render('admin/repos/repo_add_create_repository.html')
337 return render('admin/repos/repo_add_create_repository.html')
327
338
328 def get_hg_ui_settings(self):
339 def get_hg_ui_settings(self):
General Comments 0
You need to be logged in to leave comments. Login now