Commit 93bc1ff1 authored by Riyad Preukschas's avatar Riyad Preukschas

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

parents 2022ae69 0187ae4e
......@@ -13,7 +13,10 @@ ul {
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
&.smoke { background-color:#f5f5f5; }
&:hover { background:$hover; }
&:hover {
background:$hover;
border-bottom:1px solid #ADF;
}
&:last-child { border:none }
.author { color: #999; }
......
......@@ -5,32 +5,23 @@
.event_label {
&.pushed {
padding:0 2px;
@extend .alert;
@extend .alert-info;
}
&.opened {
padding:0 2px;
@extend .alert;
@extend .alert-success;
}
&.closed {
padding:0 2px;
@extend .alert;
@extend .alert-error;
}
&.merged {
padding:0 2px;
@extend .alert;
@extend .alert-success;
}
&.left,
&.joined {
padding:0 2px;
@extend .alert;
float:none;
}
}
......
#tree-holder {
#tree-content-holder {
.tree-holder {
.tree-content-holder {
float:left;
width:100%;
}
#tree-readme-holder {
float:left;
width:100%;
.readme {
border:1px solid #ccc;
padding:12px;
background: #F7F7F7;
pre {
overflow: auto;
}
}
}
.tree_progress {
display:none;
......@@ -25,7 +12,7 @@
}
}
#tree-slider {
.tree-table {
@include border-radius(0);
.tree-item {
&:hover {
......@@ -55,8 +42,7 @@
}
}
#tree-slider {
.tree-table {
td {
background:#fafafa;
}
......@@ -72,5 +58,4 @@
text-decoration: underline;
}
}
}
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
......@@ -33,7 +33,7 @@ module IssuesHelper
classes
end
def issue_tags
def issue_tags
@project.issues.tag_counts_on(:labels).map(&:name)
end
......
......@@ -6,5 +6,9 @@ module ProjectsHelper
def remove_from_team_message(project, member)
"You are going to remove #{member.user_name} from #{project.name}. Are you sure?"
end
def link_to_project project
link_to project.name, project
end
end
......@@ -58,6 +58,10 @@ class Event < ActiveRecord::Base
end
end
def target_title
target.try :title
end
def push?
action == self.class::Pushed && valid_push?
end
......
- if event.allowed?
%div.event-item
- if event.issue?
= render "events/event_issue", event: event
= event_image(event)
= image_tag gravatar_icon(event.author_email), class: "avatar"
- elsif event.merge_request?
= render "events/event_merge_request", event: event
- elsif event.push?
= render "events/event_push", event: event
- elsif event.membership_changed?
= render "events/event_membership_changed", event: event
- if event.push?
= render "events/event/push", event: event
- else
= render "events/event/common", event: event
.clearfix
%span.cgray.right
= time_ago_in_words(event.created_at)
ago.
......
= 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
= 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.
- 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
%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
.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
.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]}
......@@ -41,7 +41,7 @@
$(function(){
var names = #{@project.users.pluck(:name)}, emoji = ['+1', '-1'];
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: emoji,
......
......@@ -8,12 +8,12 @@
%li= link
.clear
%div.tree_progress
#tree-content-holder
%div#tree-content-holder.tree-content-holder
- if tree.is_blob?
= render partial: "tree/tree_file", locals: { name: tree.name, content: tree.data, file: tree }
- else
- contents = tree.contents
%table#tree-slider{class: "table_#{@hex_path}" }
%table#tree-slider{class: "table_#{@hex_path} tree-table" }
%thead
%th Name
%th Last Update
......
= render "head"
#tree-holder= render partial: "tree", locals: {commit: @commit, tree: @tree}
%div#tree-holder.tree-holder
= render "tree", commit: @commit, tree: @tree
:javascript
$(function() {
......
......@@ -112,7 +112,6 @@ Generate key:
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
Setup:
......
......@@ -18,10 +18,10 @@ Feature: Dashboard
Scenario: I should see User joined Project event
Given user with name "John Doe" joined project "Shop"
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
Given user with name "John Doe" joined project "Shop"
And user with name "John Doe" left project "Shop"
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
......@@ -41,8 +41,8 @@ class Dashboard < Spinach::FeatureSteps
)
end
Then 'I should see "John Doe joined project Shop" event' do
page.should have_content "John Doe joined project Shop"
Then 'I should see "John Doe joined project at Shop" event' do
page.should have_content "John Doe joined project at Shop"
end
And 'user with name "John Doe" left project "Shop"' do
......@@ -55,8 +55,8 @@ class Dashboard < Spinach::FeatureSteps
)
end
Then 'I should see "John Doe left project Shop" event' do
page.should have_content "John Doe left project Shop"
Then 'I should see "John Doe left project at Shop" event' do
page.should have_content "John Doe left project at Shop"
end
And 'I own project "Shop"' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment