diff options
Diffstat (limited to 'app/views/projects/protected_branches')
-rw-r--r-- | app/views/projects/protected_branches/_branches_list.html.haml | 8 | ||||
-rw-r--r-- | app/views/projects/protected_branches/index.html.haml | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/app/views/projects/protected_branches/_branches_list.html.haml b/app/views/projects/protected_branches/_branches_list.html.haml index e422799f55c..5406b80dc16 100644 --- a/app/views/projects/protected_branches/_branches_list.html.haml +++ b/app/views/projects/protected_branches/_branches_list.html.haml @@ -11,10 +11,10 @@ %tbody - @branches.each do |branch| - - @url = project_protected_branch_path(@project, branch) + - @url = namespace_project_protected_branch_path(@project.namespace, @project, branch) %tr %td - = link_to project_commits_path(@project, branch.name) do + = link_to namespace_project_commits_path(@project.namespace, @project, branch.name) do %strong= branch.name - if @project.root_ref?(branch.name) %span.label.label-info default @@ -22,7 +22,7 @@ = check_box_tag "developers_can_push", branch.id, branch.developers_can_push, "data-url" => @url %td - if commit = branch.commit - = link_to project_commit_path(@project, commit.id), class: 'commit_short_id' do + = link_to namespace_project_commit_path(@project.namespace, @project, commit.id), class: 'commit_short_id' do = commit.short_id · #{time_ago_with_tooltip(commit.committed_date)} @@ -31,4 +31,4 @@ %td .pull-right - if can? current_user, :admin_project, @project - = link_to 'Unprotect', [@project, branch], data: { confirm: 'Branch will be writable for developers. Are you sure?' }, method: :delete, class: "btn btn-remove btn-small" + = link_to 'Unprotect', [@project.namespace.becomes(Namespace), @project, branch], data: { confirm: 'Branch will be writable for developers. Are you sure?' }, method: :delete, class: "btn btn-remove btn-small" diff --git a/app/views/projects/protected_branches/index.html.haml b/app/views/projects/protected_branches/index.html.haml index 2164c874c74..dc20e96732e 100644 --- a/app/views/projects/protected_branches/index.html.haml +++ b/app/views/projects/protected_branches/index.html.haml @@ -11,7 +11,7 @@ %p Read more about #{link_to "project permissions", help_page_path("permissions", "permissions"), class: "underlined-link"} - if can? current_user, :admin_project, @project - = form_for [@project, @protected_branch], html: { class: 'form-horizontal' } do |f| + = form_for [@project.namespace.becomes(Namespace), @project, @protected_branch], html: { class: 'form-horizontal' } do |f| -if @protected_branch.errors.any? .alert.alert-danger %ul |