##// END OF EJS Templates
svn-support: Only show 'generate config' button if config generation is enabled.
Martin Bornhold -
r1022:79b4d791 default
parent child Browse files
Show More
@@ -34,6 +34,7 b' import packaging.version'
34 from pylons import request, tmpl_context as c, url, config
34 from pylons import request, tmpl_context as c, url, config
35 from pylons.controllers.util import redirect
35 from pylons.controllers.util import redirect
36 from pylons.i18n.translation import _, lazy_ugettext
36 from pylons.i18n.translation import _, lazy_ugettext
37 from pyramid.threadlocal import get_current_registry
37 from webob.exc import HTTPBadRequest
38 from webob.exc import HTTPBadRequest
38
39
39 import rhodecode
40 import rhodecode
@@ -63,6 +64,7 b' from rhodecode.model.settings import ('
63 SettingsModel)
64 SettingsModel)
64
65
65 from rhodecode.model.supervisor import SupervisorModel, SUPERVISOR_MASTER
66 from rhodecode.model.supervisor import SupervisorModel, SUPERVISOR_MASTER
67 from rhodecode.svn_support.config_keys import generate_config
66
68
67
69
68 log = logging.getLogger(__name__)
70 log = logging.getLogger(__name__)
@@ -186,6 +188,10 b' class SettingsController(BaseController)'
186 c.svn_branch_patterns = model.get_global_svn_branch_patterns()
188 c.svn_branch_patterns = model.get_global_svn_branch_patterns()
187 c.svn_tag_patterns = model.get_global_svn_tag_patterns()
189 c.svn_tag_patterns = model.get_global_svn_tag_patterns()
188
190
191 # TODO: Replace with request.registry after migrating to pyramid.
192 pyramid_settings = get_current_registry().settings
193 c.svn_proxy_generate_config = pyramid_settings[generate_config]
194
189 return htmlfill.render(
195 return htmlfill.render(
190 render('admin/settings/settings.html'),
196 render('admin/settings/settings.html'),
191 defaults=self._form_defaults(),
197 defaults=self._form_defaults(),
@@ -161,9 +161,11 b''
161 ${h.text('vcs_svn_proxy_http_server_url',size=59)}
161 ${h.text('vcs_svn_proxy_http_server_url',size=59)}
162 </div>
162 </div>
163 </div>
163 </div>
164 % if c.svn_proxy_generate_config:
164 <div class="buttons">
165 <div class="buttons">
165 <button class="btn btn-primary" id="vcs_svn_generate_cfg">${_('Generate Apache Config')}</button>
166 <button class="btn btn-primary" id="vcs_svn_generate_cfg">${_('Generate Apache Config')}</button>
166 </div>
167 </div>
168 % endif
167 </div>
169 </div>
168 </div>
170 </div>
169 % endif
171 % endif
General Comments 0
You need to be logged in to leave comments. Login now