diff options
Diffstat (limited to 'app/views/notify')
-rw-r--r-- | app/views/notify/_note_message.text.erb | 5 | ||||
-rw-r--r-- | app/views/notify/_note_mr_or_commit_email.html.haml | 11 | ||||
-rw-r--r-- | app/views/notify/_note_mr_or_commit_email.text.erb | 8 | ||||
-rw-r--r-- | app/views/notify/_simple_diff.text.erb | 5 | ||||
-rw-r--r-- | app/views/notify/note_commit_email.html.haml | 3 | ||||
-rw-r--r-- | app/views/notify/note_commit_email.text.erb | 13 | ||||
-rw-r--r-- | app/views/notify/note_merge_request_email.html.haml | 3 | ||||
-rw-r--r-- | app/views/notify/note_merge_request_email.text.erb | 13 |
8 files changed, 28 insertions, 33 deletions
diff --git a/app/views/notify/_note_message.text.erb b/app/views/notify/_note_message.text.erb new file mode 100644 index 00000000000..f82cbc9a3fc --- /dev/null +++ b/app/views/notify/_note_message.text.erb @@ -0,0 +1,5 @@ +<% if current_application_settings.email_author_in_body %> + <%= @note.author_name %> wrote: +<% end -%> + +<%= @note.note %> diff --git a/app/views/notify/_note_mr_or_commit_email.html.haml b/app/views/notify/_note_mr_or_commit_email.html.haml index 7033842b557..15e92c42b14 100644 --- a/app/views/notify/_note_mr_or_commit_email.html.haml +++ b/app/views/notify/_note_mr_or_commit_email.html.haml @@ -1,17 +1,20 @@ = content_for :head do = stylesheet_link_tag 'mailers/highlighted_diff_email' +New comment + - if @note.diff_note? && @note.diff_file on = link_to @note.diff_file.file_path, @target_url, class: 'details' - \: +\: +- if @discussion %table = render partial: "projects/diffs/line", - collection: @discussion.highlighted_diff_lines(@discussion.truncated_diff_lines), + collection: @discussion.truncated_diff_lines, as: :line, locals: { diff_file: @note.diff_file, - plain: true, - email: true } + plain: true, + email: true } = render 'note_message' diff --git a/app/views/notify/_note_mr_or_commit_email.text.erb b/app/views/notify/_note_mr_or_commit_email.text.erb new file mode 100644 index 00000000000..3dd1b4d4c0e --- /dev/null +++ b/app/views/notify/_note_mr_or_commit_email.text.erb @@ -0,0 +1,8 @@ +<% if @note.diff_note? && @note.diff_file -%> + on <%= @note.diff_file.file_path -%> +<% end -%>: + +<%= url %> + +<%= render 'simple_diff' if @discussion -%> +<%= render 'note_message' %> diff --git a/app/views/notify/_simple_diff.text.erb b/app/views/notify/_simple_diff.text.erb index a5a796bc168..58b0018c0ca 100644 --- a/app/views/notify/_simple_diff.text.erb +++ b/app/views/notify/_simple_diff.text.erb @@ -1,4 +1,3 @@ -<% lines = @discussion.truncated_diff_lines %> -<% @discussion.text_parsed_diff_lines(lines).each do |line| %> - <%= line %> +<% @discussion.truncated_diff_lines(highlight: false).each do |line| %> + <%= "> " + line.text %> <% end %> diff --git a/app/views/notify/note_commit_email.html.haml b/app/views/notify/note_commit_email.html.haml index 17dcf36689f..0a650e3b2ca 100644 --- a/app/views/notify/note_commit_email.html.haml +++ b/app/views/notify/note_commit_email.html.haml @@ -1,5 +1,2 @@ %p.details - New comment for Commit - = @commit.short_id - = render 'note_mr_or_commit_email' diff --git a/app/views/notify/note_commit_email.text.erb b/app/views/notify/note_commit_email.text.erb index 715e58af61c..dc764b61659 100644 --- a/app/views/notify/note_commit_email.text.erb +++ b/app/views/notify/note_commit_email.text.erb @@ -1,11 +1,4 @@ -New comment for Commit <%= @commit.short_id %> +<% url = url_for(namespace_project_commit_url(@note.project.namespace, @note.project, id: @commit.id, anchor: "note_#{@note.id}")) %> -<%= url_for(namespace_project_commit_url(@note.project.namespace, @note.project, id: @commit.id, anchor: "note_#{@note.id}")) %> - -<%= render 'simple_diff' if @discussion %> - -<% if current_application_settings.email_author_in_body %> - <%= @note.author_name %> wrote: -<% end %> - -<%= @note.note %> +New comment for Commit <%= @commit.short_id -%> +<%= render partial: 'note_mr_or_commit_email', locals: { url: url } %> diff --git a/app/views/notify/note_merge_request_email.html.haml b/app/views/notify/note_merge_request_email.html.haml index b7758f191dc..0a650e3b2ca 100644 --- a/app/views/notify/note_merge_request_email.html.haml +++ b/app/views/notify/note_merge_request_email.html.haml @@ -1,5 +1,2 @@ %p.details - New comment for Merge Request - = @merge_request.to_reference - = render 'note_mr_or_commit_email' diff --git a/app/views/notify/note_merge_request_email.text.erb b/app/views/notify/note_merge_request_email.text.erb index d24e15af91f..e33d15daded 100644 --- a/app/views/notify/note_merge_request_email.text.erb +++ b/app/views/notify/note_merge_request_email.text.erb @@ -1,11 +1,4 @@ -New comment for Merge Request <%= @merge_request.to_reference %> +<% url = url_for(namespace_project_merge_request_url(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request, anchor: "note_#{@note.id}")) %> -<%= url_for(namespace_project_merge_request_url(@merge_request.target_project.namespace, @merge_request.target_project, @merge_request, anchor: "note_#{@note.id}")) %> - -<%= render 'simple_diff' if @discussion %> - -<% if current_application_settings.email_author_in_body %> - <%= @note.author_name %> wrote: -<% end %> - -<%= @note.note %> +New comment for Merge Request <%= @merge_request.to_reference -%> +<%= render partial: 'note_mr_or_commit_email', locals: { url: url }%> |