Commit e49ec46461ef033fb54c717378628a31bd33248b

Authored by Dmitriy Zaporozhets
1 parent 4da48868

Open note image attachment in new tab

app/views/events/event/_note.html.haml
@@ -13,9 +13,10 @@ @@ -13,9 +13,10 @@
13 = sanitize(markdown(truncate(event.target.note, length: 150)), tags: %w(a img b pre p)) 13 = sanitize(markdown(truncate(event.target.note, length: 150)), tags: %w(a img b pre p))
14 - note = event.target 14 - note = event.target
15 - if note.attachment.url 15 - if note.attachment.url
16 - = link_to note.attachment.secure_url, target: "_blank", class: 'note-file-attach' do  
17 - - if note.attachment.image? 16 + - if note.attachment.image?
  17 + = link_to note.attachment.url, target: '_blank' do
18 = image_tag note.attachment.url, class: 'note-image-attach' 18 = image_tag note.attachment.url, class: 'note-image-attach'
19 - - else 19 + - else
  20 + = link_to note.attachment.secure_url, target: "_blank", class: 'note-file-attach' do
20 %i.icon-paper-clip 21 %i.icon-paper-clip
21 = note.attachment_identifier 22 = note.attachment_identifier
app/views/projects/notes/_note.html.haml
@@ -51,7 +51,8 @@ @@ -51,7 +51,8 @@
51 - if note.attachment.url 51 - if note.attachment.url
52 .note-attachment 52 .note-attachment
53 - if note.attachment.image? 53 - if note.attachment.image?
54 - = image_tag note.attachment.url, class: 'note-image-attach' 54 + = link_to note.attachment.url, target: '_blank' do
  55 + = image_tag note.attachment.url, class: 'note-image-attach'
55 .attachment.pull-right 56 .attachment.pull-right
56 = link_to note.attachment.secure_url, target: "_blank" do 57 = link_to note.attachment.secure_url, target: "_blank" do
57 %i.icon-paper-clip 58 %i.icon-paper-clip