Commit 25e629e460c30bb903be52dbf28fcc499566f318

Authored by Dmitriy Zaporozhets
1 parent 9174020f

Render small avatars for inline events

app/assets/stylesheets/sections/events.scss
... ... @@ -35,6 +35,13 @@
35 35 padding-top: 0;
36 36 }
37 37  
  38 + &.event-inline {
  39 + .avatar {
  40 + width: 16px;
  41 + height: 16px;
  42 + }
  43 + }
  44 +
38 45 padding: 14px 0px;
39 46 border-bottom: 1px solid #eee;
40 47 .event-title {
... ...
app/models/event.rb
... ... @@ -291,4 +291,14 @@ class Event < ActiveRecord::Base
291 291 "Wall"
292 292 end.downcase
293 293 end
  294 +
  295 + def body?
  296 + if push?
  297 + push_with_commits?
  298 + elsif note?
  299 + true
  300 + else
  301 + target.respond_to? :title
  302 + end
  303 + end
294 304 end
... ...
app/views/events/_event.html.haml
1 1 - if event.proper?
2   - %div.event-item
  2 + .event-item{class: "#{event.body? ? "event-block" : "event-inline" }"}
3 3 %span.cgray.pull-right
4 4 #{time_ago_in_words(event.created_at)} ago.
5 5  
... ...