svn-support: Only show 'generate config' button if config generation is enabled.

This commit is contained in:
Martin Bornhold 2016-10-17 13:46:51 +02:00
parent f18488ecab
commit ee90352440
2 changed files with 11 additions and 3 deletions

View file

@ -34,6 +34,7 @@ import packaging.version
from pylons import request, tmpl_context as c, url, config
from pylons.controllers.util import redirect
from pylons.i18n.translation import _, lazy_ugettext
from pyramid.threadlocal import get_current_registry
from webob.exc import HTTPBadRequest
import rhodecode
@ -63,6 +64,7 @@ from rhodecode.model.settings import (
SettingsModel)
from rhodecode.model.supervisor import SupervisorModel, SUPERVISOR_MASTER
from rhodecode.svn_support.config_keys import generate_config
log = logging.getLogger(__name__)
@ -186,6 +188,10 @@ class SettingsController(BaseController):
c.svn_branch_patterns = model.get_global_svn_branch_patterns()
c.svn_tag_patterns = model.get_global_svn_tag_patterns()
# TODO: Replace with request.registry after migrating to pyramid.
pyramid_settings = get_current_registry().settings
c.svn_proxy_generate_config = pyramid_settings[generate_config]
return htmlfill.render(
render('admin/settings/settings.html'),
defaults=self._form_defaults(),

View file

@ -161,9 +161,11 @@
${h.text('vcs_svn_proxy_http_server_url',size=59)}
</div>
</div>
<div class="buttons">
<button class="btn btn-primary" id="vcs_svn_generate_cfg">${_('Generate Apache Config')}</button>
</div>
% if c.svn_proxy_generate_config:
<div class="buttons">
<button class="btn btn-primary" id="vcs_svn_generate_cfg">${_('Generate Apache Config')}</button>
</div>
% endif
</div>
</div>
% endif