Commit 8e0b58d7e7cde0d9afb93f267197f62b9b649cd3

Authored by Dmitriy Zaporozhets
1 parent ab191963

render note with attachment for event

app/assets/stylesheets/sections/events.scss
@@ -52,6 +52,15 @@ @@ -52,6 +52,15 @@
52 padding-left: 5px; 52 padding-left: 5px;
53 display: inline-block; 53 display: inline-block;
54 color: #555; 54 color: #555;
  55 +
  56 + .note-file-attach {
  57 + margin-left: -25px;
  58 + float: left;
  59 + .note-image-attach {
  60 + margin-left: 0px;
  61 + max-width: 200px;
  62 + }
  63 + }
55 } 64 }
56 .event-note-icon { 65 .event-note-icon {
57 color: #777; 66 color: #777;
app/assets/stylesheets/sections/notes.scss
@@ -273,6 +273,7 @@ ul.notes { @@ -273,6 +273,7 @@ ul.notes {
273 } 273 }
274 274
275 275
  276 +
276 .note-form-actions { 277 .note-form-actions {
277 background: #F9F9F9; 278 background: #F9F9F9;
278 height: 45px; 279 height: 45px;
app/views/events/event/_note.html.haml
@@ -24,3 +24,10 @@ @@ -24,3 +24,10 @@
24 %i.icon-comment-alt.event-note-icon 24 %i.icon-comment-alt.event-note-icon
25 %span.event-note 25 %span.event-note
26 = markdown truncate(event.target.note, length: 70) 26 = markdown truncate(event.target.note, length: 70)
  27 + - note = event.target
  28 + = link_to note.attachment.url, target: "_blank", class: 'note-file-attach' do
  29 + - if note.attachment.image?
  30 + = image_tag note.attachment.url, class: 'note-image-attach'
  31 + - else
  32 + %i.icon-paper-clip
  33 + = note.attachment_identifier