diff --git a/rhodecode/__init__.py b/rhodecode/__init__.py --- a/rhodecode/__init__.py +++ b/rhodecode/__init__.py @@ -19,17 +19,20 @@ # and proprietary license terms, please see https://rhodecode.com/licenses/ import os +from collections import OrderedDict + import sys import platform VERSION = tuple(open(os.path.join( os.path.dirname(__file__), 'VERSION')).read().split('.')) -BACKENDS = { - 'hg': 'Mercurial repository', - 'git': 'Git repository', - 'svn': 'Subversion repository', -} +BACKENDS = OrderedDict() + +BACKENDS['hg'] = 'Mercurial repository' +BACKENDS['git'] = 'Git repository' +BACKENDS['svn'] = 'Subversion repository' + CELERY_ENABLED = False CELERY_EAGER = False diff --git a/rhodecode/config/environment.py b/rhodecode/config/environment.py --- a/rhodecode/config/environment.py +++ b/rhodecode/config/environment.py @@ -60,10 +60,15 @@ def load_pyramid_environment(global_conf load_rcextensions(root_path=settings_merged['here']) - # Limit backends to `vcs.backends` from configuration + # Limit backends to `vcs.backends` from configuration, and preserve the order for alias in rhodecode.BACKENDS.keys(): if alias not in settings['vcs.backends']: del rhodecode.BACKENDS[alias] + + def sorter(item): + return settings['vcs.backends'].index(item[0]) + rhodecode.BACKENDS = rhodecode.OrderedDict(sorted(rhodecode.BACKENDS.items(), key=sorter)) + log.info('Enabled VCS backends: %s', rhodecode.BACKENDS.keys()) # initialize vcs client and optionally run the server if enabled diff --git a/rhodecode/lib/base.py b/rhodecode/lib/base.py --- a/rhodecode/lib/base.py +++ b/rhodecode/lib/base.py @@ -437,7 +437,7 @@ def attach_context_attributes(context, r context.csrf_token = csrf_token context.backends = rhodecode.BACKENDS.keys() - context.backends.sort() + unread_count = 0 user_bookmark_list = [] if user_id: diff --git a/rhodecode/public/css/forms.less b/rhodecode/public/css/forms.less --- a/rhodecode/public/css/forms.less +++ b/rhodecode/public/css/forms.less @@ -402,3 +402,10 @@ input.input-valuedisplay { } } } + +.repo-type-radio input { + margin: 0 0 0 0 +} +.repo-type-radio label { + padding-right: 15px; +} diff --git a/rhodecode/templates/admin/repos/repo_add_base.mako b/rhodecode/templates/admin/repos/repo_add_base.mako --- a/rhodecode/templates/admin/repos/repo_add_base.mako +++ b/rhodecode/templates/admin/repos/repo_add_base.mako @@ -52,12 +52,29 @@ ${_('Optionally select a group to put this repository into.')} +
-
- ${h.select('repo_type','hg',c.backends)} +
+ + + % for backend in c.backends: + % if loop.index == 0: + + % else: + + % endif + + + + % endfor + + ${_('Set the type of repository to create.')}