Colored labels for events

This commit is contained in:
Dmitriy Zaporozhets 2012-09-24 13:33:51 +03:00
parent d23022c6f6
commit 6667f3dbf9
6 changed files with 38 additions and 35 deletions

View file

@ -3,33 +3,35 @@
*
*/
.event_label {
/*@extend .label;*/
/*background-color: #999;*/
&.pushed {
padding:0 2px;
@extend .alert;
@extend .alert-info;
}
/*&.pushed {*/
/*background-color: #4A97BD;*/
/*}*/
&.opened {
padding:0 2px;
@extend .alert;
@extend .alert-success;
}
/*&.opened {*/
/*background-color: #469847;*/
/*}*/
&.closed {
padding:0 2px;
@extend .alert;
@extend .alert-error;
}
/*&.closed {*/
/*background-color: #B94A48;*/
/*}*/
&.merged {
padding:0 2px;
@extend .alert;
@extend .alert-success;
}
/*&.merged {*/
/*background-color: #2A2;*/
/*}*/
/*&.joined {*/
/*background-color: #1ca9dd;*/
/*}*/
/*&.left {*/
/*background-color: #888;*/
/*float:none;*/
/*}*/
&.left,
&.joined {
padding:0 2px;
@extend .alert;
}
}
/**
@ -43,13 +45,16 @@
color:#333;
font-weight: bold;
.author_name {
color:#777;
color:#333;
}
}
.event-body {
p {
color:#666;
}
.event-info {
color:#666;
}
}
.avatar {
width:32px;

View file

@ -132,6 +132,7 @@ class Event < ActiveRecord::Base
end
end
delegate :name, :email, to: :author, prefix: true, allow_nil: true
delegate :title, to: :issue, prefix: true, allow_nil: true
delegate :title, to: :merge_request, prefix: true, allow_nil: true

View file

@ -1,8 +1,7 @@
= image_tag gravatar_icon(event.author_email), class: "avatar"
.event-title
%strong.author_name #{event.author_name}
%span.event_label{class: event.action_name}= event.action_name
issue
%span.event_label{class: event.action_name} #{event.action_name} issue
= link_to project_issue_path(event.project, event.issue) do
%strong= truncate event.issue_title
at

View file

@ -1,8 +1,7 @@
= image_tag gravatar_icon(event.author_email), class: "avatar"
.event-title
%strong.author_name #{event.author_name}
%span.event_label{class: event.action_name}= event.action_name
project
%span.event_label{class: event.action_name} #{event.action_name} project
%strong= link_to event.project_name, event.project
%span.cgray
= time_ago_in_words(event.created_at)

View file

@ -3,13 +3,13 @@
= image_tag gravatar_icon(event.author_email), class: "avatar"
.event-title
%strong.author_name #{event.author_name}
%span.event_label{class: event.action_name}= event.action_name
merge request
%span.event_label{class: event.action_name} #{event.action_name} merge request
= link_to project_merge_request_path(event.project, event.merge_request) do
%strong= truncate event.merge_request_title
at
%strong= link_to event.project.name, event.project
.event-body
.event-info
%span= event.merge_request.source_branch
&rarr;
%span= event.merge_request.target_branch

View file

@ -4,8 +4,7 @@
.event-title
%strong.author_name #{event.author_name}
%span.event_label.pushed= event.push_action_name
= event.ref_type
%span.event_label.pushed #{event.push_action_name} #{event.ref_type}
= link_to project_commits_path(event.project, ref: event.ref_name) do
%strong= event.ref_name
at