##// END OF EJS Templates
svn-support: Add js on click handler to trigger Apache config genreation....
Martin Bornhold -
r1014:86a8d5c9 default
parent child Browse files
Show More
@@ -1,54 +1,66 b''
1 1 <%namespace name="vcss" file="/base/vcs_settings.html"/>
2 2
3 3 ${h.secure_form(url('admin_settings_vcs'), method='post')}
4 4 <div>
5 5 ${vcss.vcs_settings_fields(
6 6 suffix='',
7 7 svn_tag_patterns=c.svn_tag_patterns,
8 8 svn_branch_patterns=c.svn_branch_patterns,
9 9 display_globals=True,
10 10 allow_repo_location_change=c.visual.allow_repo_location_change
11 11 )}
12 12 <div class="buttons">
13 13 ${h.submit('save',_('Save settings'),class_="btn")}
14 14 ${h.reset('reset',_('Reset'),class_="btn")}
15 15 </div>
16 16 </div>
17 17 ${h.end_form()}
18 18
19 19 <script type="text/javascript">
20 20
21 21 function ajaxDeletePattern(pattern_id, field_id) {
22 22 var sUrl = "${h.url('admin_settings_vcs')}";
23 23 var callback = function (o) {
24 24 var elem = $("#"+field_id);
25 25 elem.remove();
26 26 };
27 27 var postData = {
28 28 '_method': 'delete',
29 29 'delete_svn_pattern': pattern_id,
30 30 'csrf_token': CSRF_TOKEN
31 31 };
32 32 var request = $.post(sUrl, postData)
33 33 .done(callback)
34 34 .fail(function (data, textStatus, errorThrown) {
35 35 alert("Error while deleting hooks.\nError code {0} ({1}). URL: {2}".format(data.status,data.statusText,$(this)[0].url));
36 36 });
37 37 };
38 38
39 39 $(document).ready(function() {
40 40
41 41 var unlockpath = function() {
42 42 $('#path_unlock_icon').removeClass('icon-lock').addClass('icon-unlock');
43 43 $('#paths_root_path').removeAttr('readonly').removeClass('disabled');
44 44 };
45 45
46 46 $('#path_unlock').on('click', function(e) {
47 47 unlockpath();
48 48 });
49 49
50 50 if ($('.locked_input').children().hasClass('error-message')) {
51 51 unlockpath();
52 52 }
53 })
53
54 /* On click handler for the `Generate Apache Config` button. It sends a
55 POST request to trigger the (re)generation of the mod_dav_svn config. */
56 $('#vcs_svn_generate_cfg').on('click', function(event) {
57 event.preventDefault();
58 var url = "${h.route_path('admin_settings_vcs_svn_generate_cfg')}";
59 var jqxhr = $.post(url, {'csrf_token': CSRF_TOKEN});
60 jqxhr.done(function(data) {
61 $.Topic('/notifications').publish(data);
62 });
63 });
64
65 });
54 66 </script>
General Comments 0
You need to be logged in to leave comments. Login now