diff --git a/app/assets/javascripts/repositories/repository_datatable.js b/app/assets/javascripts/repositories/repository_datatable.js index 770ed7457..229d2e1f3 100644 --- a/app/assets/javascripts/repositories/repository_datatable.js +++ b/app/assets/javascripts/repositories/repository_datatable.js @@ -230,15 +230,18 @@ $('form#form-export').submit(function() { case 'checkbox': val = -1; break; - case 'row-name': + case 'assigned': val = -2; break; - case 'added-by': + case 'row-name': val = -3; break; - case 'added-on': + case 'added-by': val = -4; break; + case 'added-on': + val = -5; + break; default: val = th.attr('id'); } diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 97713e9e6..42f57f741 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -245,18 +245,18 @@ class RepositoriesController < ApplicationController def to_csv(rows, column_ids) require 'csv' - +byebug # Parse column names csv_header = [] column_ids.each do |c_id| csv_header << case c_id.to_i - when -1 + when -1, -2 next - when -2 - I18n.t('repositories.table.row_name') when -3 - I18n.t('repositories.table.added_by') + I18n.t('repositories.table.row_name') when -4 + I18n.t('repositories.table.added_by') + when -5 I18n.t('repositories.table.added_on') else column = RepositoryColumn.find_by_id(c_id) @@ -265,18 +265,19 @@ class RepositoriesController < ApplicationController end CSV.generate do |csv| + byebug csv << csv_header rows.each do |row| csv_row = [] column_ids.each do |c_id| csv_row << case c_id.to_i - when -1 + when -1, -2 next - when -2 - row.name when -3 - row.created_by.full_name + row.name when -4 + row.created_by.full_name + when -5 I18n.l(row.created_at, format: :full) else cell = row.repository_cells