Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/models/concerns/exportable_plan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,14 @@ def prepare_coversheet
hash
end
# rubocop:enable Metrics/AbcSize
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity

# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
def prepare_coversheet_for_csv(csv, _headings, hash)
csv << [_('Creator:'), format(_('%{author}'), author: hash[:attribution])]
csv << if Array(hash[:attribution]).many?
[_('Creators: '), format(_('%{authors}'), authors: Array(hash[:attribution]).join(', '))]
else
[_('Creator:'), format(_('%{authors}'), authors: hash[:attribution])]
end
csv << ['Affiliation: ', format(_('%{affiliation}'), affiliation: hash[:affiliation])]
csv << if hash[:funder].present?
[_('Template: '), format(_('%{funder}'), funder: hash[:funder])]
Expand All @@ -160,7 +163,6 @@ def prepare_coversheet_for_csv(csv, _headings, hash)
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize

# rubocop:disable Metrics/AbcSize, Metrics/BlockLength, Metrics/MethodLength
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
# rubocop:disable Metrics/ParameterLists
def show_section_for_csv(csv, phase, section, headings, unanswered, hash)
section[:questions].each do |question|
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/export/_plan_txt.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= "#{@plan.title}" %>
<%= "----------------------------------------------------------\n" %>
<% if @show_coversheet %>
<%= @hash[:attribution].length > 1 ? _("Creators: ") : _('Creator:') %> <%= @hash[:attribution].join(', ') %>
<%= Array(@hash[:attribution]).many? ? _("Creators: ") + Array(@hash[:attribution]).join(", ") : _('Creator:') + @hash[:attribution] %>
<%= _("Affiliation: ") + @hash[:affiliation] %>
<% if @hash[:funder].present? %>
<%= _("Template: ") + @hash[:funder] %>
Expand Down