diff --git a/app/assets/stylesheets/gitlab_bootstrap/lists.scss b/app/assets/stylesheets/gitlab_bootstrap/lists.scss index 5585c35c..a5d6bd0a 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/lists.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/lists.scss @@ -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; } diff --git a/app/assets/stylesheets/sections/events.scss b/app/assets/stylesheets/sections/events.scss index 5cd3fb7d..b7a482fd 100644 --- a/app/assets/stylesheets/sections/events.scss +++ b/app/assets/stylesheets/sections/events.scss @@ -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; } } diff --git a/app/assets/stylesheets/sections/tree.scss b/app/assets/stylesheets/sections/tree.scss index 5b2bb799..cd31b6a3 100644 --- a/app/assets/stylesheets/sections/tree.scss +++ b/app/assets/stylesheets/sections/tree.scss @@ -1,21 +1,8 @@ -#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; } } - } diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb new file mode 100644 index 00000000..2c466aba --- /dev/null +++ b/app/helpers/events_helper.rb @@ -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 diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index d4d6c2d4..9b537187 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -33,7 +33,7 @@ module IssuesHelper classes end - def issue_tags + def issue_tags @project.issues.tag_counts_on(:labels).map(&:name) end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index c7dc54ee..468ace15 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -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 diff --git a/app/models/event.rb b/app/models/event.rb index de493cdb..8a698a9b 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -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 diff --git a/app/views/events/_event.html.haml b/app/views/events/_event.html.haml index 716a214b..0d91a67a 100644 --- a/app/views/events/_event.html.haml +++ b/app/views/events/_event.html.haml @@ -1,17 +1,14 @@ - 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. diff --git a/app/views/events/_event_issue.html.haml b/app/views/events/_event_issue.html.haml deleted file mode 100644 index 60e82c4d..00000000 --- a/app/views/events/_event_issue.html.haml +++ /dev/null @@ -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 diff --git a/app/views/events/_event_membership_changed.html.haml b/app/views/events/_event_membership_changed.html.haml deleted file mode 100644 index e89065b9..00000000 --- a/app/views/events/_event_membership_changed.html.haml +++ /dev/null @@ -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. - diff --git a/app/views/events/_event_merge_request.html.haml b/app/views/events/_event_merge_request.html.haml deleted file mode 100644 index 655337f3..00000000 --- a/app/views/events/_event_merge_request.html.haml +++ /dev/null @@ -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 - → - %span= event.merge_request.target_branch - diff --git a/app/views/events/_event_push.html.haml b/app/views/events/_event_push.html.haml deleted file mode 100644 index e9a2e95f..00000000 --- a/app/views/events/_event_push.html.haml +++ /dev/null @@ -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 → #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]} - .clearfix diff --git a/app/views/events/event/_common.html.haml b/app/views/events/event/_common.html.haml new file mode 100644 index 00000000..ffcaa81a --- /dev/null +++ b/app/views/events/event/_common.html.haml @@ -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 diff --git a/app/views/events/event/_push.html.haml b/app/views/events/event/_push.html.haml new file mode 100644 index 00000000..869321ed --- /dev/null +++ b/app/views/events/event/_push.html.haml @@ -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 → #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]} diff --git a/app/views/notes/_common_form.html.haml b/app/views/notes/_common_form.html.haml index 626a448c..adaad9ec 100644 --- a/app/views/notes/_common_form.html.haml +++ b/app/views/notes/_common_form.html.haml @@ -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, diff --git a/app/views/tree/_tree.html.haml b/app/views/tree/_tree.html.haml index cdd67929..3e805d57 100644 --- a/app/views/tree/_tree.html.haml +++ b/app/views/tree/_tree.html.haml @@ -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 diff --git a/app/views/tree/show.html.haml b/app/views/tree/show.html.haml index d95f90e0..591818ce 100644 --- a/app/views/tree/show.html.haml +++ b/app/views/tree/show.html.haml @@ -1,5 +1,6 @@ = 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() { diff --git a/doc/installation.md b/doc/installation.md index 865cde3c..ccbbd2e8 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -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: diff --git a/features/dashboard/dashboard.feature b/features/dashboard/dashboard.feature index 9756bc7f..40217a7d 100644 --- a/features/dashboard/dashboard.feature +++ b/features/dashboard/dashboard.feature @@ -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 diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb index 154b97e3..2bbbe55e 100644 --- a/features/steps/dashboard/dashboard.rb +++ b/features/steps/dashboard/dashboard.rb @@ -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