##// END OF EJS Templates
repo-maintanance: fix routing problem
marcink -
r2015:92ecc3e5 default
parent child Browse files
Show More
@@ -1,66 +1,66 b''
1 <div class="panel panel-default">
1 <div class="panel panel-default">
2 <div class="panel-heading">
2 <div class="panel-heading">
3 <h3 class="panel-title">${_('Maintenance')}</h3>
3 <h3 class="panel-title">${_('Maintenance')}</h3>
4 </div>
4 </div>
5 <div class="panel-body">
5 <div class="panel-body">
6
6
7 % if c.executable_tasks:
7 % if c.executable_tasks:
8 <h4>${_('Perform maintenance tasks for this repo')}</h4>
8 <h4>${_('Perform maintenance tasks for this repo')}</h4>
9
9
10 <span>${_('Following tasks will be performed')}:</span>
10 <span>${_('Following tasks will be performed')}:</span>
11 <ol>
11 <ol>
12 % for task in c.executable_tasks:
12 % for task in c.executable_tasks:
13 <li>${task}</li>
13 <li>${task}</li>
14 % endfor
14 % endfor
15 </ol>
15 </ol>
16 <p>
16 <p>
17 ${_('Maintenance can be automated by such api call. Can be called periodically in crontab etc.')}
17 ${_('Maintenance can be automated by such api call. Can be called periodically in crontab etc.')}
18 <br/>
18 <br/>
19 <code>
19 <code>
20 ${h.api_call_example(method='maintenance', args={"repoid": c.repo_info.repo_name})}
20 ${h.api_call_example(method='maintenance', args={"repoid": c.repo_info.repo_name})}
21 </code>
21 </code>
22 </p>
22 </p>
23
23
24 % else:
24 % else:
25 <h4>${_('No maintenance tasks for this repo available')}</h4>
25 <h4>${_('No maintenance tasks for this repo available')}</h4>
26 % endif
26 % endif
27
27
28 <div id="results" style="display:none; padding: 10px 0px;"></div>
28 <div id="results" style="display:none; padding: 10px 0px;"></div>
29
29
30 % if c.executable_tasks:
30 % if c.executable_tasks:
31 <div class="form">
31 <div class="form">
32 <div class="fields">
32 <div class="fields">
33 <button class="btn btn-small btn-primary" onclick="executeTask();return false">
33 <button class="btn btn-small btn-primary" onclick="executeTask();return false">
34 ${_('Run Maintenance')}
34 ${_('Run Maintenance')}
35 </button>
35 </button>
36 </div>
36 </div>
37 </div>
37 </div>
38 % endif
38 % endif
39
39
40 </div>
40 </div>
41 </div>
41 </div>
42
42
43
43
44 <script>
44 <script>
45
45
46 executeTask = function() {
46 executeTask = function() {
47 var btn = $(this);
47 var btn = $(this);
48 $('#results').show();
48 $('#results').show();
49 $('#results').html('<h4>${_('Performing Maintenance')}...</h4>');
49 $('#results').html('<h4>${_('Performing Maintenance')}...</h4>');
50
50
51 btn.attr('disabled', 'disabled');
51 btn.attr('disabled', 'disabled');
52 btn.addClass('disabled');
52 btn.addClass('disabled');
53
53
54 var url = "${h.route_path('repo_maintenance_execute', repo_name=c.repo_info.repo_name)}";
54 var url = "${h.route_path('edit_repo_maintenance_execute', repo_name=c.repo_info.repo_name)}";
55 var success = function (data) {
55 var success = function (data) {
56 var displayHtml = $('<pre></pre>');
56 var displayHtml = $('<pre></pre>');
57
57
58 $(displayHtml).append(data);
58 $(displayHtml).append(data);
59 $('#results').html(displayHtml);
59 $('#results').html(displayHtml);
60 btn.removeAttr('disabled');
60 btn.removeAttr('disabled');
61 btn.removeClass('disabled');
61 btn.removeClass('disabled');
62 };
62 };
63 ajaxGET(url, success, null);
63 ajaxGET(url, success, null);
64
64
65 }
65 }
66 </script>
66 </script>
General Comments 0
You need to be logged in to leave comments. Login now