This repository was archived by the owner on May 12, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +85
-0
lines changed Expand file tree Collapse file tree 7 files changed +85
-0
lines changed Original file line number Diff line number Diff line change 66 - Add coverage parsing feature
77 - Update rails to 4.0.10
88 - Look for a REVISION file before running `git log`
9+ - All builds page for admin
910
1011v5.0.1
1112 - Update rails to 4.0.5
Original file line number Diff line number Diff line change 1+ class Admin ::BuildsController < Admin ::ApplicationController
2+ before_filter :authenticate_user!
3+
4+ def index
5+ @builds = Build . order ( 'created_at DESC' ) . page ( params [ :page ] ) . per ( 30 )
6+ end
7+ end
Original file line number Diff line number Diff line change 1+ %tr .build.alert {class: build_status_alert_class(build)}
2+ %td .status
3+ = build.status
4+
5+ %td .runner
6+ - if build.runner
7+ = link_to build.runner.id, admin_runner_path(build.runner)
8+
9+ %td .build-link
10+ = link_to build_url(build) do
11+ %strong #{build.short_sha}
12+
13+ %td .build-project
14+ = truncate build.project.name, length: 30
15+
16+ %td .build-message
17+ %span = truncate(build.git_commit_message, length: 50)
18+
19+ %td .build-branch
20+ = build.ref
21+
22+ %td .duration
23+ - if build.duration
24+ #{distance_of_time_in_words build.duration}
25+
26+ %td .timestamp
27+ - if build.finished_at
28+ %span #{time_ago_in_words build.finished_at} ago
Original file line number Diff line number Diff line change 1+ = content_for :title do
2+ %h3 .project-title
3+ All builds
4+
5+ .pull-right
6+ %small
7+ = pluralize(@builds.total_count, 'build')
8+
9+ %table .builds
10+ %thead
11+ %tr
12+ %th Status
13+ %th Runner
14+ %th Commit
15+ %th Project
16+ %th Message
17+ %th Branch
18+ %th Duration
19+ %th Finished at
20+
21+ = render @builds
22+
23+ = paginate @builds
Original file line number Diff line number Diff line change 1616 %li
1717 = link_to admin_projects_path do
1818 Projects
19+ %li
20+ = link_to admin_builds_path do
21+ Builds
1922 %li
2023 = link_to 'Help', help_path
2124
Original file line number Diff line number Diff line change 4848 resources :projects do
4949 resources :runner_projects
5050 end
51+
52+ resources :builds , only : :index
5153 end
5254
5355 root :to => 'projects#index'
Original file line number Diff line number Diff line change 1+ require 'spec_helper'
2+
3+ describe "Admin Builds" do
4+ let ( :project ) { FactoryGirl . create :project }
5+ let ( :build ) { FactoryGirl . create :build , project : project }
6+
7+ before do
8+ skip_admin_auth
9+ login_as :user
10+ end
11+
12+ describe "GET /admin/builds" do
13+ before do
14+ build
15+ visit admin_builds_path
16+ end
17+
18+ it { page . should have_content "All builds" }
19+ it { page . should have_content build . short_sha }
20+ end
21+ end
You can’t perform that action at this time.
0 commit comments