Updated readme, Roles in progress

This commit is contained in:
Dmitriy Zaporozhets 2012-02-15 23:51:04 +02:00
parent 37224dc9c1
commit dac7c44ab3
15 changed files with 165 additions and 67 deletions

View file

@ -1,25 +1,22 @@
= render "repositories/branches_head"
= form_for [@project, @protected_branch] do |f|
-if @protected_branch.errors.any?
.alert-message.block-message.error
%ul
- @protected_branch.errors.full_messages.each do |msg|
%li= msg
.alert-message.block-message
%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 Ream more about project permissions #{link_to "here", help_permissions_path, :class => "vlink"}
.clearfix
= f.label :name
.input= f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , { :include_blank => "Select branch" }, { :style => "width:300px" })
.actions
= f.submit 'Add', :class => "primary btn"
- unless @branches.empty?
%table
%table.zebra-striped
%thead
%tr
%th Name
%th Last commit
%th
%tbody
- @branches.each do |branch|
%tr
@ -33,6 +30,25 @@
= truncate branch.commit.id.to_s, :length => 10
= time_ago_in_words(branch.commit.committed_date)
ago
%td
- if can? current_user, :admin_project, @project
= link_to 'Unprotect', [@project, branch], :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small"
- if can? current_user, :admin_project, @project
= form_for [@project, @protected_branch] do |f|
-if @protected_branch.errors.any?
.alert-message.block-message.error
%ul
- @protected_branch.errors.full_messages.each do |msg|
%li= msg
.clearfix
= f.label :name
.input= f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , { :include_blank => "Select branch" }, { :style => "width:300px" })
.actions
= f.submit 'Add', :class => "primary btn"
:javascript