Commit 7f5f16cd571f119c2aa0669fa2ee0f2d9bef19f4

Authored by Chris Cooke
Committed by Nick Recobra
1 parent 717eec1a
Exists in master and in 1 other branch production

List all deploys for an app but with no pagination

app/controllers/deploys_controller.rb
... ... @@ -13,5 +13,11 @@ class DeploysController < ApplicationController
13 13 })
14 14 render :xml => @deploy
15 15 end
  16 +
  17 + def index
  18 + app = current_user.apps.find(:conditions => {:name => params[:app_id]}).first
  19 +
  20 + @deploys = app.deploys.order_by(:created_at.desc)
  21 + end
16 22  
17   -end
18 23 \ No newline at end of file
  24 +end
... ...
app/views/deploys/_table.html.haml 0 → 100644
... ... @@ -0,0 +1,20 @@
  1 +%table.errs
  2 + %thead
  3 + %tr
  4 + %th App
  5 + %th When
  6 + %th Who
  7 + %th Message
  8 + %th Repository
  9 + %th Revision
  10 + %tbody
  11 + - deploys.each do |deploy|
  12 + %tr
  13 + %td.app
  14 + = deploy.app.name
  15 + %span.environment= deploy.environment
  16 + %td.latest #{time_ago_in_words(deploy.created_at)} ago
  17 + %td.who #{deploy.username}
  18 + %td.message #{deploy.message}
  19 + %td.repository #{deploy.repository}
  20 + %td.revision #{deploy.revision}
... ...
app/views/deploys/index.html.haml 0 → 100644
... ... @@ -0,0 +1,2 @@
  1 +- content_for :title, 'Deploys'
  2 += render 'table', :deploys => @deploys
... ...
config/routes.rb
... ... @@ -22,6 +22,8 @@ Errbit::Application.routes.draw do
22 22 put :resolve
23 23 end
24 24 end
  25 +
  26 + resources :deploys, :only => [:index]
25 27 end
26 28  
27 29 devise_for :users
... ...