Commit 93bc1ff10866956f3d6edf60a1b2db280544be04

Authored by Riyad Preukschas
2 parents 2022ae69 0187ae4e

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

app/assets/stylesheets/gitlab_bootstrap/lists.scss
@@ -13,7 +13,10 @@ ul { @@ -13,7 +13,10 @@ ul {
13 border-bottom: 1px solid rgba(0, 0, 0, 0.05); 13 border-bottom: 1px solid rgba(0, 0, 0, 0.05);
14 14
15 &.smoke { background-color:#f5f5f5; } 15 &.smoke { background-color:#f5f5f5; }
16 - &:hover { background:$hover; } 16 + &:hover {
  17 + background:$hover;
  18 + border-bottom:1px solid #ADF;
  19 + }
17 &:last-child { border:none } 20 &:last-child { border:none }
18 .author { color: #999; } 21 .author { color: #999; }
19 22
app/assets/stylesheets/sections/events.scss
@@ -5,32 +5,23 @@ @@ -5,32 +5,23 @@
5 .event_label { 5 .event_label {
6 &.pushed { 6 &.pushed {
7 padding:0 2px; 7 padding:0 2px;
8 - @extend .alert;  
9 - @extend .alert-info;  
10 } 8 }
11 9
12 &.opened { 10 &.opened {
13 padding:0 2px; 11 padding:0 2px;
14 - @extend .alert;  
15 - @extend .alert-success;  
16 } 12 }
17 13
18 &.closed { 14 &.closed {
19 padding:0 2px; 15 padding:0 2px;
20 - @extend .alert;  
21 - @extend .alert-error;  
22 } 16 }
23 17
24 &.merged { 18 &.merged {
25 padding:0 2px; 19 padding:0 2px;
26 - @extend .alert;  
27 - @extend .alert-success;  
28 } 20 }
29 21
30 &.left, 22 &.left,
31 &.joined { 23 &.joined {
32 padding:0 2px; 24 padding:0 2px;
33 - @extend .alert;  
34 float:none; 25 float:none;
35 } 26 }
36 } 27 }
app/assets/stylesheets/sections/tree.scss
1 -#tree-holder {  
2 - #tree-content-holder { 1 +.tree-holder {
  2 + .tree-content-holder {
3 float:left; 3 float:left;
4 width:100%; 4 width:100%;
5 } 5 }
6 - #tree-readme-holder {  
7 - float:left;  
8 - width:100%;  
9 - .readme {  
10 - border:1px solid #ccc;  
11 - padding:12px;  
12 - background: #F7F7F7;  
13 -  
14 - pre {  
15 - overflow: auto;  
16 - }  
17 - }  
18 - }  
19 6
20 .tree_progress { 7 .tree_progress {
21 display:none; 8 display:none;
@@ -25,7 +12,7 @@ @@ -25,7 +12,7 @@
25 } 12 }
26 } 13 }
27 14
28 - #tree-slider { 15 + .tree-table {
29 @include border-radius(0); 16 @include border-radius(0);
30 .tree-item { 17 .tree-item {
31 &:hover { 18 &:hover {
@@ -55,8 +42,7 @@ @@ -55,8 +42,7 @@
55 } 42 }
56 } 43 }
57 44
58 -  
59 - #tree-slider { 45 + .tree-table {
60 td { 46 td {
61 background:#fafafa; 47 background:#fafafa;
62 } 48 }
@@ -72,5 +58,4 @@ @@ -72,5 +58,4 @@
72 text-decoration: underline; 58 text-decoration: underline;
73 } 59 }
74 } 60 }
75 -  
76 } 61 }
app/helpers/events_helper.rb 0 → 100644
@@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
  1 +module EventsHelper
  2 + def link_to_author(event)
  3 + project = event.project
  4 + tm = project.team_member_by_id(event.author_id)
  5 +
  6 + if tm
  7 + link_to event.author_name, project_team_member_path(project, tm)
  8 + else
  9 + event.author_name
  10 + end
  11 + end
  12 +
  13 + def event_action_name(event)
  14 + target = if event.target_type
  15 + event.target_type.titleize.downcase
  16 + else
  17 + 'project'
  18 + end
  19 +
  20 + [event.action_name, target].join(" ")
  21 + end
  22 +
  23 + def event_image event
  24 + event_image_path = if event.push?
  25 + "event_push.png"
  26 + elsif event.merged?
  27 + "event_mr_merged.png"
  28 + end
  29 +
  30 + return nil unless event_image_path
  31 +
  32 + content_tag :div, class: 'event_icon' do
  33 + image_tag event_image_path
  34 + end
  35 + end
  36 +end
app/helpers/issues_helper.rb
@@ -33,7 +33,7 @@ module IssuesHelper @@ -33,7 +33,7 @@ module IssuesHelper
33 classes 33 classes
34 end 34 end
35 35
36 - def issue_tags 36 + def issue_tags
37 @project.issues.tag_counts_on(:labels).map(&:name) 37 @project.issues.tag_counts_on(:labels).map(&:name)
38 end 38 end
39 39
app/helpers/projects_helper.rb
@@ -6,5 +6,9 @@ module ProjectsHelper @@ -6,5 +6,9 @@ module ProjectsHelper
6 def remove_from_team_message(project, member) 6 def remove_from_team_message(project, member)
7 "You are going to remove #{member.user_name} from #{project.name}. Are you sure?" 7 "You are going to remove #{member.user_name} from #{project.name}. Are you sure?"
8 end 8 end
  9 +
  10 + def link_to_project project
  11 + link_to project.name, project
  12 + end
9 end 13 end
10 14
app/models/event.rb
@@ -58,6 +58,10 @@ class Event < ActiveRecord::Base @@ -58,6 +58,10 @@ class Event < ActiveRecord::Base
58 end 58 end
59 end 59 end
60 60
  61 + def target_title
  62 + target.try :title
  63 + end
  64 +
61 def push? 65 def push?
62 action == self.class::Pushed && valid_push? 66 action == self.class::Pushed && valid_push?
63 end 67 end
app/views/events/_event.html.haml
1 - if event.allowed? 1 - if event.allowed?
2 %div.event-item 2 %div.event-item
3 - - if event.issue?  
4 - = render "events/event_issue", event: event 3 + = event_image(event)
  4 + = image_tag gravatar_icon(event.author_email), class: "avatar"
5 5
6 - - elsif event.merge_request?  
7 - = render "events/event_merge_request", event: event  
8 -  
9 - - elsif event.push?  
10 - = render "events/event_push", event: event  
11 -  
12 - - elsif event.membership_changed?  
13 - = render "events/event_membership_changed", event: event 6 + - if event.push?
  7 + = render "events/event/push", event: event
  8 + - else
  9 + = render "events/event/common", event: event
14 10
  11 + .clearfix
15 %span.cgray.right 12 %span.cgray.right
16 = time_ago_in_words(event.created_at) 13 = time_ago_in_words(event.created_at)
17 ago. 14 ago.
app/views/events/_event_issue.html.haml
@@ -1,8 +0,0 @@ @@ -1,8 +0,0 @@
1 -= image_tag gravatar_icon(event.author_email), class: "avatar"  
2 -.event-title  
3 - %strong.author_name #{event.author_name}  
4 - %span.event_label{class: event.action_name} #{event.action_name} issue  
5 - = link_to project_issue_path(event.project, event.issue) do  
6 - %strong= truncate event.issue_title  
7 - at  
8 - %strong= link_to event.project.name, event.project  
app/views/events/_event_membership_changed.html.haml
@@ -1,9 +0,0 @@ @@ -1,9 +0,0 @@
1 -= image_tag gravatar_icon(event.author_email), class: "avatar"  
2 -.event-title  
3 - %strong.author_name #{event.author_name}  
4 - %span.event_label{class: event.action_name} #{event.action_name} project  
5 - %strong= link_to event.project_name, event.project  
6 - %span.cgray  
7 - = time_ago_in_words(event.created_at)  
8 - ago.  
9 -  
app/views/events/_event_merge_request.html.haml
@@ -1,16 +0,0 @@ @@ -1,16 +0,0 @@
1 -- if event.action_name == "merged"  
2 - .event_icon= image_tag "event_mr_merged.png"  
3 -= image_tag gravatar_icon(event.author_email), class: "avatar"  
4 -.event-title  
5 - %strong.author_name #{event.author_name}  
6 - %span.event_label{class: event.action_name} #{event.action_name} merge request  
7 - = link_to project_merge_request_path(event.project, event.merge_request) do  
8 - %strong= truncate event.merge_request_title  
9 - at  
10 - %strong= link_to event.project.name, event.project  
11 -.event-body  
12 - .event-info  
13 - %span= event.merge_request.source_branch  
14 - →  
15 - %span= event.merge_request.target_branch  
16 -  
app/views/events/_event_push.html.haml
@@ -1,30 +0,0 @@ @@ -1,30 +0,0 @@
1 -%div  
2 - .event_icon= image_tag "event_push.png"  
3 - = image_tag gravatar_icon(event.author_email), class: "avatar"  
4 -  
5 - .event-title  
6 - %strong.author_name #{event.author_name}  
7 - %span.event_label.pushed #{event.push_action_name} #{event.ref_type}  
8 - - if event.rm_ref?  
9 - %strong= event.ref_name  
10 - - else  
11 - = link_to project_commits_path(event.project, event.ref_name) do  
12 - %strong= event.ref_name  
13 - at  
14 - %strong= link_to event.project.name, event.project  
15 -  
16 - - if event.push_with_commits?  
17 - - project = event.project  
18 - .event-body  
19 - %ul.unstyled.event_commits  
20 - - few_commits = event.commits[0...2]  
21 - - few_commits.each do |commit|  
22 - = render "events/commit", commit: commit, project: project  
23 -  
24 - - if event.commits_count > 1  
25 - %li.commits-stat  
26 - - if event.commits_count > 2  
27 - %span ... and #{event.commits_count - 2} more commits.  
28 - = link_to project_compare_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do  
29 - %strong Compare → #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}  
30 - .clearfix  
app/views/events/event/_common.html.haml 0 → 100644
@@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
  1 +.event-title
  2 + %span.author_name= link_to_author event
  3 + %span.event_label{class: event.action_name}= event_action_name(event)
  4 + = link_to [event.project, event.target] do
  5 + %strong= truncate event.target_title
  6 + at
  7 + = link_to_project event.project
app/views/events/event/_push.html.haml 0 → 100644
@@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
  1 +.event-title
  2 + %span.author_name= link_to_author event
  3 + %span.event_label.pushed #{event.push_action_name} #{event.ref_type}
  4 + - if event.rm_ref?
  5 + %strong= event.ref_name
  6 + - else
  7 + = link_to project_commits_path(event.project, event.ref_name) do
  8 + %strong= event.ref_name
  9 + at
  10 + %strong= link_to event.project.name, event.project
  11 +
  12 +- if event.push_with_commits?
  13 + - project = event.project
  14 + .event-body
  15 + %ul.unstyled.event_commits
  16 + - few_commits = event.commits[0...2]
  17 + - few_commits.each do |commit|
  18 + = render "events/commit", commit: commit, project: project
  19 +
  20 + - if event.commits_count > 1
  21 + %li.commits-stat
  22 + - if event.commits_count > 2
  23 + %span ... and #{event.commits_count - 2} more commits.
  24 + = link_to project_compare_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do
  25 + %strong Compare → #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}
app/views/notes/_common_form.html.haml
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 $(function(){ 41 $(function(){
42 var names = #{@project.users.pluck(:name)}, emoji = ['+1', '-1']; 42 var names = #{@project.users.pluck(:name)}, emoji = ['+1', '-1'];
43 var emoji = $.map(emoji, function(value, i) {return {key:value + ':', name:value}}); 43 var emoji = $.map(emoji, function(value, i) {return {key:value + ':', name:value}});
44 - $('#note_note'). 44 + $('#note_note, .per_line_form .line-note-text').
45 atWho('@', { data: names }). 45 atWho('@', { data: names }).
46 atWho(':', { 46 atWho(':', {
47 data: emoji, 47 data: emoji,
app/views/tree/_tree.html.haml
@@ -8,12 +8,12 @@ @@ -8,12 +8,12 @@
8 %li= link 8 %li= link
9 .clear 9 .clear
10 %div.tree_progress 10 %div.tree_progress
11 -#tree-content-holder 11 +%div#tree-content-holder.tree-content-holder
12 - if tree.is_blob? 12 - if tree.is_blob?
13 = render partial: "tree/tree_file", locals: { name: tree.name, content: tree.data, file: tree } 13 = render partial: "tree/tree_file", locals: { name: tree.name, content: tree.data, file: tree }
14 - else 14 - else
15 - contents = tree.contents 15 - contents = tree.contents
16 - %table#tree-slider{class: "table_#{@hex_path}" } 16 + %table#tree-slider{class: "table_#{@hex_path} tree-table" }
17 %thead 17 %thead
18 %th Name 18 %th Name
19 %th Last Update 19 %th Last Update
app/views/tree/show.html.haml
1 = render "head" 1 = render "head"
2 -#tree-holder= render partial: "tree", locals: {commit: @commit, tree: @tree} 2 +%div#tree-holder.tree-holder
  3 + = render "tree", commit: @commit, tree: @tree
3 4
4 :javascript 5 :javascript
5 $(function() { 6 $(function() {
doc/installation.md
@@ -112,7 +112,6 @@ Generate key: @@ -112,7 +112,6 @@ Generate key:
112 112
113 Clone GitLab's fork of the Gitolite source code: 113 Clone GitLab's fork of the Gitolite source code:
114 114
115 - cd /home/git  
116 sudo -H -u git git clone -b gl-v304 https://github.com/gitlabhq/gitolite.git /home/git/gitolite 115 sudo -H -u git git clone -b gl-v304 https://github.com/gitlabhq/gitolite.git /home/git/gitolite
117 116
118 Setup: 117 Setup:
features/dashboard/dashboard.feature
@@ -18,10 +18,10 @@ Feature: Dashboard @@ -18,10 +18,10 @@ Feature: Dashboard
18 Scenario: I should see User joined Project event 18 Scenario: I should see User joined Project event
19 Given user with name "John Doe" joined project "Shop" 19 Given user with name "John Doe" joined project "Shop"
20 When I visit dashboard page 20 When I visit dashboard page
21 - Then I should see "John Doe joined project Shop" event 21 + Then I should see "John Doe joined project at Shop" event
22 22
23 Scenario: I should see User left Project event 23 Scenario: I should see User left Project event
24 Given user with name "John Doe" joined project "Shop" 24 Given user with name "John Doe" joined project "Shop"
25 And user with name "John Doe" left project "Shop" 25 And user with name "John Doe" left project "Shop"
26 When I visit dashboard page 26 When I visit dashboard page
27 - Then I should see "John Doe left project Shop" event 27 + Then I should see "John Doe left project at Shop" event
features/steps/dashboard/dashboard.rb
@@ -41,8 +41,8 @@ class Dashboard < Spinach::FeatureSteps @@ -41,8 +41,8 @@ class Dashboard < Spinach::FeatureSteps
41 ) 41 )
42 end 42 end
43 43
44 - Then 'I should see "John Doe joined project Shop" event' do  
45 - page.should have_content "John Doe joined project Shop" 44 + Then 'I should see "John Doe joined project at Shop" event' do
  45 + page.should have_content "John Doe joined project at Shop"
46 end 46 end
47 47
48 And 'user with name "John Doe" left project "Shop"' do 48 And 'user with name "John Doe" left project "Shop"' do
@@ -55,8 +55,8 @@ class Dashboard < Spinach::FeatureSteps @@ -55,8 +55,8 @@ class Dashboard < Spinach::FeatureSteps
55 ) 55 )
56 end 56 end
57 57
58 - Then 'I should see "John Doe left project Shop" event' do  
59 - page.should have_content "John Doe left project Shop" 58 + Then 'I should see "John Doe left project at Shop" event' do
  59 + page.should have_content "John Doe left project at Shop"
60 end 60 end
61 61
62 And 'I own project "Shop"' do 62 And 'I own project "Shop"' do