Commit fc795d6e authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix graphical glitches

parent e5e6c846
...@@ -14,9 +14,11 @@ module Ci ...@@ -14,9 +14,11 @@ module Ci
def show def show
@ref = params[:ref] @ref = params[:ref]
@commits = @project.commits.reverse_order @commits = @project.commits.group(:sha).reverse_order
# TODO: this is broken if @ref
# @commits = @commits.where(ref: @ref) if @ref builds = @project.builds.where(ref: @ref).select(:commit_id).distinct
@commits = @commits.where(id: builds)
end
@commits = @commits.page(params[:page]).per(20) @commits = @commits.page(params[:page]).per(20)
end end
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
%td.build-branch %td.build-branch
- unless @ref - unless @ref
%span %span
= link_to truncate(commit.last_ref, length: 25), ci_project_path(@project, ref: commit.last_ref) - commit.refs.each do |ref|
= link_to truncate(ref, length: 25), ci_project_path(@project, ref: ref)
%td.duration %td.duration
- if commit.duration > 0 - if commit.duration > 0
......
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
.gray-content-block.middle-block .gray-content-block.middle-block
%pre.commit-message %pre.commit-message
- if @commit.git_commit_message
#{@commit.git_commit_message} #{@commit.git_commit_message}
- else
No commit message
.gray-content-block.second-block .gray-content-block.second-block
.row .row
...@@ -12,6 +15,11 @@ ...@@ -12,6 +15,11 @@
%p %p
%span.attr-name Commit: %span.attr-name Commit:
#{gitlab_commit_link(@project, @commit.sha)} #{gitlab_commit_link(@project, @commit.sha)}
%p
- if @commit.refs.present?
%span.attr-name Refs:
- @commit.refs.each do |ref|
#{gitlab_ref_link(@project, ref)}
.col-sm-6 .col-sm-6
- if @commit.git_author_name || @commit.git_author_email - if @commit.git_author_name || @commit.git_author_email
%p %p
...@@ -22,9 +30,9 @@ ...@@ -22,9 +30,9 @@
%span.attr-name Created at: %span.attr-name Created at:
#{@commit.created_at.to_s(:short)} #{@commit.created_at.to_s(:short)}
- if current_user && can?(current_user, :manage_builds, gl_project) - if current_user && can?(current_user, :manage_builds, gl_project)
.pull-right
- if @commit.builds.running_or_pending.any? - if @commit.builds.running_or_pending.any?
.pull-right
= link_to "Cancel", cancel_ci_project_commits_path(@project, @commit), class: 'btn btn-sm btn-danger' = link_to "Cancel", cancel_ci_project_commits_path(@project, @commit), class: 'btn btn-sm btn-danger'
...@@ -41,7 +49,7 @@ ...@@ -41,7 +49,7 @@
- @commit.refs.each do |ref| - @commit.refs.each do |ref|
%h3 %h3
Builds for #{ref} Builds for #{gitlab_ref_link(@project, ref)}
- if @commit.duration_for_ref(ref) > 0 - if @commit.duration_for_ref(ref) > 0
%small.pull-right %small.pull-right
%i.fa.fa-time %i.fa.fa-time
......
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