diff --git a/app/views/events/event/_note.html.haml b/app/views/events/event/_note.html.haml
index 9dd0767..8384bbe 100644
--- a/app/views/events/event/_note.html.haml
+++ b/app/views/events/event/_note.html.haml
@@ -13,9 +13,10 @@
= sanitize(markdown(truncate(event.target.note, length: 150)), tags: %w(a img b pre p))
- note = event.target
- if note.attachment.url
- = link_to note.attachment.secure_url, target: "_blank", class: 'note-file-attach' do
- - if note.attachment.image?
+ - if note.attachment.image?
+ = link_to note.attachment.url, target: '_blank' do
= image_tag note.attachment.url, class: 'note-image-attach'
- - else
+ - else
+ = link_to note.attachment.secure_url, target: "_blank", class: 'note-file-attach' do
%i.icon-paper-clip
= note.attachment_identifier
diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml
index 6fa7a1c..1389d89 100644
--- a/app/views/projects/notes/_note.html.haml
+++ b/app/views/projects/notes/_note.html.haml
@@ -51,7 +51,8 @@
- if note.attachment.url
.note-attachment
- if note.attachment.image?
- = image_tag note.attachment.url, class: 'note-image-attach'
+ = link_to note.attachment.url, target: '_blank' do
+ = image_tag note.attachment.url, class: 'note-image-attach'
.attachment.pull-right
= link_to note.attachment.secure_url, target: "_blank" do
%i.icon-paper-clip
--
libgit2 0.21.2