diff --git a/app/controllers/report_controller.rb b/app/controllers/report_controller.rb index 080f493b..9a3064d7 100644 --- a/app/controllers/report_controller.rb +++ b/app/controllers/report_controller.rb @@ -12,6 +12,7 @@ def files theses = Thesis.all @terms = report.extract_terms theses subset = filter_theses_by_term theses + @list = report.list_unattached_files subset end def index diff --git a/app/models/report.rb b/app/models/report.rb index 47253f8a..ac650ad2 100644 --- a/app/models/report.rb +++ b/app/models/report.rb @@ -252,6 +252,16 @@ def extract_terms(collection) collection.pluck(:grad_date).uniq.sort end + def list_unattached_files(collection) + result = [] + collection.joins(:files_attachments).order(:grad_date).uniq.each do |record| + record.files.where(purpose: nil).each do |file| + result.push(file) + end + end + result + end + def table_copyright(collection) result = {} collection.group(:copyright).count.each do |record| diff --git a/app/views/report/_files_empty.html.erb b/app/views/report/_files_empty.html.erb new file mode 100644 index 00000000..ce45e78b --- /dev/null +++ b/app/views/report/_files_empty.html.erb @@ -0,0 +1,3 @@ +
File | +Authors | +Departments | +Description | +
---|