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
|
- page_title "系统钩子"
%h3.page-title
系统钩子
%p.light
#{link_to "系统钩子", help_page_path("system_hooks", "system_hooks"), class: "vlink"}可以绑定例如 Git 版本创建用户或项目的事件。
%hr
= form_for @hook, as: :hook, url: admin_hooks_path, html: { class: 'form-horizontal' } do |f|
-if @hook.errors.any?
.alert.alert-danger
- @hook.errors.full_messages.each do |msg|
%p= msg
.form-group
= f.label :url, "链接:", class: 'control-label'
.col-sm-10
= f.text_field :url, class: "form-control"
.form-group
= f.label :enable_ssl_verification, "SSL 验证证书", class: 'control-label checkbox'
.col-sm-10
.checkbox
= f.label :enable_ssl_verification do
= f.check_box :enable_ssl_verification
%strong 启用 SSL 验证证书
.form-actions
= f.submit "增加系统钩子", class: "btn btn-create"
%hr
-if @hooks.any?
.panel.panel-default
.panel-heading
系统钩子 (#{@hooks.count})
%ul.well-list
- @hooks.each do |hook|
%li
.list-item-name
%strong= hook.url
%p SSL 验证证书: #{hook.enable_ssl_verification ? "已启用" : "已禁用"}
.pull-right
= link_to '测试钩子', admin_hook_test_path(hook), class: "btn btn-sm"
= link_to '删除', admin_hook_path(hook), data: { confirm: '确定要继续么?' }, method: :delete, class: "btn btn-remove btn-sm"
|