Commit 54d0ff98 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'build-related-fixes' into 'master'

Build related UI fixes

## Before

![Screen_Shot_2015-12-08_at_13.15.21](/uploads/b72ed55da1f0ec953d2eb077fa4fbb18/Screen_Shot_2015-12-08_at_13.15.21.png)

## After

![Screen_Shot_2015-12-08_at_13.15.01](/uploads/144d8099e2724a51125e392dcbd43ed4/Screen_Shot_2015-12-08_at_13.15.01.png)


See merge request !2015
parents 98368d6e ab85d969
......@@ -7,8 +7,8 @@
/* Common styles for all types */
.bs-callout {
margin: 20px 0;
padding: 20px;
margin: $gl-padding 0;
padding: $gl-padding;
border-left: 3px solid $border-color;
color: $text-color;
background: $background-color;
......@@ -42,4 +42,3 @@
border-color: #5cA64d;
color: #3c763d;
}
......@@ -333,7 +333,7 @@ table {
}
.well {
margin-bottom: 0;
margin-bottom: $gl-padding;
}
.search_box {
......@@ -379,9 +379,8 @@ table {
text-align: center;
margin-top: 5px;
margin-bottom: $gl-padding;
height: 56px;
height: auto;
margin-top: -$gl-padding;
padding-top: $gl-padding;
&.no-bottom {
margin-bottom: 0;
......@@ -390,6 +389,13 @@ table {
&.no-top {
margin-top: 0;
}
li a {
display: inline-block;
padding-top: $gl-padding;
padding-bottom: 11px;
margin-bottom: -1px;
}
}
.center-middle-menu {
......
......@@ -82,9 +82,6 @@
}
.center-top-menu {
height: 45px;
margin-bottom: 30px;
li a {
font-size: 14px;
padding: 19px 10px;
......
......@@ -2,8 +2,10 @@
margin-bottom: $gl-padding;
.panel-heading {
padding: 10px $gl-padding;
padding: 7px $gl-padding;
line-height: 42px !important;
}
.panel-body {
padding: $gl-padding;
......
......@@ -220,6 +220,7 @@ pre {
.monospace {
font-family: $monospace_font;
font-size: 90%;
}
code {
......
......@@ -67,9 +67,4 @@
color: #3084bb !important;
}
}
.build-top-menu {
margin-top: 0;
margin-bottom: 2px;
}
}
......@@ -136,7 +136,7 @@
font-family: $monospace_font;
font-weight: bold;
overflow: hidden;
font-size: 14px;
font-size: 90%;
margin: 0 3px;
}
......
......@@ -28,7 +28,7 @@ class Projects::ApplicationController < ApplicationController
private
def ci_enabled
def builds_enabled
return render_404 unless @project.builds_enabled?
end
......
......@@ -5,7 +5,7 @@ class Projects::GraphsController < Projects::ApplicationController
before_action :require_non_empty_project
before_action :assign_ref_vars
before_action :authorize_download_code!
before_action :ci_enabled, only: :ci
before_action :builds_enabled, only: :ci
def show
respond_to do |format|
......
......@@ -264,6 +264,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@merge_request_diff = @merge_request.merge_request_diff
@ci_commit = @merge_request.ci_commit
if @merge_request.locked_long_ago?
@merge_request.unlock_mr
@merge_request.close
......
......@@ -199,7 +199,7 @@ module Ci
end
def ci_yaml_file
gl_project.repository.blob_at(sha, '.gitlab-ci.yml').data
@ci_yaml_file ||= gl_project.repository.blob_at(sha, '.gitlab-ci.yml').data
rescue
nil
end
......
......@@ -28,9 +28,9 @@
.form-actions
- if current_user.private_token
= f.submit 'Reset private token', data: { confirm: "Are you sure?" }, class: "btn btn-default btn-build-token"
= f.submit 'Reset private token', data: { confirm: "Are you sure?" }, class: "btn btn-default"
- else
= f.submit 'Generate', class: "btn btn-default btn-build-token"
= f.submit 'Generate', class: "btn btn-default"
- unless current_user.ldap_user?
.panel.panel-default
......
......@@ -3,10 +3,10 @@
.project-issuable-filter
.controls
- if @ci_project && current_user && can?(current_user, :manage_builds, @project)
- if @ci_project && can?(current_user, :manage_builds, @project)
.pull-left.hidden-xs
- if @all_builds.running_or_pending.any?
= link_to 'Cancel all', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post
= link_to 'Cancel running', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post
%ul.center-top-menu
%li{class: ('active' if @scope.nil?)}
......@@ -50,4 +50,3 @@
= render 'projects/commit_statuses/commit_status', commit_status: build, commit_sha: true, stage: true, allow_retry: true
= paginate @builds, theme: 'gitlab'
- page_title "#{@build.name} (#{@build.id})", "Builds"
- page_title "#{@build.name} (##{@build.id})", "Builds"
= render "header_title"
.build-page
.gray-content-block
.gray-content-block.top-block
Build ##{@build.id} for commit
%strong.monospace
= link_to @build.commit.short_sha, ci_status_path(@build.commit)
%strong.monospace= link_to @build.commit.short_sha, ci_status_path(@build.commit)
from
= link_to @build.ref, namespace_project_commits_path(@project.namespace, @project, @build.ref)
#up-build-trace
- if @commit.matrix_for_ref?(@build.ref)
%ul.center-top-menu.build-top-menu
%ul.center-top-menu.no-top.no-bottom
- @commit.latest_builds_for_ref(@build.ref).each do |build|
%li{class: ('active' if build == @build) }
= link_to namespace_project_build_path(@project.namespace, @project, build) do
......@@ -22,7 +21,6 @@
- else
= build.id
- if @build.retried?
%li.active
%a
......@@ -31,7 +29,7 @@
%i.fa.fa-warning
This build was retried.
.gray-content-block.second-block
.gray-content-block.middle-block
.build-head
.clearfix
= ci_status_with_icon(@build.status)
......
%tr.commit_status
%td.status
- if commit_status.target_url
= link_to commit_status.target_url, class: "ci-status ci-#{commit_status.status}" do
= ci_icon_for_status(commit_status.status)
= commit_status.status
- else
= ci_status_with_icon(commit_status.status)
%td.commit_status-link
- if commit_status.target_url
= link_to commit_status.target_url do
%strong Build ##{commit_status.id}
%strong ##{commit_status.id}
- else
%strong Build ##{commit_status.id}
%strong ##{commit_status.id}
- if commit_status.show_warning?
%i.fa.fa-warning.text-warning
......
......@@ -12,10 +12,7 @@
.col-md-9
.votes-holder.pull-right
#votes= render 'votes/votes_block', votable: @issue
.participants
%span= pluralize(@participants.count, 'participant')
- @participants.each do |participant|
= link_to_member(@project, participant, name: false, size: 24)
= render "shared/issuable/participants"
.col-md-3
.input-group.cross-project-reference
%span#cross-project-reference.slead.has_tooltip{title: 'Cross-project reference'}
......
......@@ -12,7 +12,7 @@
.col-md-9
.votes-holder.pull-right
#votes= render 'votes/votes_block', votable: @merge_request
= render "projects/merge_requests/show/participants"
= render "shared/issuable/participants"
.col-md-3
.input-group.cross-project-reference
%span#cross-project-reference.slead.has_tooltip{title: 'Cross-project reference'}
......@@ -21,7 +21,7 @@
.row
%section.col-md-9
= render "projects/notes/notes_with_form"
.voting_notes#notes= render "projects/notes/notes_with_form"
%aside.col-md-3
.issuable-affix
.context
......
- ci_commit = @merge_request.ci_commit
- if ci_commit
- status = ci_commit.status
- if @ci_commit
- status = @ci_commit.status
.mr-widget-heading
.ci_widget{class: "ci-#{status}"}
= ci_status_icon(ci_commit)
= ci_status_icon(@ci_commit)
%span CI build #{status}
for #{@merge_request.last_commit_short_sha}.
%span.ci-coverage
= link_to "View build details", ci_status_path(ci_commit)
= link_to "View build details", ci_status_path(@ci_commit)
- elsif @merge_request.has_ci?
- # Compatibility with old CI integrations (ex jenkins) when you request status from CI server via AJAX
......
- status_class = @merge_request.ci_commit ? " ci-#{@merge_request.ci_commit.status}" : nil
- status_class = @ci_commit ? " ci-#{@ci_commit.status}" : nil
= form_for [:merge, @project.namespace.becomes(Namespace), @project, @merge_request], remote: true, method: :post, html: { class: 'accept-mr-form js-requires-input' } do |f|
= hidden_field_tag :authenticity_token, form_authenticity_token
......
.append-bottom-20
.gray-content-block.top-block.append-bottom-default
.tree-ref-holder
= render partial: 'shared/ref_switcher', locals: {destination: 'graph'}
.pull-right.visible-lg.light You can move around the graph by using the arrow keys.
.oneline
You can move around the graph by using the arrow keys.
......@@ -3,7 +3,7 @@
%p.light Keep stable branches secure and force developers to use Merge Requests
%hr
.well.append-bottom-20
.well
%p Protected branches are designed to
%ul
%li prevent pushes from everybody except #{link_to "masters", help_page_path("permissions", "permissions"), class: "vlink"}
......
.participants
%span #{@participants.count} participants
%span
= pluralize @participants.count, "participant"
- @participants.each do |participant|
= link_to_member(@project, participant, name: false, size: 24)
......@@ -19,7 +19,7 @@ describe "Builds" do
end
it { expect(page).to have_content 'Running' }
it { expect(page).to have_content 'Cancel all' }
it { expect(page).to have_content 'Cancel running' }
it { expect(page).to have_content @build.short_sha }
it { expect(page).to have_content @build.ref }
it { expect(page).to have_content @build.name }
......@@ -32,7 +32,7 @@ describe "Builds" do
end
it { expect(page).to have_content 'No builds to show' }
it { expect(page).to have_content 'Cancel all' }
it { expect(page).to have_content 'Cancel running' }
end
context "All builds" do
......@@ -45,7 +45,7 @@ describe "Builds" do
it { expect(page).to have_content @build.short_sha }
it { expect(page).to have_content @build.ref }
it { expect(page).to have_content @build.name }
it { expect(page).to_not have_content 'Cancel all' }
it { expect(page).to_not have_content 'Cancel running' }
end
end
......@@ -53,11 +53,11 @@ describe "Builds" do
before do
@build.run!
visit namespace_project_builds_path(@gl_project.namespace, @gl_project)
click_link "Cancel all"
click_link "Cancel running"
end
it { expect(page).to have_content 'No builds to show' }
it { expect(page).to_not have_content 'Cancel all' }
it { expect(page).to_not have_content 'Cancel running' }
end
describe "GET /:project/builds/:id" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment