Skip to content

Commit

Permalink
fix: Added a description line to the import spreadsheet template (#9920)
Browse files Browse the repository at this point in the history
  • Loading branch information
anaritadauane authored Mar 15, 2024
1 parent c13fb91 commit 3138a44
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 5 deletions.
42 changes: 37 additions & 5 deletions cgi/generate_sample_import_file.pl
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,48 @@
my $worksheet = $workbook->add_worksheet();
my %formats = (
normal => $workbook->add_format(border => 1, bold => 1),
mandatory => $workbook->add_format(border => 1, bold => 1, bg_color => '#aaffcc'),
recommended => $workbook->add_format(border => 1, bold => 1, bg_color => '#ccffdd'),
optional => $workbook->add_format(border => 1, bold => 1, bg_color => '#eeffee'),
mandatory => $workbook->add_format(
border => 1,
bold => 1,
bg_color => '#0f55cc',
color => 'white',
valign => 'vcenter',
align => 'center'
),
recommended => $workbook->add_format(
border => 1,
bold => 1,
bg_color => '#1f6ced',
color => 'white',
valign => 'vcenter',
align => 'center'
),
optional => $workbook->add_format(
border => 1,
bold => 1,
bg_color => '#4d89f1',
color => 'white',
valign => 'vcenter',
align => 'center'
),
description => $workbook->add_format(italic => 1, text_wrap => 1, valign => 'vcenter'),
);

# Re-use the structure used to output select2 options in import_file_select_format.pl
my $select2_options_ref = generate_import_export_columns_groups_for_select2([$lc]);

my $headers_row = 0;
my $col = 0;
my $description_row = 1;
my $col = 1;

my $description = lang("description");
my $field_id;
my $comment;

$worksheet->set_row(0, 70);
$worksheet->set_column('A:ZZ', 30);
$worksheet->set_column('A:A', 30);
$worksheet->write($description_row, 0, $description, $formats{'description'});

foreach my $group_ref (@$select2_options_ref) {
my $group_start_col = $col;
Expand Down Expand Up @@ -184,7 +216,7 @@
$worksheet->set_column($col, $col, $width);

if ($comment ne "") {
$worksheet->write_comment($headers_row, $col, $comment);
$worksheet->write($description_row, $col, $comment, $formats{'description'});
}

$col++;
Expand Down
4 changes: 4 additions & 0 deletions po/common/common.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6845,3 +6845,7 @@ msgstr ""
msgctxt "sweetener"
msgid "sweetener"
msgstr ""

msgctxt "description"
msgid "Description"
msgstr "Description"
4 changes: 4 additions & 0 deletions po/common/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -6864,3 +6864,7 @@ msgstr "sweeteners"
msgctxt "sweetener"
msgid "sweetener"
msgstr "sweetener"

msgctxt "description"
msgid "Description"
msgstr "Description"
4 changes: 4 additions & 0 deletions po/common/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,10 @@ msgctxt "delete_confirmation"
msgid "This will delete your user details and anonymise all of your contributions. Please re-enter your user name to confirm."
msgstr "Esto eliminará sus datos de usuario y anonimizará todas sus contribuciones. Vuelva a ingresar su nombre de usuario para confirmar."

msgctxt "description"
msgid "Description"
msgstr "Descripción"

msgctxt "danger_zone"
msgid "Danger Zone"
msgstr "Zona peligrosa"
Expand Down

0 comments on commit 3138a44

Please sign in to comment.