From 3c026971149c95f076b8c50a52ddbfed139d5b20 Mon Sep 17 00:00:00 2001 From: Heinrich Lee Yu Date: Thu, 6 Dec 2018 08:51:30 +0800 Subject: Import CSV Backend Process CSV uploads async using a worker then email results --- app/views/notify/import_issues_csv_email.html.haml | 18 ++++++++++++++++++ app/views/notify/import_issues_csv_email.text.erb | 11 +++++++++++ 2 files changed, 29 insertions(+) create mode 100644 app/views/notify/import_issues_csv_email.html.haml create mode 100644 app/views/notify/import_issues_csv_email.text.erb (limited to 'app/views/notify') diff --git a/app/views/notify/import_issues_csv_email.html.haml b/app/views/notify/import_issues_csv_email.html.haml new file mode 100644 index 00000000000..a6a797a5fb7 --- /dev/null +++ b/app/views/notify/import_issues_csv_email.html.haml @@ -0,0 +1,18 @@ +- text_style = 'font-size:16px; text-align:center; line-height:30px;' + +%p{ style: text_style } + Your CSV import for project + %a{ href: project_url(@project), style: "color:#3777b0; text-decoration:none;" } + = @project.full_name + has been completed. + +%p{ style: text_style } + #{pluralize(@results[:success], 'issue')} imported successfully. + +- if @results[:errors].present? + %p{ style: text_style } + Errors found on line #{'number'.pluralize(@results[:errors].size)}: #{@results[:errors].join(', ')}. + +- unless @results[:valid_file] + %p{ style: text_style } + Error parsing CSV file. diff --git a/app/views/notify/import_issues_csv_email.text.erb b/app/views/notify/import_issues_csv_email.text.erb new file mode 100644 index 00000000000..54a1762c4ec --- /dev/null +++ b/app/views/notify/import_issues_csv_email.text.erb @@ -0,0 +1,11 @@ +Your CSV import for project <%= @project.full_name %> (<%= project_url(@project) %>) has been completed. + +<%= pluralize(@results[:success], 'issue') %> imported successfully. + +<% if @results[:errors].present? %> +Errors found on line <%= 'number'.pluralize(@results[:errors].size) %>: <%= @results[:errors].join(', ') %>. +<% end %> + +<% unless @results[:valid_file] %> +Error parsing CSV file. +<% end %> -- cgit v1.2.3