From 30f00dc9fdbbeb6d620797b04237ed89a7168e2d Mon Sep 17 00:00:00 2001 From: Martin Bornhold Date: Fri, 14 Oct 2016 15:11:04 +0200 Subject: [PATCH] svn-support: Add js on click handler to trigger Apache config genreation. Th on click handler sends a POST to trigger the config file generation. On succes it displays a notification to the user. --- .../templates/admin/settings/settings_vcs.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rhodecode/templates/admin/settings/settings_vcs.html b/rhodecode/templates/admin/settings/settings_vcs.html index 7d922dab..f46f9aaf 100644 --- a/rhodecode/templates/admin/settings/settings_vcs.html +++ b/rhodecode/templates/admin/settings/settings_vcs.html @@ -50,5 +50,17 @@ ${h.end_form()} if ($('.locked_input').children().hasClass('error-message')) { 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); + }); + }); + + });