10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'app/helpers/asset_zip_importable/application_helper.rb', line 10
def imports_table(imports)
content_tag(:table, class: 'table') do
content_tag(:thead) do
content_tag(:tr) do
content_tag(:th, 'id') +
content_tag(:th, 'zip') +
content_tag(:th, 'アップロード日時') +
content_tag(:th, '処理済み件数') +
content_tag(:th, '全件数') +
content_tag(:th, '状態')
end
end +
content_tag(:tbody) do
imports.map do |import|
content_tag(:tr) do
content_tag(:td, import.id.to_s) +
content_tag(:td, link_to(import.read_attribute(:zip), import.zip_url)) +
content_tag(:td, import.created_at.to_s) +
content_tag(:td, import.completed_number.to_s) +
content_tag(:td, import.total_number.to_s) +
content_tag(:td) do
if import.completed?
content_tag(:span, '完了', class: 'label label-success')
else
content_tag(:span, '未完了', class: 'label label-default')
end
end
end
end.join.html_safe
end
end
end
|