Skip to content
Snippets Groups Projects
Unverified Commit 7be89a94 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'admin-builds-page'


Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	CHANGELOG
parents dbd73684 0a4a1afe
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -6,6 +6,7 @@ v5.1
- Add coverage parsing feature
- Update rails to 4.0.10
- Look for a REVISION file before running `git log`
- All builds page for admin
 
v5.0.1
- Update rails to 4.0.5
Loading
Loading
class Admin::BuildsController < Admin::ApplicationController
before_filter :authenticate_user!
def index
@builds = Build.order('created_at DESC').page(params[:page]).per(30)
end
end
%tr.build.alert{class: build_status_alert_class(build)}
%td.status
= build.status
%td.runner
- if build.runner
= link_to build.runner.id, admin_runner_path(build.runner)
%td.build-link
= link_to build_url(build) do
%strong #{build.short_sha}
%td.build-project
= truncate build.project.name, length: 30
%td.build-message
%span= truncate(build.git_commit_message, length: 50)
%td.build-branch
= build.ref
%td.duration
- if build.duration
#{distance_of_time_in_words build.duration}
%td.timestamp
- if build.finished_at
%span #{time_ago_in_words build.finished_at} ago
= content_for :title do
%h3.project-title
All builds
.pull-right
%small
= pluralize(@builds.total_count, 'build')
%table.builds
%thead
%tr
%th Status
%th Runner
%th Commit
%th Project
%th Message
%th Branch
%th Duration
%th Finished at
= render @builds
= paginate @builds
Loading
Loading
@@ -16,6 +16,9 @@
%li
= link_to admin_projects_path do
Projects
%li
= link_to admin_builds_path do
Builds
%li
= link_to 'Help', help_path
 
Loading
Loading
Loading
Loading
@@ -48,6 +48,8 @@ GitlabCi::Application.routes.draw do
resources :projects do
resources :runner_projects
end
resources :builds, only: :index
end
 
root :to => 'projects#index'
Loading
Loading
require 'spec_helper'
describe "Admin Builds" do
let(:project) { FactoryGirl.create :project }
let(:build) { FactoryGirl.create :build, project: project }
before do
skip_admin_auth
login_as :user
end
describe "GET /admin/builds" do
before do
build
visit admin_builds_path
end
it { page.should have_content "All builds" }
it { page.should have_content build.short_sha }
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment