##// END OF EJS Templates
fix(svn-configs): cleanup code and fixed generate config on repo settings page which should not be visible
super-admin -
r5395:c07fca24 default
parent child Browse files
Show More
@@ -32,7 +32,7 b' from pyramid.response import Response'
32 32
33 33 from rhodecode.apps._base import BaseAppView
34 34 from rhodecode.apps._base.navigation import navigation_list
35 from rhodecode.apps.svn_support.config_keys import generate_config
35 from rhodecode.apps.svn_support import config_keys
36 36 from rhodecode.lib import helpers as h
37 37 from rhodecode.lib.auth import (
38 38 LoginRequired, HasPermissionAllDecorator, CSRFRequired)
@@ -113,10 +113,8 b' class AdminSettingsView(BaseAppView):'
113 113 model = VcsSettingsModel()
114 114 c.svn_branch_patterns = model.get_global_svn_branch_patterns()
115 115 c.svn_tag_patterns = model.get_global_svn_tag_patterns()
116
117 settings = self.request.registry.settings
118 c.svn_generate_config = settings[generate_config]
119 c.svn_config_path = rhodecode.ConfigGet().get_str('svn.proxy.config_file_path')
116 c.svn_generate_config = rhodecode.ConfigGet().get_bool(config_keys.generate_config)
117 c.svn_config_path = rhodecode.ConfigGet().get_str(config_keys.config_file_path)
120 118 defaults = self._form_defaults()
121 119
122 120 model.create_largeobjects_dirs_if_needed(defaults['paths_root_path'])
@@ -143,9 +141,8 b' class AdminSettingsView(BaseAppView):'
143 141 c.svn_branch_patterns = model.get_global_svn_branch_patterns()
144 142 c.svn_tag_patterns = model.get_global_svn_tag_patterns()
145 143
146 settings = self.request.registry.settings
147 c.svn_generate_config = settings[generate_config]
148 c.svn_config_path = rhodecode.ConfigGet().get_str('svn.proxy.config_file_path')
144 c.svn_generate_config = rhodecode.ConfigGet().get_bool(config_keys.generate_config)
145 c.svn_config_path = rhodecode.ConfigGet().get_str(config_keys.config_file_path)
149 146 application_form = ApplicationUiSettingsForm(self.request.translate)()
150 147
151 148 try:
@@ -24,7 +24,9 b' from pyramid.httpexceptions import HTTPF'
24 24 from pyramid.response import Response
25 25 from pyramid.renderers import render
26 26
27 import rhodecode
27 28 from rhodecode.apps._base import RepoAppView
29 from rhodecode.apps.svn_support import config_keys
28 30 from rhodecode.lib import helpers as h
29 31 from rhodecode.lib.auth import (
30 32 LoginRequired, HasRepoPermissionAnyDecorator, CSRFRequired)
@@ -38,8 +40,6 b' log = logging.getLogger(__name__)'
38 40 class RepoSettingsVcsView(RepoAppView):
39 41 def load_default_context(self):
40 42 c = self._get_local_tmpl_context()
41
42
43 43 return c
44 44
45 45 def _vcs_form_defaults(self, repo_name):
@@ -77,6 +77,9 b' class RepoSettingsVcsView(RepoAppView):'
77 77 c.svn_branch_patterns = model.get_repo_svn_branch_patterns()
78 78 c.svn_tag_patterns = model.get_repo_svn_tag_patterns()
79 79
80 c.svn_generate_config = rhodecode.ConfigGet().get_bool(config_keys.generate_config)
81 c.svn_config_path = rhodecode.ConfigGet().get_str(config_keys.config_file_path)
82
80 83 defaults = self._vcs_form_defaults(self.db_repo_name)
81 84 c.inherit_global_settings = defaults['inherit_global_settings']
82 85
@@ -103,6 +106,8 b' class RepoSettingsVcsView(RepoAppView):'
103 106 c.global_svn_tag_patterns = model.get_global_svn_tag_patterns()
104 107 c.svn_branch_patterns = model.get_repo_svn_branch_patterns()
105 108 c.svn_tag_patterns = model.get_repo_svn_tag_patterns()
109 c.svn_generate_config = rhodecode.ConfigGet().get_bool(config_keys.generate_config)
110 c.svn_config_path = rhodecode.ConfigGet().get_str(config_keys.config_file_path)
106 111
107 112 defaults = self._vcs_form_defaults(self.db_repo_name)
108 113 c.inherit_global_settings = defaults['inherit_global_settings']
@@ -49,16 +49,5 b''
49 49 unlockpath();
50 50 }
51 51
52 /* On click handler for the `Generate Apache Config` button. It sends a
53 POST request to trigger the (re)generation of the mod_dav_svn config. */
54 $('#vcs_svn_generate_cfg').on('click', function(event) {
55 event.preventDefault();
56 var url = "${h.route_path('admin_settings_vcs_svn_generate_cfg')}";
57 var jqxhr = $.post(url, {'csrf_token': CSRF_TOKEN});
58 jqxhr.done(function(data) {
59 $.Topic('/notifications').publish(data);
60 });
61 });
62
63 52 });
64 53 </script>
@@ -148,6 +148,7 b''
148 148 <h3 class="panel-title">${_('Subversion Settings')}<a class="permalink" href="#vcs-svn-options"></a></h3>
149 149 </div>
150 150 <div class="panel-body">
151 % if display_globals:
151 152 <div class="field">
152 153 <div class="content" >
153 154 <label>${_('mod_dav config')}</label><br/>
@@ -164,6 +165,7 b''
164 165 % endif
165 166 </div>
166 167 </div>
168 % endif
167 169
168 170 <div class="field">
169 171 <div class="content" >
@@ -324,5 +326,22 b''
324 326 ## </div>
325 327 ## % endif
326 328
329 <script type="text/javascript">
327 330
331 $(document).ready(function() {
332 /* On click handler for the `Generate Apache Config` button. It sends a
333 POST request to trigger the (re)generation of the mod_dav_svn config. */
334 $('#vcs_svn_generate_cfg').on('click', function(event) {
335 event.preventDefault();
336 alert('i cliked it !!')
337 var url = "${h.route_path('admin_settings_vcs_svn_generate_cfg')}";
338 var jqxhr = $.post(url, {'csrf_token': CSRF_TOKEN});
339 jqxhr.done(function(data) {
340 $.Topic('/notifications').publish(data);
341 });
342 });
343 });
344
345 </script>
328 346 </%def>
347
General Comments 0
You need to be logged in to leave comments. Login now