Commit e45e540d authored by Douwe Maan's avatar Douwe Maan

Consistently display last push event widget

parent e20eb712
...@@ -384,10 +384,6 @@ a.deploy-project-label { ...@@ -384,10 +384,6 @@ a.deploy-project-label {
} }
} }
.last-push-widget {
margin-top: -1px;
}
.fork-namespaces { .fork-namespaces {
.row { .row {
-webkit-flex-wrap: wrap; -webkit-flex-wrap: wrap;
......
...@@ -8,7 +8,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController ...@@ -8,7 +8,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
@projects = load_projects(params.merge(non_public: true)).page(params[:page]) @projects = load_projects(params.merge(non_public: true)).page(params[:page])
respond_to do |format| respond_to do |format|
format.html { @last_push = current_user.recent_push } format.html
format.atom do format.atom do
load_events load_events
render layout: false render layout: false
...@@ -25,7 +25,6 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController ...@@ -25,7 +25,6 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
@projects = load_projects(params.merge(starred: true)). @projects = load_projects(params.merge(starred: true)).
includes(:forked_from_project, :tags).page(params[:page]) includes(:forked_from_project, :tags).page(params[:page])
@last_push = current_user.recent_push
@groups = [] @groups = []
respond_to do |format| respond_to do |format|
......
...@@ -9,8 +9,6 @@ class DashboardController < Dashboard::ApplicationController ...@@ -9,8 +9,6 @@ class DashboardController < Dashboard::ApplicationController
respond_to :html respond_to :html
def activity def activity
@last_push = current_user.recent_push
respond_to do |format| respond_to do |format|
format.html format.html
......
...@@ -165,7 +165,6 @@ class GroupsController < Groups::ApplicationController ...@@ -165,7 +165,6 @@ class GroupsController < Groups::ApplicationController
def user_actions def user_actions
if current_user if current_user
@last_push = current_user.recent_push
@notification_setting = current_user.notification_settings_for(group) @notification_setting = current_user.notification_settings_for(group)
end end
end end
......
...@@ -116,6 +116,7 @@ module ProjectsHelper ...@@ -116,6 +116,7 @@ module ProjectsHelper
def last_push_event def last_push_event
return unless current_user return unless current_user
return current_user.recent_push unless @project
project_ids = [@project.id] project_ids = [@project.id]
if fork = current_user.fork_of(@project) if fork = current_user.fork_of(@project)
......
.hidden-xs
= render "events/event_last_push", event: @last_push
.nav-block.activities .nav-block.activities
.controls .controls
= link_to dashboard_projects_path(rss_url_options), class: 'btn rss-btn has-tooltip', title: 'Subscribe' do = link_to dashboard_projects_path(rss_url_options), class: 'btn rss-btn has-tooltip', title: 'Subscribe' do
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
- page_title "Activity" - page_title "Activity"
- header_title "Activity", activity_dashboard_path - header_title "Activity", activity_dashboard_path
.hidden-xs
= render "projects/last_push"
= render 'dashboard/activity_head' = render 'dashboard/activity_head'
%section.activities %section.activities
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
- unless show_user_callout? - unless show_user_callout?
= render 'shared/user_callout' = render 'shared/user_callout'
= render "projects/last_push"
- if @projects.any? || params[:name] - if @projects.any? || params[:name]
= render 'dashboard/projects_head' = render 'dashboard/projects_head'
- if @last_push
= render "events/event_last_push", event: @last_push
- if @projects.any? || params[:name] - if @projects.any? || params[:name]
= render 'projects' = render 'projects'
......
- page_title "Starred Projects" - page_title "Starred Projects"
- header_title "Projects", dashboard_projects_path - header_title "Projects", dashboard_projects_path
= render 'dashboard/projects_head' = render "projects/last_push"
- if @last_push = render 'dashboard/projects_head'
= render "events/event_last_push", event: @last_push
- if @projects.any? || params[:filter_projects] - if @projects.any? || params[:filter_projects]
= render 'projects' = render 'projects'
......
- if show_last_push_widget?(event)
.row-content-block.clear-block.last-push-widget
.event-last-push
.event-last-push-text
%span You pushed to
= link_to namespace_project_commits_path(event.project.namespace, event.project, event.ref_name), title: h(event.project.name) do
%strong= event.ref_name
%span at
%strong= link_to_project event.project
#{time_ago_with_tooltip(event.created_at)}
.pull-right
= link_to new_mr_path_from_push_event(event), title: "New merge request", class: "btn btn-info btn-sm" do
Create merge request
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
%span.pushed #{event.action_name} #{event.ref_type} %span.pushed #{event.action_name} #{event.ref_type}
%strong %strong
- commits_link = namespace_project_commits_path(project.namespace, project, event.ref_name) - commits_link = namespace_project_commits_path(project.namespace, project, event.ref_name)
= link_to_if project.repository.branch_exists?(event.ref_name), event.ref_name, commits_link = link_to_if project.repository.branch_exists?(event.ref_name), event.ref_name, commits_link, class: 'ref-name'
= render "events/event_scope", event: event = render "events/event_scope", event: event
......
.hidden-xs
= render "events/event_last_push", event: @last_push
.nav-block .nav-block
.controls .controls
= link_to group_path(@group, rss_url_options), class: 'btn rss-btn has-tooltip' , title: 'Subscribe' do = link_to group_path(@group, rss_url_options), class: 'btn rss-btn has-tooltip' , title: 'Subscribe' do
......
...@@ -12,3 +12,6 @@ ...@@ -12,3 +12,6 @@
= link_to activity_group_path(@group), title: 'Activity' do = link_to activity_group_path(@group), title: 'Activity' do
%span %span
Activity Activity
.hidden-xs
= render "projects/last_push"
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
= auto_discovery_link_tag(:atom, group_url(@group, rss_url_options), title: "#{@group.name} activity") = auto_discovery_link_tag(:atom, group_url(@group, rss_url_options), title: "#{@group.name} activity")
= render 'groups/head' = render 'groups/head'
= render 'groups/home_panel'
= render 'groups/home_panel'
.groups-header{ class: container_class } .groups-header{ class: container_class }
.top-area .top-area
......
- if event = last_push_event - event = last_push_event
- if show_last_push_widget?(event) - if event && show_last_push_widget?(event)
.row-content-block.top-block.hidden-xs.white .row-content-block.top-block.hidden-xs.white
%div{ class: container_class }
.event-last-push .event-last-push
.event-last-push-text .event-last-push-text
%span You pushed to %span You pushed to
= link_to namespace_project_commits_path(event.project.namespace, event.project, event.ref_name, class: 'commit-sha') do = link_to namespace_project_commits_path(event.project.namespace, event.project, event.ref_name), class: 'ref-name' do
%strong= event.ref_name %strong= event.ref_name
- if @project && event.project != @project
= clipboard_button(text: event.ref_name, gfm: "`#{event.ref_name}`", class: 'btn-clipboard btn-transparent', title: 'Copy branch name to clipboard')
- if event.project != @project
%span at %span at
%strong= link_to_project event.project %strong= link_to_project event.project
= clipboard_button(text: event.ref_name, class: 'btn-clipboard btn-transparent', title: 'Copy branch to clipboard')
#{time_ago_with_tooltip(event.created_at)} #{time_ago_with_tooltip(event.created_at)}
.pull-right .pull-right
......
- page_title "Activity" - page_title "Activity"
= render "projects/head" = render "projects/head"
= render 'projects/last_push' %div{ class: container_class }
= render 'projects/last_push'
= render 'projects/activity' = render 'projects/activity'
...@@ -5,12 +5,15 @@ ...@@ -5,12 +5,15 @@
- unless @project.default_issues_tracker? - unless @project.default_issues_tracker?
= content_for :sub_nav do = content_for :sub_nav do
= render "projects/merge_requests/head" = render "projects/merge_requests/head"
= render 'projects/last_push'
- content_for :page_specific_javascripts do - content_for :page_specific_javascripts do
= webpack_bundle_tag 'common_vue' = webpack_bundle_tag 'common_vue'
= webpack_bundle_tag 'filtered_search' = webpack_bundle_tag 'filtered_search'
%div{ class: container_class }
= render 'projects/last_push'
- if @project.merge_requests.exists? - if @project.merge_requests.exists?
%div{ class: container_class } %div{ class: container_class }
.top-area .top-area
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
= content_for :meta_tags do = content_for :meta_tags do
= auto_discovery_link_tag(:atom, namespace_project_commits_url(@project.namespace, @project, @ref, rss_url_options), title: "#{@project.name}:#{@ref} commits") = auto_discovery_link_tag(:atom, namespace_project_commits_url(@project.namespace, @project, @ref, rss_url_options), title: "#{@project.name}:#{@ref} commits")
= render "projects/commits/head" = render "projects/commits/head"
= render 'projects/last_push'
%div{ class: container_class } %div{ class: container_class }
= render 'projects/last_push'
= render 'projects/files', commit: @last_commit, project: @project, ref: @ref = render 'projects/files', commit: @last_commit, project: @project, ref: @ref
---
title: Consistently display last push event widget
merge_request:
author:
...@@ -22,7 +22,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps ...@@ -22,7 +22,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end end
step 'I click "Create merge request" link' do step 'I click "Create merge request" link' do
click_link "Create merge request" find_link("Create merge request", visible: false).click
end end
step 'I see prefilled new Merge Request page' do step 'I see prefilled new Merge Request page' 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