Commit 375ebcabfd2b5c086d0b2602114f7b751c205440

Authored by Dmitriy Zaporozhets
1 parent c94159ab

improved activity ui

app/assets/stylesheets/common.scss
... ... @@ -616,6 +616,7 @@ p.time {
616 616  
617 617 .wll {
618 618 padding:5px;
  619 + margin-top:5px;
619 620 border:none;
620 621 &:hover {
621 622 background:none;
... ... @@ -632,6 +633,7 @@ p.time {
632 633 }
633 634 ul {
634 635 margin-left:50px;
  636 + margin-bottom:5px;
635 637 .avatar {
636 638 width:24px;
637 639 }
... ...
app/models/event.rb
... ... @@ -21,6 +21,11 @@ class Event < ActiveRecord::Base
21 21 end
22 22 end
23 23  
  24 + # For now only push events enabled for system
  25 + def allowed?
  26 + push?
  27 + end
  28 +
24 29 def push?
25 30 action == self.class::Pushed
26 31 end
... ...
app/views/events/_event.html.haml
1   -.wll.event_feed
2   - - if event.push?
3   - - if event.new_branch?
4   - = image_tag gravatar_icon(event.pusher_email), :class => "avatar"
5   - %strong #{event.pusher_name}
6   - pushed new branch
7   - = link_to project_commits_path(event.project, :ref => event.branch_name) do
8   - %strong= event.branch_name
9   - at
10   - %strong= link_to event.project.name, event.project
11   - %span.cgray
12   - = time_ago_in_words(event.created_at)
13   - ago.
14   - - else
15   - = image_tag gravatar_icon(event.pusher_email), :class => "avatar"
16   - %strong #{event.pusher_name}
17   - pushed to
18   - = link_to project_commits_path(event.project, :ref => event.branch_name) do
19   - %strong= event.branch_name
20   - at
21   - %strong= link_to event.project.name, event.project
22   - %span.cgray
23   - = time_ago_in_words(event.created_at)
24   - ago.
25   - - if event.commits.count > 1
26   - = link_to compare_project_commits_path(event.project, :from => event.commits.first.prev_commit_id, :to => event.commits.last.id) do
27   - Compare #{event.commits.first.commit.id[0..8]}...#{event.commits.last.id[0..8]}
28   - - @project = event.project
29   - %ul.unstyled
30   - = render event.commits
  1 +- if event.allowed?
  2 + .wll.event_feed
  3 + - if event.push?
  4 + - if event.new_branch?
  5 + = image_tag gravatar_icon(event.pusher_email), :class => "avatar"
  6 + %strong #{event.pusher_name}
  7 + pushed new branch
  8 + = link_to project_commits_path(event.project, :ref => event.branch_name) do
  9 + %strong= event.branch_name
  10 + at
  11 + %strong= link_to event.project.name, event.project
  12 + %span.cgray
  13 + = time_ago_in_words(event.created_at)
  14 + ago.
  15 + - else
  16 + = image_tag gravatar_icon(event.pusher_email), :class => "avatar"
  17 + %strong #{event.pusher_name}
  18 + pushed to
  19 + = link_to project_commits_path(event.project, :ref => event.branch_name) do
  20 + %strong= event.branch_name
  21 + at
  22 + %strong= link_to event.project.name, event.project
  23 + %span.cgray
  24 + = time_ago_in_words(event.created_at)
  25 + ago.
  26 + - if event.commits.count > 1
  27 + = link_to compare_project_commits_path(event.project, :from => event.commits.first.prev_commit_id, :to => event.commits.last.id) do
  28 + Compare #{event.commits.first.commit.id[0..8]}...#{event.commits.last.id[0..8]}
  29 + - @project = event.project
  30 + %ul.unstyled
  31 + = render event.commits
31 32  
... ...