-
Notifications
You must be signed in to change notification settings - Fork 117
/
Copy pathindex.html.slim
51 lines (42 loc) · 2.24 KB
/
index.html.slim
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
div
- if User.current.git_allowed_to?(:create_repository_protected_branches, @repository)
.contextual
= link_to l(:label_protected_branch_add),
new_repository_protected_branch_path(@repository),
class: 'icon icon-add modal-box'
h3
= l(:label_protected_branches)
= link_to "(#{l(:label_gitolite_documentation)})", 'https://gitolite.com/gitolite/conf.html#rules', class: 'external'
- if @repository_protected_branches.any?
table#protected_branches.table.table-hover data-update-url="#{sort_repository_protected_branches_url}" style="opacity: #{@repository.protected_branches_enabled? ? '1' : '0.5'};"
thead
tr
th
th = l(:label_permissions)
th = l(:label_branch_path)
th = l(:label_user_list)
th
tbody
- @repository_protected_branches.each do |protected_branch|
tr.protected_branch id="protected_branch_#{protected_branch.id}"
td
span.handle
| [drag]
td
- color = protected_branch.permissions == '-' ? 'important' : 'success'
span.label class="label-#{color}"
= protected_branch.permissions
td style='font-family: Consolas;'
= protected_branch.path
td = protected_branch.users.map { |u| link_to(u) }.join(', ').html_safe
td.buttons
- if User.current.git_allowed_to?(:edit_repository_protected_branches, @repository)
= link_to l(:button_edit), edit_repository_protected_branch_path(@repository, protected_branch), class: 'icon icon-edit modal-box'
= link_to l(:button_clone), clone_repository_protected_branch_path(@repository, protected_branch), class: 'icon icon-copy modal-box'
= link_to l(:button_delete), repository_protected_branch_path(@repository, protected_branch), remote: true, method: :delete, data: { confirm: l(:text_are_you_sure) }, class: 'icon icon-del'
- unless @repository.protected_branches_enabled?
em = l(:protected_branches_reminder)
- else
p.nodata = l(:label_no_data)
javascript:
$(document).ready(function() { setSortableElement('#protected_branches tbody', '#protected_branches'); });