[9fbddb]: / Allura / allura / templates / app_admin_webhooks_list.html  Maximize  Restore  History

Download this file

70 lines (64 with data), 2.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{#-
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-#}
{% extends g.theme.master %}
{% block title %}{{c.project.name}} / Webhooks{% endblock %}
{% block header %}Webhooks{% endblock %}
{% block content %}
{% for hook in webhooks %}
<h1>{{ hook.type }}</h1>
<p><a href="{{admin_url}}/{{hook.type}}">Create</a></p>
{% if configured_hooks[hook.type] %}
<table>
{% for wh in configured_hooks[hook.type] %}
<tr>
<td title="{{wh.hook_url}}">{{ wh.hook_url|truncate(40, True) }}</td>
<td>{{ wh.secret or '' }}</td>
<td><a href="{{wh.url()}}">Edit</a></td>
<td>
{{ g.icons['delete'].render(
href='{}/{}/delete'.format(admin_url, hook.type),
extra_css='delete-link',
show_title=True,
**{'data-id': h.really_unicode(wh._id)}) }}
</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% endfor %}
{% endblock %}
{% block extra_js %}
<script type="text/javascript">
$(function() {
$('.delete-link').click(function(e) {
e.preventDefault();
var id = $(this).attr('data-id');
var csrf = $.cookie('_session_id');
var data = {'webhook': id, '_session_id': csrf};
var url = $(this).attr('href');
var $tr = $(this).parents('tr');
$.post(url, data, function(data) {
if (data['status'] === 'ok') {
$tr.remove();
} else {
console.log(data);
}
});
});
});
</script>
{% endblock %}