Skip to content

Commit

Permalink
Add a date column to the model/build tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmooney committed Aug 10, 2016
1 parent 100339a commit 38dcca2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/presenters/build_status_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def initialize(builds, view_context)
private
def get_table_items(builds)
builds.map do |build|
StatusTableItem.new(build.id, build.model.name, build.status, build_status_path(id: build.build_id))
StatusTableItem.new(build.id, build.model.name, build.created_at, build.status, build_status_path(id: build.build_id))
end
end
end
2 changes: 1 addition & 1 deletion app/presenters/model_status_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def initialize(models_with_status, view_context)
private
def get_table_items(models_with_status)
models_with_status.map do |id, data|
StatusTableItem.new(id, data[:model].name, data[:status], model_status_path(id: id))
StatusTableItem.new(id, data[:model].name, data[:model].creation_date, data[:status], model_status_path(id: id))
end
end
end
2 changes: 1 addition & 1 deletion app/presenters/status_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ def initialize(table_name, items)
end
end

class StatusTableItem < Struct.new(:id, :name, :status, :uri)
class StatusTableItem < Struct.new(:id, :name, :date, :status, :uri)
end
3 changes: 3 additions & 0 deletions app/views/shared/_status_table.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
%thead
%tr
%th ID
%th Date
%th Status
%th Name
%tbody
- table.items.each do |item|
%tr
%td
= link_to(item.id, item.uri)
%td
= item.date
%td.text-center
= item.status
%td
Expand Down

0 comments on commit 38dcca2

Please sign in to comment.