OSDN Git Service

render note with attachment for event
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Mon, 11 Feb 2013 13:47:01 +0000 (15:47 +0200)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Mon, 11 Feb 2013 13:47:01 +0000 (15:47 +0200)
app/assets/stylesheets/sections/events.scss
app/assets/stylesheets/sections/notes.scss
app/views/events/event/_note.html.haml

index ff81014..df8fd8d 100644 (file)
       padding-left: 5px;
       display: inline-block;
       color: #555;
+
+      .note-file-attach {
+        margin-left: -25px;
+        float: left;
+        .note-image-attach {
+          margin-left: 0px;
+          max-width: 200px;
+        }
+      }
     }
     .event-note-icon {
       color: #777;
index 648cb21..1f92a3a 100644 (file)
@@ -273,6 +273,7 @@ ul.notes {
 }
 
 
+
 .note-form-actions {
   background: #F9F9F9;
   height: 45px;
index ef5035f..ac380a9 100644 (file)
   %i.icon-comment-alt.event-note-icon
   %span.event-note
     = markdown truncate(event.target.note, length: 70)
+    - note = event.target
+    = link_to note.attachment.url, target: "_blank", class: 'note-file-attach' do
+      - if note.attachment.image?
+        = image_tag note.attachment.url, class: 'note-image-attach'
+      - else
+        %i.icon-paper-clip
+        = note.attachment_identifier