diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-22 16:30:06 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-01-22 16:30:06 -0800 |
commit | 1533f3404621bd088cbe78ac7e2a14edc9915691 (patch) | |
tree | 6c56c4cc757eea9638c260fa23a13092ed4d8c33 /app | |
parent | 478735db63e2d1291fdb40908e1de329a2ea5056 (diff) | |
download | gitlab-ci-1533f3404621bd088cbe78ac7e2a14edc9915691.tar.gz |
Build page is visible for other people
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/builds_controller.rb | 2 | ||||
-rw-r--r-- | app/views/builds/_build.html.haml | 4 | ||||
-rw-r--r-- | app/views/builds/show.html.haml | 20 | ||||
-rw-r--r-- | app/views/layouts/project.html.haml | 9 | ||||
-rw-r--r-- | app/views/projects/_form.html.haml | 2 |
5 files changed, 21 insertions, 16 deletions
diff --git a/app/controllers/builds_controller.rb b/app/controllers/builds_controller.rb index e83fa68..d8ebcc0 100644 --- a/app/controllers/builds_controller.rb +++ b/app/controllers/builds_controller.rb @@ -2,7 +2,7 @@ class BuildsController < ApplicationController before_filter :authenticate_user!, except: [:status] before_filter :project before_filter :authorize_access_project!, except: [:status] - before_filter :authorize_manage_project!, except: [:status] + before_filter :authorize_manage_project!, except: [:status, :show] before_filter :build, except: [:show] def show diff --git a/app/views/builds/_build.html.haml b/app/views/builds/_build.html.haml index c2f1264..2cd3d7c 100644 --- a/app/views/builds/_build.html.haml +++ b/app/views/builds/_build.html.haml @@ -17,7 +17,7 @@ · #{build.short_sha} %td - = build.job.name + = build.job_name - if build.tags.any? .pull-right - build.tag_list.each do |tag| @@ -39,7 +39,7 @@ #{build.coverage}% %td - - if defined?(controls) + - if defined?(controls) && current_user.can_manage_project?(@project.gitlab_id) .pull-right - if build.active? = link_to cancel_project_build_path(build.project, build, return_to: request.original_url), title: 'Cancel build' do diff --git a/app/views/builds/show.html.haml b/app/views/builds/show.html.haml index cd0bba5..080aec4 100644 --- a/app/views/builds/show.html.haml +++ b/app/views/builds/show.html.haml @@ -2,10 +2,11 @@ = @project.name @ = @commit.short_sha - .pull-right - = link_to edit_project_path(@project), class: "btn btn-default btn-small" do - %i.icon-edit.icon-white - Edit Project + - if current_user.can_manage_project?(@project.gitlab_id) + .pull-right + = link_to edit_project_path(@project), class: "btn btn-default btn-small" do + %i.icon-edit.icon-white + Edit Project %p = link_to project_commit_path(@project, @build.commit) do @@ -81,11 +82,12 @@ .build-widget %h4.title Build - .pull-right - - if @build.active? - = link_to "Cancel", cancel_project_build_path(@project, @build), class: 'btn btn-sm btn-danger' - - else - = link_to "Retry", retry_project_build_path(@project, @build), class: 'btn btn-sm btn-primary', method: :post + - if current_user.can_manage_project?(@project.gitlab_id) + .pull-right + - if @build.active? + = link_to "Cancel", cancel_project_build_path(@project, @build), class: 'btn btn-sm btn-danger' + - else + = link_to "Retry", retry_project_build_path(@project, @build), class: 'btn btn-sm btn-primary', method: :post - if @build.duration %p diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml index 3dd18ca..ba90d55 100644 --- a/app/views/layouts/project.html.haml +++ b/app/views/layouts/project.html.haml @@ -17,8 +17,8 @@ = link_to 'View on GitLab', @project.gitlab_url, class: 'btn btn-small' %hr .container - .row - - if current_user && current_user.can_manage_project?(@project.gitlab_id) + - if current_user && current_user.can_manage_project?(@project.gitlab_id) + .row .col-md-2.append-bottom-20 %ul.nav.nav-pills.nav-stacked.project-menu = nav_link path: 'projects#show' do @@ -54,5 +54,8 @@ = link_to edit_project_path(@project) do %i.icon-cogs Settings - .col-md-10 + .col-md-10 + = yield + - else + .col-md-12 = yield diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index b3d7265..d8ff9ff 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -59,7 +59,7 @@ .checkbox = f.label :public do = f.check_box :public - %span.light Anyone can see project and builds list + %span.light Anyone can see project and builds .form-group = f.label :coverage_regex, "Test coverage parsing", class: 'control-label' .col-sm-10 |