Module: Tasks::CollectionObjects::AreaAndDate::AreaAndDateHelper

Defined in:
app/helpers/tasks/collection_objects/area_and_date/area_and_date_helper.rb

Instance Method Summary collapse

Instance Method Details

#get_first_created_atObject



20
21
22
23
24
25
26
27
# File 'app/helpers/tasks/collection_objects/area_and_date/area_and_date_helper.rb', line 20

def get_first_created_at
  colobj = CollectionObject.with_project_id(sessions_current_project_id).first_created
  if colobj.blank?
    EARLIEST_DATE # 1700-01-01
  else
    colobj.created_at.to_date.strftime('%Y/%m/%d')
  end
end

#get_last_created_atObject



29
30
31
32
33
34
35
36
# File 'app/helpers/tasks/collection_objects/area_and_date/area_and_date_helper.rb', line 29

def get_last_created_at
  colobj = CollectionObject.with_project_id(sessions_current_project_id).last_created
  if colobj.blank?
    Date.today.strftime('%Y/%m/%d')
  else
    colobj.created_at.to_date.strftime('%Y/%m/%d')
  end
end

#id_range_select_tag(id_range_element, option_list) ⇒ Object



16
17
18
# File 'app/helpers/tasks/collection_objects/area_and_date/area_and_date_helper.rb', line 16

def id_range_select_tag(id_range_element, option_list)
  select_tag(id_range_element, options_for_select(option_list), prompt: 'Select an identifier')
end

#pagingObject



10
11
12
13
14
# File 'app/helpers/tasks/collection_objects/area_and_date/area_and_date_helper.rb', line 10

def paging
  if @collection_objects.any?
    paginate(@collection_objects, remote: true)
  end
end

#paging_infoObject



3
4
5
6
7
8
# File 'app/helpers/tasks/collection_objects/area_and_date/area_and_date_helper.rb', line 3

def paging_info
  # <p><%= page_entries_info(@collection_objects) %></p> <%= paginate @collection_objects %>
  if @collection_objects.any?
    page_entries_info(@collection_objects)
  end
end