Merge branch 'master' into fix-messages-for-deleted-things

This commit is contained in:
Riyad Preukschas 2012-10-02 14:04:34 +02:00
commit 93bc1ff108
20 changed files with 103 additions and 114 deletions

View file

@ -13,7 +13,10 @@ ul {
border-bottom: 1px solid rgba(0, 0, 0, 0.05); border-bottom: 1px solid rgba(0, 0, 0, 0.05);
&.smoke { background-color:#f5f5f5; } &.smoke { background-color:#f5f5f5; }
&:hover { background:$hover; } &:hover {
background:$hover;
border-bottom:1px solid #ADF;
}
&:last-child { border:none } &:last-child { border:none }
.author { color: #999; } .author { color: #999; }

View file

@ -5,32 +5,23 @@
.event_label { .event_label {
&.pushed { &.pushed {
padding:0 2px; padding:0 2px;
@extend .alert;
@extend .alert-info;
} }
&.opened { &.opened {
padding:0 2px; padding:0 2px;
@extend .alert;
@extend .alert-success;
} }
&.closed { &.closed {
padding:0 2px; padding:0 2px;
@extend .alert;
@extend .alert-error;
} }
&.merged { &.merged {
padding:0 2px; padding:0 2px;
@extend .alert;
@extend .alert-success;
} }
&.left, &.left,
&.joined { &.joined {
padding:0 2px; padding:0 2px;
@extend .alert;
float:none; float:none;
} }
} }

View file

@ -1,21 +1,8 @@
#tree-holder { .tree-holder {
#tree-content-holder { .tree-content-holder {
float:left; float:left;
width:100%; width:100%;
} }
#tree-readme-holder {
float:left;
width:100%;
.readme {
border:1px solid #ccc;
padding:12px;
background: #F7F7F7;
pre {
overflow: auto;
}
}
}
.tree_progress { .tree_progress {
display:none; display:none;
@ -25,7 +12,7 @@
} }
} }
#tree-slider { .tree-table {
@include border-radius(0); @include border-radius(0);
.tree-item { .tree-item {
&:hover { &:hover {
@ -55,8 +42,7 @@
} }
} }
.tree-table {
#tree-slider {
td { td {
background:#fafafa; background:#fafafa;
} }
@ -72,5 +58,4 @@
text-decoration: underline; text-decoration: underline;
} }
} }
} }

View file

@ -0,0 +1,36 @@
module EventsHelper
def link_to_author(event)
project = event.project
tm = project.team_member_by_id(event.author_id)
if tm
link_to event.author_name, project_team_member_path(project, tm)
else
event.author_name
end
end
def event_action_name(event)
target = if event.target_type
event.target_type.titleize.downcase
else
'project'
end
[event.action_name, target].join(" ")
end
def event_image event
event_image_path = if event.push?
"event_push.png"
elsif event.merged?
"event_mr_merged.png"
end
return nil unless event_image_path
content_tag :div, class: 'event_icon' do
image_tag event_image_path
end
end
end

View file

@ -33,7 +33,7 @@ module IssuesHelper
classes classes
end end
def issue_tags def issue_tags
@project.issues.tag_counts_on(:labels).map(&:name) @project.issues.tag_counts_on(:labels).map(&:name)
end end

View file

@ -6,5 +6,9 @@ module ProjectsHelper
def remove_from_team_message(project, member) def remove_from_team_message(project, member)
"You are going to remove #{member.user_name} from #{project.name}. Are you sure?" "You are going to remove #{member.user_name} from #{project.name}. Are you sure?"
end end
def link_to_project project
link_to project.name, project
end
end end

View file

@ -58,6 +58,10 @@ class Event < ActiveRecord::Base
end end
end end
def target_title
target.try :title
end
def push? def push?
action == self.class::Pushed && valid_push? action == self.class::Pushed && valid_push?
end end

View file

@ -1,17 +1,14 @@
- if event.allowed? - if event.allowed?
%div.event-item %div.event-item
- if event.issue? = event_image(event)
= render "events/event_issue", event: event = image_tag gravatar_icon(event.author_email), class: "avatar"
- elsif event.merge_request? - if event.push?
= render "events/event_merge_request", event: event = render "events/event/push", event: event
- else
- elsif event.push? = render "events/event/common", event: event
= render "events/event_push", event: event
- elsif event.membership_changed?
= render "events/event_membership_changed", event: event
.clearfix
%span.cgray.right %span.cgray.right
= time_ago_in_words(event.created_at) = time_ago_in_words(event.created_at)
ago. ago.

View file

@ -1,8 +0,0 @@
= 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
= link_to project_issue_path(event.project, event.issue) do
%strong= truncate event.issue_title
at
%strong= link_to event.project.name, event.project

View file

@ -1,9 +0,0 @@
= 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
%strong= link_to event.project_name, event.project
%span.cgray
= time_ago_in_words(event.created_at)
ago.

View file

@ -1,16 +0,0 @@
- if event.action_name == "merged"
.event_icon= image_tag "event_mr_merged.png"
= 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
= 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

@ -1,30 +0,0 @@
%div
.event_icon= image_tag "event_push.png"
= image_tag gravatar_icon(event.author_email), class: "avatar"
.event-title
%strong.author_name #{event.author_name}
%span.event_label.pushed #{event.push_action_name} #{event.ref_type}
- if event.rm_ref?
%strong= event.ref_name
- else
= link_to project_commits_path(event.project, event.ref_name) do
%strong= event.ref_name
at
%strong= link_to event.project.name, event.project
- if event.push_with_commits?
- project = event.project
.event-body
%ul.unstyled.event_commits
- few_commits = event.commits[0...2]
- few_commits.each do |commit|
= render "events/commit", commit: commit, project: project
- if event.commits_count > 1
%li.commits-stat
- if event.commits_count > 2
%span ... and #{event.commits_count - 2} more commits.
= link_to project_compare_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do
%strong Compare &rarr; #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}
.clearfix

View file

@ -0,0 +1,7 @@
.event-title
%span.author_name= link_to_author event
%span.event_label{class: event.action_name}= event_action_name(event)
= link_to [event.project, event.target] do
%strong= truncate event.target_title
at
= link_to_project event.project

View file

@ -0,0 +1,25 @@
.event-title
%span.author_name= link_to_author event
%span.event_label.pushed #{event.push_action_name} #{event.ref_type}
- if event.rm_ref?
%strong= event.ref_name
- else
= link_to project_commits_path(event.project, event.ref_name) do
%strong= event.ref_name
at
%strong= link_to event.project.name, event.project
- if event.push_with_commits?
- project = event.project
.event-body
%ul.unstyled.event_commits
- few_commits = event.commits[0...2]
- few_commits.each do |commit|
= render "events/commit", commit: commit, project: project
- if event.commits_count > 1
%li.commits-stat
- if event.commits_count > 2
%span ... and #{event.commits_count - 2} more commits.
= link_to project_compare_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do
%strong Compare &rarr; #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}

View file

@ -41,7 +41,7 @@
$(function(){ $(function(){
var names = #{@project.users.pluck(:name)}, emoji = ['+1', '-1']; var names = #{@project.users.pluck(:name)}, emoji = ['+1', '-1'];
var emoji = $.map(emoji, function(value, i) {return {key:value + ':', name:value}}); var emoji = $.map(emoji, function(value, i) {return {key:value + ':', name:value}});
$('#note_note'). $('#note_note, .per_line_form .line-note-text').
atWho('@', { data: names }). atWho('@', { data: names }).
atWho(':', { atWho(':', {
data: emoji, data: emoji,

View file

@ -8,12 +8,12 @@
%li= link %li= link
.clear .clear
%div.tree_progress %div.tree_progress
#tree-content-holder %div#tree-content-holder.tree-content-holder
- if tree.is_blob? - if tree.is_blob?
= render partial: "tree/tree_file", locals: { name: tree.name, content: tree.data, file: tree } = render partial: "tree/tree_file", locals: { name: tree.name, content: tree.data, file: tree }
- else - else
- contents = tree.contents - contents = tree.contents
%table#tree-slider{class: "table_#{@hex_path}" } %table#tree-slider{class: "table_#{@hex_path} tree-table" }
%thead %thead
%th Name %th Name
%th Last Update %th Last Update

View file

@ -1,5 +1,6 @@
= render "head" = render "head"
#tree-holder= render partial: "tree", locals: {commit: @commit, tree: @tree} %div#tree-holder.tree-holder
= render "tree", commit: @commit, tree: @tree
:javascript :javascript
$(function() { $(function() {

View file

@ -112,7 +112,6 @@ Generate key:
Clone GitLab's fork of the Gitolite source code: Clone GitLab's fork of the Gitolite source code:
cd /home/git
sudo -H -u git git clone -b gl-v304 https://github.com/gitlabhq/gitolite.git /home/git/gitolite sudo -H -u git git clone -b gl-v304 https://github.com/gitlabhq/gitolite.git /home/git/gitolite
Setup: Setup:

View file

@ -18,10 +18,10 @@ Feature: Dashboard
Scenario: I should see User joined Project event Scenario: I should see User joined Project event
Given user with name "John Doe" joined project "Shop" Given user with name "John Doe" joined project "Shop"
When I visit dashboard page When I visit dashboard page
Then I should see "John Doe joined project Shop" event Then I should see "John Doe joined project at Shop" event
Scenario: I should see User left Project event Scenario: I should see User left Project event
Given user with name "John Doe" joined project "Shop" Given user with name "John Doe" joined project "Shop"
And user with name "John Doe" left project "Shop" And user with name "John Doe" left project "Shop"
When I visit dashboard page When I visit dashboard page
Then I should see "John Doe left project Shop" event Then I should see "John Doe left project at Shop" event

View file

@ -41,8 +41,8 @@ class Dashboard < Spinach::FeatureSteps
) )
end end
Then 'I should see "John Doe joined project Shop" event' do Then 'I should see "John Doe joined project at Shop" event' do
page.should have_content "John Doe joined project Shop" page.should have_content "John Doe joined project at Shop"
end end
And 'user with name "John Doe" left project "Shop"' do And 'user with name "John Doe" left project "Shop"' do
@ -55,8 +55,8 @@ class Dashboard < Spinach::FeatureSteps
) )
end end
Then 'I should see "John Doe left project Shop" event' do Then 'I should see "John Doe left project at Shop" event' do
page.should have_content "John Doe left project Shop" page.should have_content "John Doe left project at Shop"
end end
And 'I own project "Shop"' do And 'I own project "Shop"' do