Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-23 20:47:22 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-23 20:47:22 +0400
commit2ed7cbfba4ff3c6a4cf3e72515a0375544998de0 (patch)
treeae6d7530745c80633cd993c99f7820e1452f3e1b /app/views/projects/protected_branches
parent95791316f4037273af7b747ce1851d5f4e46933f (diff)
Move projects controllers/views in Projects module
Diffstat (limited to 'app/views/projects/protected_branches')
-rw-r--r--app/views/projects/protected_branches/index.html.haml54
1 files changed, 54 insertions, 0 deletions
diff --git a/app/views/projects/protected_branches/index.html.haml b/app/views/projects/protected_branches/index.html.haml
new file mode 100644
index 00000000000..f741f2f0495
--- /dev/null
+++ b/app/views/projects/protected_branches/index.html.haml
@@ -0,0 +1,54 @@
+= render "projects/commits/head"
+.row
+ .span3
+ = render "projects/repositories/filter"
+ .span9
+ .alert
+ %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}.
+ %p This ability allows:
+ %ul
+ %li keep stable branches secured
+ %li forced code review before merge to protected branches
+ %p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"}
+
+ - if can? current_user, :admin_project, @project
+ = form_for [@project, @protected_branch] do |f|
+ -if @protected_branch.errors.any?
+ .alert.alert-error
+ %ul
+ - @protected_branch.errors.full_messages.each do |msg|
+ %li= msg
+
+ .entry.clearfix
+ = f.label :name, "Branch"
+ .span3
+ = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "chosen span3"})
+ &nbsp;
+ = f.submit 'Protect', class: "btn-primary btn"
+
+ - unless @branches.empty?
+ %table
+ %thead
+ %tr
+ %th Name
+ %th Last commit
+ %th
+ %tbody
+ - @branches.each do |branch|
+ %tr
+ %td
+ = link_to project_commits_path(@project, branch.name) do
+ %strong= branch.name
+ - if @project.root_ref?(branch.name)
+ %span.label default
+ %td
+ - if branch.commit
+ = link_to project_commit_path(@project, branch.commit.id) do
+ = truncate branch.commit.id.to_s, length: 10
+ = time_ago_in_words(branch.commit.committed_date)
+ ago
+ - else
+ (branch was removed from repository)
+ %td
+ - if can? current_user, :admin_project, @project
+ = link_to 'Unprotect', [@project, branch], confirm: 'Branch will be writable for developers. Are you sure?', method: :delete, class: "btn btn-remove btn-small"