diff --git a/app/controllers/deploys_controller.rb b/app/controllers/deploys_controller.rb index 17847bf..5bfe976 100644 --- a/app/controllers/deploys_controller.rb +++ b/app/controllers/deploys_controller.rb @@ -13,5 +13,11 @@ class DeploysController < ApplicationController }) render :xml => @deploy end + + def index + app = current_user.apps.find(:conditions => {:name => params[:app_id]}).first + + @deploys = app.deploys.order_by(:created_at.desc) + end -end \ No newline at end of file +end diff --git a/app/views/deploys/_table.html.haml b/app/views/deploys/_table.html.haml new file mode 100644 index 0000000..6a70bad --- /dev/null +++ b/app/views/deploys/_table.html.haml @@ -0,0 +1,20 @@ +%table.errs + %thead + %tr + %th App + %th When + %th Who + %th Message + %th Repository + %th Revision + %tbody + - deploys.each do |deploy| + %tr + %td.app + = deploy.app.name + %span.environment= deploy.environment + %td.latest #{time_ago_in_words(deploy.created_at)} ago + %td.who #{deploy.username} + %td.message #{deploy.message} + %td.repository #{deploy.repository} + %td.revision #{deploy.revision} diff --git a/app/views/deploys/index.html.haml b/app/views/deploys/index.html.haml new file mode 100644 index 0000000..4434ca9 --- /dev/null +++ b/app/views/deploys/index.html.haml @@ -0,0 +1,2 @@ +- content_for :title, 'Deploys' += render 'table', :deploys => @deploys diff --git a/config/routes.rb b/config/routes.rb index 9f4cd9a..33afb06 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -22,6 +22,8 @@ Errbit::Application.routes.draw do put :resolve end end + + resources :deploys, :only => [:index] end devise_for :users -- libgit2 0.21.2