diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-20 21:31:37 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-20 21:31:37 +0300 |
commit | 25e629e460c30bb903be52dbf28fcc499566f318 (patch) | |
tree | e8bb520c6f452f3b6b56905ae5b90b8ead52ddde | |
parent | 9174020f14f622fcd5ae57bc7bcba0d067c0e88a (diff) | |
download | gitlab-ce-25e629e460c30bb903be52dbf28fcc499566f318.tar.gz |
Render small avatars for inline events
-rw-r--r-- | app/assets/stylesheets/sections/events.scss | 7 | ||||
-rw-r--r-- | app/models/event.rb | 10 | ||||
-rw-r--r-- | app/views/events/_event.html.haml | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/app/assets/stylesheets/sections/events.scss b/app/assets/stylesheets/sections/events.scss index 9b049aed5fb..d94d97c8d9a 100644 --- a/app/assets/stylesheets/sections/events.scss +++ b/app/assets/stylesheets/sections/events.scss @@ -35,6 +35,13 @@ padding-top: 0; } + &.event-inline { + .avatar { + width: 16px; + height: 16px; + } + } + padding: 14px 0px; border-bottom: 1px solid #eee; .event-title { diff --git a/app/models/event.rb b/app/models/event.rb index 759e84bb55a..5c7c5be4190 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -291,4 +291,14 @@ class Event < ActiveRecord::Base "Wall" end.downcase end + + def body? + if push? + push_with_commits? + elsif note? + true + else + target.respond_to? :title + end + end end diff --git a/app/views/events/_event.html.haml b/app/views/events/_event.html.haml index b090148685f..b3543460d65 100644 --- a/app/views/events/_event.html.haml +++ b/app/views/events/_event.html.haml @@ -1,5 +1,5 @@ - if event.proper? - %div.event-item + .event-item{class: "#{event.body? ? "event-block" : "event-inline" }"} %span.cgray.pull-right #{time_ago_in_words(event.created_at)} ago. |