Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

Commit

Permalink
Improve UI for builds
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaporozhets committed Jan 13, 2015
1 parent 158532f commit 14d62c3
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 10 deletions.
19 changes: 15 additions & 4 deletions app/views/builds/_build.html.haml
Expand Up @@ -8,11 +8,22 @@

%td
- if build.job
= build.job.name
- if build.for_tag?
%span.label.label-primary
%i.icon-tag
= build.ref
Tag
·
#{build.ref}
- else
Commit
·
#{build.short_sha}
%td
= build.job.name
- if build.tags.any?
.pull-right
- build.tag_list.each do |tag|
%span.label.label-primary
= tag


%td.duration
- if build.duration
Expand Down
23 changes: 18 additions & 5 deletions app/views/builds/show.html.haml
Expand Up @@ -36,12 +36,16 @@
.col-md-9
.build-head.alert{class: build_status_alert_class(@build)}
%h4
Build for commit
%code #{@build.short_sha}
from
- if @build.for_tag?
Build for tag
%code #{@build.ref}
- else
Build for commit
%code #{@build.short_sha}
from

= link_to project_path(@build.project, ref: @build.ref) do
%span.label.label-primary= "#{@build.ref}"
= link_to project_path(@build.project, ref: @build.ref) do
%span.label.label-primary= "#{@build.ref}"

- if @build.duration
.pull-right
Expand Down Expand Up @@ -73,6 +77,7 @@
Test coverage
%h1 #{@build.coverage}%


.build-widget
%h4.title
Build
Expand Down Expand Up @@ -118,6 +123,14 @@
%span.attr-name Message:
#{@build.commit.git_commit_message}

- if @build.tags.any?
.build-widget
%h4.title
Tags
- @build.tag_list.each do |tag|
%span.label.label-primary
= tag

- if @builds.present?
.build-widget
%h4.title #{pluralize(@builds.count, "other build")} for #{@build.short_sha}:
Expand Down
2 changes: 2 additions & 0 deletions app/views/commits/show.html.haml
Expand Up @@ -57,6 +57,7 @@
%tr
%th Status
%th Build ID
%th Trigger
%th Job
%th Duration
%th Finished at
Expand All @@ -74,6 +75,7 @@
%tr
%th Status
%th Build ID
%th Trigger
%th Job
%th Duration
%th Finished at
Expand Down
3 changes: 2 additions & 1 deletion spec/features/commits_spec.rb
Expand Up @@ -5,7 +5,8 @@
login_as :user
@project = FactoryGirl.create :project
@commit = FactoryGirl.create :commit, project: @project
@build = FactoryGirl.create :build, commit: @commit
@job = FactoryGirl.create :job, project: @project
@build = FactoryGirl.create :build, commit: @commit, job: @job
end

describe "GET /:project/commits/:sha" do
Expand Down
1 change: 1 addition & 0 deletions spec/requests/api/builds_spec.rb
Expand Up @@ -17,6 +17,7 @@
describe "POST /builds/register" do
it "should start a build" do
commit = FactoryGirl.create(:commit, project: project)
job = FactoryGirl.create :job, project: project
build = commit.create_builds.first

post api("/builds/register"), token: runner.token
Expand Down

0 comments on commit 14d62c3

Please sign in to comment.