summaryrefslogtreecommitdiff
path: root/app/views/ci
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-09-09 17:36:01 +0300
committerValery Sizov <vsv2711@gmail.com>2015-09-09 17:36:01 +0300
commit44261a5d9fd5b78f8a44fe330e2386525f4c3437 (patch)
tree95679471c902db7430bee6d74a7ae61cf6999b4f /app/views/ci
parent81f9ee48b161496cfd7c033e10dcecc52c9b50be (diff)
downloadgitlab-ce-44261a5d9fd5b78f8a44fe330e2386525f4c3437.tar.gz
integration with gitlab auth
Diffstat (limited to 'app/views/ci')
-rw-r--r--app/views/ci/builds/_build.html.haml2
-rw-r--r--app/views/ci/builds/show.html.haml12
-rw-r--r--app/views/ci/commits/_commit.html.haml2
-rw-r--r--app/views/ci/commits/show.html.haml4
-rw-r--r--app/views/ci/projects/_gl_projects.html.haml2
-rw-r--r--app/views/ci/projects/gitlab.html.haml4
-rw-r--r--app/views/ci/projects/show.html.haml2
-rw-r--r--app/views/ci/user_sessions/show.html.haml2
8 files changed, 13 insertions, 17 deletions
diff --git a/app/views/ci/builds/_build.html.haml b/app/views/ci/builds/_build.html.haml
index 54ca1102b5c..da306c9f020 100644
--- a/app/views/ci/builds/_build.html.haml
+++ b/app/views/ci/builds/_build.html.haml
@@ -35,7 +35,7 @@
#{build.coverage}%
%td
- - if defined?(controls) && current_user && current_user.has_developer_access?(@project.gitlab_id)
+ - if defined?(controls) && current_user && can?(current_user, :manage_builds, gl_project)
.pull-right
- if build.active?
= link_to cancel_ci_project_build_path(build.project, build, return_to: request.original_url), title: 'Cancel build' do
diff --git a/app/views/ci/builds/show.html.haml b/app/views/ci/builds/show.html.haml
index 0bef67d8a20..a698176c3ed 100644
--- a/app/views/ci/builds/show.html.haml
+++ b/app/views/ci/builds/show.html.haml
@@ -1,10 +1,10 @@
%h4.page-title
- = link_to @project.name, @project
+ = link_to ci_project_path(@project)
@
= @commit.short_sha
%p
- = link_to ci_project_ref_commit_path(@project, @commit.ref, @commit.sha) do
+ = link_to ci_project_ref_commits_path(@project, @commit.ref, @commit.sha) do
&larr; Back to project commit
%hr
#up-build-trace
@@ -12,7 +12,7 @@
%ul.nav.nav-tabs.append-bottom-10
- @commit.builds_without_retry_sorted.each do |build|
%li{class: ('active' if build == @build) }
- = link_to ci_build_url(build) do
+ = link_to ci_project_build_url(@project, build) do
%i{class: build_icon_css_class(build)}
%span
Build ##{build.id}
@@ -84,7 +84,7 @@
.build-widget
%h4.title
Build
- - if current_user && current_user.has_developer_access?(@project.gitlab_id)
+ - if current_user && can?(current_user, :manage_builds, gl_project)
.pull-right
- if @build.active?
= link_to "Cancel", cancel_ci_project_build_path(@project, @build), class: 'btn btn-sm btn-danger'
@@ -161,7 +161,7 @@
- @builds.each_with_index do |build, i|
%tr.build.alert{class: build_status_alert_class(build)}
%td
- = link_to ci_build_url(build) do
+ = link_to ci_project_build_url(@project, build) do
%span ##{build.id}
%td
- if build.name
@@ -173,4 +173,4 @@
:javascript
- new CiBuild("#{ci_build_url(@build)}", "#{@build.status}")
+ new CiBuild("#{ci_project_build_url(@project, @build)}", "#{@build.status}")
diff --git a/app/views/ci/commits/_commit.html.haml b/app/views/ci/commits/_commit.html.haml
index a955a5b6479..c1b1988d147 100644
--- a/app/views/ci/commits/_commit.html.haml
+++ b/app/views/ci/commits/_commit.html.haml
@@ -7,7 +7,7 @@
%td.build-link
- = link_to ci_project_ref_commit_path(commit.project, commit.ref, commit.sha) do
+ = link_to ci_project_ref_commits_path(commit.project, commit.ref, commit.sha) do
%strong #{commit.short_sha}
%td.build-message
diff --git a/app/views/ci/commits/show.html.haml b/app/views/ci/commits/show.html.haml
index 832cc6a1bae..9b597b45aa5 100644
--- a/app/views/ci/commits/show.html.haml
+++ b/app/views/ci/commits/show.html.haml
@@ -33,10 +33,10 @@
%span.attr-name Created at:
#{@commit.created_at.to_s(:short)}
-- if current_user && current_user.has_developer_access?(@project.gitlab_id)
+- if current_user && can?(current_user, :manage_builds, gl_project)
.pull-right
- if @commit.builds.running_or_pending.any?
- = link_to "Cancel", cancel_ci_project_ref_commit_path(@project, @commit.ref, @commit.sha), class: 'btn btn-sm btn-danger'
+ = link_to "Cancel", cancel_ci_project_ref_commits_path(@project, @commit.ref, @commit.sha), class: 'btn btn-sm btn-danger'
- if @commit.yaml_errors.present?
diff --git a/app/views/ci/projects/_gl_projects.html.haml b/app/views/ci/projects/_gl_projects.html.haml
index 6ed19e13887..f63d8246e96 100644
--- a/app/views/ci/projects/_gl_projects.html.haml
+++ b/app/views/ci/projects/_gl_projects.html.haml
@@ -11,5 +11,5 @@
Added
- else
= form_tag ci_projects_path do
- = hidden_field_tag :project, project.to_h.to_json
+ = hidden_field_tag :project, project.to_json
= submit_tag 'Add project to CI', class: 'btn btn-default btn-sm'
diff --git a/app/views/ci/projects/gitlab.html.haml b/app/views/ci/projects/gitlab.html.haml
index bd55b1f12e7..0344676680e 100644
--- a/app/views/ci/projects/gitlab.html.haml
+++ b/app/views/ci/projects/gitlab.html.haml
@@ -4,10 +4,6 @@
Fetched from GitLab (#{link_to GitlabCi.config.gitlab_server.url, GitlabCi.config.gitlab_server.url, no_turbolink})
- if params[:search].present?
by keyword: "#{params[:search]}",
- #{time_ago_in_words(current_user.sync_at)} ago.
- = link_to gitlab_ci_projects_path(reset_cache: true, search: params[:search]), class: 'sync-now btn btn-sm btn-default reset-cache' do
- %i.fa.fa-refresh
- Sync now
%br
.pull-right
diff --git a/app/views/ci/projects/show.html.haml b/app/views/ci/projects/show.html.haml
index 27899591391..b79ab957ba8 100644
--- a/app/views/ci/projects/show.html.haml
+++ b/app/views/ci/projects/show.html.haml
@@ -1,6 +1,6 @@
= render 'ci/shared/guide' unless @project.setup_finished?
-- if current_user && current_user.can_manage_project?(@project.gitlab_id) && !@project.any_runners?
+- if current_user && can?(current_user, :manage_project, gl_project) && !@project.any_runners?
.alert.alert-danger
Builds for this project wont be served unless you configure runners on
= link_to "Runners page", ci_project_runners_path(@project)
diff --git a/app/views/ci/user_sessions/show.html.haml b/app/views/ci/user_sessions/show.html.haml
index 43f64a429b2..0710e205618 100644
--- a/app/views/ci/user_sessions/show.html.haml
+++ b/app/views/ci/user_sessions/show.html.haml
@@ -2,7 +2,7 @@
%h3
Hi, #{@user.name}
- - if @user.is_admin
+ - if @user.is_admin?
%span.label.label-success Admin
.profile-block