fix(svn-configs): cleanup code and fixed generate config on repo settings page which should not be visible
This commit is contained in:
parent
32f96b1ae9
commit
16f04fd3ed
4 changed files with 31 additions and 21 deletions
|
|
@ -32,7 +32,7 @@ from pyramid.response import Response
|
|||
|
||||
from rhodecode.apps._base import BaseAppView
|
||||
from rhodecode.apps._base.navigation import navigation_list
|
||||
from rhodecode.apps.svn_support.config_keys import generate_config
|
||||
from rhodecode.apps.svn_support import config_keys
|
||||
from rhodecode.lib import helpers as h
|
||||
from rhodecode.lib.auth import (
|
||||
LoginRequired, HasPermissionAllDecorator, CSRFRequired)
|
||||
|
|
@ -113,10 +113,8 @@ class AdminSettingsView(BaseAppView):
|
|||
model = VcsSettingsModel()
|
||||
c.svn_branch_patterns = model.get_global_svn_branch_patterns()
|
||||
c.svn_tag_patterns = model.get_global_svn_tag_patterns()
|
||||
|
||||
settings = self.request.registry.settings
|
||||
c.svn_generate_config = settings[generate_config]
|
||||
c.svn_config_path = rhodecode.ConfigGet().get_str('svn.proxy.config_file_path')
|
||||
c.svn_generate_config = rhodecode.ConfigGet().get_bool(config_keys.generate_config)
|
||||
c.svn_config_path = rhodecode.ConfigGet().get_str(config_keys.config_file_path)
|
||||
defaults = self._form_defaults()
|
||||
|
||||
model.create_largeobjects_dirs_if_needed(defaults['paths_root_path'])
|
||||
|
|
@ -143,9 +141,8 @@ class AdminSettingsView(BaseAppView):
|
|||
c.svn_branch_patterns = model.get_global_svn_branch_patterns()
|
||||
c.svn_tag_patterns = model.get_global_svn_tag_patterns()
|
||||
|
||||
settings = self.request.registry.settings
|
||||
c.svn_generate_config = settings[generate_config]
|
||||
c.svn_config_path = rhodecode.ConfigGet().get_str('svn.proxy.config_file_path')
|
||||
c.svn_generate_config = rhodecode.ConfigGet().get_bool(config_keys.generate_config)
|
||||
c.svn_config_path = rhodecode.ConfigGet().get_str(config_keys.config_file_path)
|
||||
application_form = ApplicationUiSettingsForm(self.request.translate)()
|
||||
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ from pyramid.httpexceptions import HTTPFound, HTTPBadRequest
|
|||
from pyramid.response import Response
|
||||
from pyramid.renderers import render
|
||||
|
||||
import rhodecode
|
||||
from rhodecode.apps._base import RepoAppView
|
||||
from rhodecode.apps.svn_support import config_keys
|
||||
from rhodecode.lib import helpers as h
|
||||
from rhodecode.lib.auth import (
|
||||
LoginRequired, HasRepoPermissionAnyDecorator, CSRFRequired)
|
||||
|
|
@ -38,8 +40,6 @@ log = logging.getLogger(__name__)
|
|||
class RepoSettingsVcsView(RepoAppView):
|
||||
def load_default_context(self):
|
||||
c = self._get_local_tmpl_context()
|
||||
|
||||
|
||||
return c
|
||||
|
||||
def _vcs_form_defaults(self, repo_name):
|
||||
|
|
@ -77,6 +77,9 @@ class RepoSettingsVcsView(RepoAppView):
|
|||
c.svn_branch_patterns = model.get_repo_svn_branch_patterns()
|
||||
c.svn_tag_patterns = model.get_repo_svn_tag_patterns()
|
||||
|
||||
c.svn_generate_config = rhodecode.ConfigGet().get_bool(config_keys.generate_config)
|
||||
c.svn_config_path = rhodecode.ConfigGet().get_str(config_keys.config_file_path)
|
||||
|
||||
defaults = self._vcs_form_defaults(self.db_repo_name)
|
||||
c.inherit_global_settings = defaults['inherit_global_settings']
|
||||
|
||||
|
|
@ -103,6 +106,8 @@ class RepoSettingsVcsView(RepoAppView):
|
|||
c.global_svn_tag_patterns = model.get_global_svn_tag_patterns()
|
||||
c.svn_branch_patterns = model.get_repo_svn_branch_patterns()
|
||||
c.svn_tag_patterns = model.get_repo_svn_tag_patterns()
|
||||
c.svn_generate_config = rhodecode.ConfigGet().get_bool(config_keys.generate_config)
|
||||
c.svn_config_path = rhodecode.ConfigGet().get_str(config_keys.config_file_path)
|
||||
|
||||
defaults = self._vcs_form_defaults(self.db_repo_name)
|
||||
c.inherit_global_settings = defaults['inherit_global_settings']
|
||||
|
|
|
|||
|
|
@ -49,16 +49,5 @@ ${h.end_form()}
|
|||
unlockpath();
|
||||
}
|
||||
|
||||
/* On click handler for the `Generate Apache Config` button. It sends a
|
||||
POST request to trigger the (re)generation of the mod_dav_svn config. */
|
||||
$('#vcs_svn_generate_cfg').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
var url = "${h.route_path('admin_settings_vcs_svn_generate_cfg')}";
|
||||
var jqxhr = $.post(url, {'csrf_token': CSRF_TOKEN});
|
||||
jqxhr.done(function(data) {
|
||||
$.Topic('/notifications').publish(data);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@
|
|||
<h3 class="panel-title">${_('Subversion Settings')}<a class="permalink" href="#vcs-svn-options"> ¶</a></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
% if display_globals:
|
||||
<div class="field">
|
||||
<div class="content" >
|
||||
<label>${_('mod_dav config')}</label><br/>
|
||||
|
|
@ -164,6 +165,7 @@
|
|||
% endif
|
||||
</div>
|
||||
</div>
|
||||
% endif
|
||||
|
||||
<div class="field">
|
||||
<div class="content" >
|
||||
|
|
@ -324,5 +326,22 @@
|
|||
## </div>
|
||||
## % endif
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function() {
|
||||
/* On click handler for the `Generate Apache Config` button. It sends a
|
||||
POST request to trigger the (re)generation of the mod_dav_svn config. */
|
||||
$('#vcs_svn_generate_cfg').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
alert('i cliked it !!')
|
||||
var url = "${h.route_path('admin_settings_vcs_svn_generate_cfg')}";
|
||||
var jqxhr = $.post(url, {'csrf_token': CSRF_TOKEN});
|
||||
jqxhr.done(function(data) {
|
||||
$.Topic('/notifications').publish(data);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue