Module: CollectionObjects::CatalogHelper

Defined in:
app/helpers/collection_objects/catalog_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) collection_object_catalog_date_range(item)



24
25
26
27
# File 'app/helpers/collection_objects/catalog_helper.rb', line 24

def collection_object_catalog_date_range(item)
  d = [ item.start_date, item.end_date].compact.collect{|t| t.strftime("%F")}.join('-')
  d.empty? ? (:em,'not provided') : d
end

- (Object) collection_object_history_row(item)



15
16
17
18
19
20
21
22
# File 'app/helpers/collection_objects/catalog_helper.rb', line 15

def collection_object_history_row(item)
  (:tr, class: [item.type.to_sym]) do 
    (:td, item.type.to_s.humanize ) +
    (:td, collection_object_catalog_date_range(item) ) +
    (:td, item.object_class_name ) + 
    (:td, object_link(item.object) ) 
  end
end

- (Object) collection_object_history_table(data)



3
4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/collection_objects/catalog_helper.rb', line 3

def collection_object_history_table(data)
  (:table, class: [:full_width]) do
    (:tr) do
      (:th, 'Event') +
        (:th, 'Date') +
        (:th, 'Derived from') + 
        (:th, 'Object') 
    end +
    data.ordered_by_date.collect{|d| collection_object_history_row(d)}.join.html_safe 
  end
end