Show More
@@ -19,17 +19,20 b'' | |||
|
19 | 19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
20 | 20 | |
|
21 | 21 | import os |
|
22 | from collections import OrderedDict | |
|
23 | ||
|
22 | 24 | import sys |
|
23 | 25 | import platform |
|
24 | 26 | |
|
25 | 27 | VERSION = tuple(open(os.path.join( |
|
26 | 28 | os.path.dirname(__file__), 'VERSION')).read().split('.')) |
|
27 | 29 | |
|
28 |
BACKENDS = |
|
|
29 | 'hg': 'Mercurial repository', | |
|
30 | 'git': 'Git repository', | |
|
31 | 'svn': 'Subversion repository', | |
|
32 | } | |
|
30 | BACKENDS = OrderedDict() | |
|
31 | ||
|
32 | BACKENDS['hg'] = 'Mercurial repository' | |
|
33 | BACKENDS['git'] = 'Git repository' | |
|
34 | BACKENDS['svn'] = 'Subversion repository' | |
|
35 | ||
|
33 | 36 | |
|
34 | 37 | CELERY_ENABLED = False |
|
35 | 38 | CELERY_EAGER = False |
@@ -60,10 +60,15 b' def load_pyramid_environment(global_conf' | |||
|
60 | 60 | |
|
61 | 61 | load_rcextensions(root_path=settings_merged['here']) |
|
62 | 62 | |
|
63 | # Limit backends to `vcs.backends` from configuration | |
|
63 | # Limit backends to `vcs.backends` from configuration, and preserve the order | |
|
64 | 64 | for alias in rhodecode.BACKENDS.keys(): |
|
65 | 65 | if alias not in settings['vcs.backends']: |
|
66 | 66 | del rhodecode.BACKENDS[alias] |
|
67 | ||
|
68 | def sorter(item): | |
|
69 | return settings['vcs.backends'].index(item[0]) | |
|
70 | rhodecode.BACKENDS = rhodecode.OrderedDict(sorted(rhodecode.BACKENDS.items(), key=sorter)) | |
|
71 | ||
|
67 | 72 | log.info('Enabled VCS backends: %s', rhodecode.BACKENDS.keys()) |
|
68 | 73 | |
|
69 | 74 | # initialize vcs client and optionally run the server if enabled |
@@ -437,7 +437,7 b' def attach_context_attributes(context, r' | |||
|
437 | 437 | |
|
438 | 438 | context.csrf_token = csrf_token |
|
439 | 439 | context.backends = rhodecode.BACKENDS.keys() |
|
440 | context.backends.sort() | |
|
440 | ||
|
441 | 441 | unread_count = 0 |
|
442 | 442 | user_bookmark_list = [] |
|
443 | 443 | if user_id: |
@@ -402,3 +402,10 b' input.input-valuedisplay {' | |||
|
402 | 402 | } |
|
403 | 403 | } |
|
404 | 404 | } |
|
405 | ||
|
406 | .repo-type-radio input { | |
|
407 | margin: 0 0 0 0 | |
|
408 | } | |
|
409 | .repo-type-radio label { | |
|
410 | padding-right: 15px; | |
|
411 | } |
@@ -52,12 +52,29 b'' | |||
|
52 | 52 | <span class="help-block">${_('Optionally select a group to put this repository into.')}</span> |
|
53 | 53 | </div> |
|
54 | 54 | </div> |
|
55 | ||
|
55 | 56 | <div class="field"> |
|
56 | 57 | <div class="label"> |
|
57 | 58 | <label for="repo_type">${_('Type')}:</label> |
|
58 | 59 | </div> |
|
59 |
<div class=" |
|
|
60 | ${h.select('repo_type','hg',c.backends)} | |
|
60 | <div class="fields repo-type-radio"> | |
|
61 | ||
|
62 | ||
|
63 | % for backend in c.backends: | |
|
64 | % if loop.index == 0: | |
|
65 | <input id="repo_type_${backend}" name="repo_type" type="radio" value="${backend}" checked="checked"/> | |
|
66 | % else: | |
|
67 | <input id="repo_type_${backend}" name="repo_type" type="radio" value="${backend}" /> | |
|
68 | % endif | |
|
69 | ||
|
70 | <label for="repo_type_${backend}"> | |
|
71 | <i class="icon-${backend}" style="font-size: 16px"></i> | |
|
72 | ${backend.upper()} | |
|
73 | </label> | |
|
74 | ||
|
75 | % endfor | |
|
76 | ||
|
77 | ||
|
61 | 78 | <span class="help-block">${_('Set the type of repository to create.')}</span> |
|
62 | 79 | </div> |
|
63 | 80 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now