##// END OF EJS Templates
clone-urls: allow custom clone by id template.
milka -
r4629:35fb8d8f stable
parent child Browse files
Show More
@@ -384,6 +384,7 b' class AdminSettingsView(BaseAppView):'
384 384 ('markup_renderer', 'rhodecode_markup_renderer', 'unicode'),
385 385 ('gravatar_url', 'rhodecode_gravatar_url', 'unicode'),
386 386 ('clone_uri_tmpl', 'rhodecode_clone_uri_tmpl', 'unicode'),
387 ('clone_uri_id_tmpl', 'rhodecode_clone_uri_id_tmpl', 'unicode'),
387 388 ('clone_uri_ssh_tmpl', 'rhodecode_clone_uri_ssh_tmpl', 'unicode'),
388 389 ('support_url', 'rhodecode_support_url', 'unicode'),
389 390 ('show_revision_number', 'rhodecode_show_revision_number', 'bool'),
@@ -83,14 +83,10 b' class RepoSummaryView(RepoAppView):'
83 83 if self._rhodecode_user.username != User.DEFAULT_USER:
84 84 username = safe_str(self._rhodecode_user.username)
85 85
86 _def_clone_uri = _def_clone_uri_id = c.clone_uri_tmpl
86 _def_clone_uri = c.clone_uri_tmpl
87 _def_clone_uri_id = c.clone_uri_id_tmpl
87 88 _def_clone_uri_ssh = c.clone_uri_ssh_tmpl
88 89
89 if '{repo}' in _def_clone_uri:
90 _def_clone_uri_id = _def_clone_uri.replace('{repo}', '_{repoid}')
91 elif '{repoid}' in _def_clone_uri:
92 _def_clone_uri_id = _def_clone_uri.replace('_{repoid}', '{repo}')
93
94 90 c.clone_repo_url = self.db_repo.clone_url(
95 91 user=username, uri_tmpl=_def_clone_uri)
96 92 c.clone_repo_url_id = self.db_repo.clone_url(
@@ -342,6 +342,7 b' def attach_context_attributes(context, r'
342 342 if request.GET.get('default_encoding'):
343 343 context.default_encodings.insert(0, request.GET.get('default_encoding'))
344 344 context.clone_uri_tmpl = rc_config.get('rhodecode_clone_uri_tmpl')
345 context.clone_uri_id_tmpl = rc_config.get('rhodecode_clone_uri_id_tmpl')
345 346 context.clone_uri_ssh_tmpl = rc_config.get('rhodecode_clone_uri_ssh_tmpl')
346 347
347 348 # INI stored
@@ -609,6 +609,7 b' class DbManage(object):'
609 609 ('gravatar_url', User.DEFAULT_GRAVATAR_URL, 'unicode'),
610 610
611 611 ('clone_uri_tmpl', Repository.DEFAULT_CLONE_URI, 'unicode'),
612 ('clone_uri_id_tmpl', Repository.DEFAULT_CLONE_URI_ID, 'unicode'),
612 613 ('clone_uri_ssh_tmpl', Repository.DEFAULT_CLONE_URI_SSH, 'unicode'),
613 614 ('support_url', '', 'unicode'),
614 615 ('update_url', RhodeCodeSetting.DEFAULT_UPDATE_URL, 'unicode'),
@@ -390,6 +390,7 b' def ApplicationVisualisationForm(localiz'
390 390 rhodecode_markup_renderer = v.OneOf(['markdown', 'rst'])
391 391 rhodecode_gravatar_url = v.UnicodeString(min=3)
392 392 rhodecode_clone_uri_tmpl = v.UnicodeString(not_empty=False, if_empty=Repository.DEFAULT_CLONE_URI)
393 rhodecode_clone_uri_id_tmpl = v.UnicodeString(not_empty=False, if_empty=Repository.DEFAULT_CLONE_URI_ID)
393 394 rhodecode_clone_uri_ssh_tmpl = v.UnicodeString(not_empty=False, if_empty=Repository.DEFAULT_CLONE_URI_SSH)
394 395 rhodecode_support_url = v.UnicodeString()
395 396 rhodecode_show_revision_number = v.StringBoolean(if_missing=False)
@@ -174,6 +174,9 b''
174 174 ${h.text('rhodecode_clone_uri_tmpl', size=60)} HTTP[S]
175 175 </div>
176 176 <div class="field">
177 ${h.text('rhodecode_clone_uri_id_tmpl', size=60)} HTTP UID
178 </div>
179 <div class="field">
177 180 ${h.text('rhodecode_clone_uri_ssh_tmpl', size=60)} SSH
178 181 </div>
179 182 <div class="field">
General Comments 0
You need to be logged in to leave comments. Login now