Class: BulkImportTemplatesController

Inherits:
ApplicationController show all
Defined in:
frontend/app/controllers/bulk_import_templates_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#archivesspace, can_access?, permission_mappings, set_access_control

Instance Method Details

#downloadObject



46
47
48
# File 'frontend/app/controllers/bulk_import_templates_controller.rb', line 46

def download
  send_file "#{Rails.root}/docs/#{params['filename']}", status: 202
end

#indexObject



5
6
7
8
9
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
42
43
44
# File 'frontend/app/controllers/bulk_import_templates_controller.rb', line 5

def index
  @template_files = [
    {
      :name => t('import_job.import_type_accession_csv'),
      :filename => "aspace_accession_import_template.csv"
    },
    {
      :name => t('import_job.import_type_digital_object_csv'),
      :filename => "aspace_digital_object_import_template.csv"
    },
    {
      :name => t('import_job.bulk_import_csv'),
      :filename => "bulk_import_template.csv"
    },
    {
      :name => t('import_job.bulk_import_xlsx'),
      :filename => "bulk_import_template.xlsx"
    },
    {
      :name => t('import_job.bulk_import_DO_csv'),
      :filename => "bulk_import_DO_template.csv"
    },
    {
      :name => t('import_job.bulk_import_DO_xlsx'),
      :filename => "bulk_import_DO_template.xlsx"
    },
    {
      :name => t('import_job.import_type_location_csv'),
      :filename => "aspace_location_import_template.csv"
    },
    {
      :name => t('import_job.import_type_assessment_csv'),
      :filename => "aspace_assessment_import_template.csv"
    },
    {
      :name => I18n.t('import_job.import_type_subject_csv'),
      :filename => "aspace_subject_import_template.csv"
    },
  ].sort_by { |template| template[:name] }
end