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 52 padding-left: 5px;
53 53 display: inline-block;
54 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 65 .event-note-icon {
57 66 color: #777;
... ...
app/assets/stylesheets/sections/notes.scss
... ... @@ -273,6 +273,7 @@ ul.notes {
273 273 }
274 274  
275 275  
  276 +
276 277 .note-form-actions {
277 278 background: #F9F9F9;
278 279 height: 45px;
... ...
app/views/events/event/_note.html.haml
... ... @@ -24,3 +24,10 @@
24 24 %i.icon-comment-alt.event-note-icon
25 25 %span.event-note
26 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
... ...