diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-05-20 14:27:35 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-05-25 15:21:30 -0500 |
commit | e45e540d1d90549cc5f45521360241afce9eaf18 (patch) | |
tree | 5a01a839261b97ea3caac9621fe19bb80e15a93b /app/views | |
parent | e20eb71203aa29458d7f51a27d42a3d8208e2494 (diff) | |
download | gitlab-ce-e45e540d1d90549cc5f45521360241afce9eaf18.tar.gz |
Consistently display last push event widget
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/dashboard/_activities.html.haml | 3 | ||||
-rw-r--r-- | app/views/dashboard/activity.html.haml | 3 | ||||
-rw-r--r-- | app/views/dashboard/projects/index.html.haml | 4 | ||||
-rw-r--r-- | app/views/dashboard/projects/starred.html.haml | 5 | ||||
-rw-r--r-- | app/views/events/_event_last_push.html.haml | 14 | ||||
-rw-r--r-- | app/views/events/event/_push.html.haml | 2 | ||||
-rw-r--r-- | app/views/groups/_activities.html.haml | 3 | ||||
-rw-r--r-- | app/views/groups/_head.html.haml | 3 | ||||
-rw-r--r-- | app/views/groups/show.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/_last_push.html.haml | 36 | ||||
-rw-r--r-- | app/views/projects/activity.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/merge_requests/index.html.haml | 5 | ||||
-rw-r--r-- | app/views/projects/tree/show.html.haml | 3 |
13 files changed, 39 insertions, 47 deletions
diff --git a/app/views/dashboard/_activities.html.haml b/app/views/dashboard/_activities.html.haml index e1b270a08c2..a676eba2aee 100644 --- a/app/views/dashboard/_activities.html.haml +++ b/app/views/dashboard/_activities.html.haml @@ -1,6 +1,3 @@ -.hidden-xs - = render "events/event_last_push", event: @last_push - .nav-block.activities .controls = link_to dashboard_projects_path(rss_url_options), class: 'btn rss-btn has-tooltip', title: 'Subscribe' do diff --git a/app/views/dashboard/activity.html.haml b/app/views/dashboard/activity.html.haml index 190ad4b40a5..9f932b0558e 100644 --- a/app/views/dashboard/activity.html.haml +++ b/app/views/dashboard/activity.html.haml @@ -4,6 +4,9 @@ - page_title "Activity" - header_title "Activity", activity_dashboard_path +.hidden-xs + = render "projects/last_push" + = render 'dashboard/activity_head' %section.activities diff --git a/app/views/dashboard/projects/index.html.haml b/app/views/dashboard/projects/index.html.haml index 596499230f9..1d8dd4a2711 100644 --- a/app/views/dashboard/projects/index.html.haml +++ b/app/views/dashboard/projects/index.html.haml @@ -7,11 +7,11 @@ - unless show_user_callout? = render 'shared/user_callout' += render "projects/last_push" + - if @projects.any? || params[:name] = render 'dashboard/projects_head' -- if @last_push - = render "events/event_last_push", event: @last_push - if @projects.any? || params[:name] = render 'projects' diff --git a/app/views/dashboard/projects/starred.html.haml b/app/views/dashboard/projects/starred.html.haml index 162ae153b1c..8a6c9466348 100644 --- a/app/views/dashboard/projects/starred.html.haml +++ b/app/views/dashboard/projects/starred.html.haml @@ -1,10 +1,9 @@ - page_title "Starred Projects" - header_title "Projects", dashboard_projects_path -= render 'dashboard/projects_head' += render "projects/last_push" -- if @last_push - = render "events/event_last_push", event: @last_push += render 'dashboard/projects_head' - if @projects.any? || params[:filter_projects] = render 'projects' diff --git a/app/views/events/_event_last_push.html.haml b/app/views/events/_event_last_push.html.haml deleted file mode 100644 index 1584695a62b..00000000000 --- a/app/views/events/_event_last_push.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -- 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 diff --git a/app/views/events/event/_push.html.haml b/app/views/events/event/_push.html.haml index c0943100ae3..769ac655d0a 100644 --- a/app/views/events/event/_push.html.haml +++ b/app/views/events/event/_push.html.haml @@ -7,7 +7,7 @@ %span.pushed #{event.action_name} #{event.ref_type} %strong - 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 diff --git a/app/views/groups/_activities.html.haml b/app/views/groups/_activities.html.haml index d7851c79990..fd6e7111f38 100644 --- a/app/views/groups/_activities.html.haml +++ b/app/views/groups/_activities.html.haml @@ -1,6 +1,3 @@ -.hidden-xs - = render "events/event_last_push", event: @last_push - .nav-block .controls = link_to group_path(@group, rss_url_options), class: 'btn rss-btn has-tooltip' , title: 'Subscribe' do diff --git a/app/views/groups/_head.html.haml b/app/views/groups/_head.html.haml index 873504099d4..0f63774fb9b 100644 --- a/app/views/groups/_head.html.haml +++ b/app/views/groups/_head.html.haml @@ -12,3 +12,6 @@ = link_to activity_group_path(@group), title: 'Activity' do %span Activity + +.hidden-xs + = render "projects/last_push" diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index 18997baa998..d3a2fdff804 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -4,8 +4,8 @@ = auto_discovery_link_tag(:atom, group_url(@group, rss_url_options), title: "#{@group.name} activity") = render 'groups/head' -= render 'groups/home_panel' += render 'groups/home_panel' .groups-header{ class: container_class } .top-area diff --git a/app/views/projects/_last_push.html.haml b/app/views/projects/_last_push.html.haml index f8a6e98d280..b81416bdb2f 100644 --- a/app/views/projects/_last_push.html.haml +++ b/app/views/projects/_last_push.html.haml @@ -1,18 +1,20 @@ -- if event = last_push_event - - if show_last_push_widget?(event) - .row-content-block.top-block.hidden-xs.white - %div{ class: container_class } - .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, class: 'commit-sha') do - %strong= event.ref_name - - if @project && event.project != @project - %span at - %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)} +- event = last_push_event +- if event && show_last_push_widget?(event) + .row-content-block.top-block.hidden-xs.white + .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), class: 'ref-name' do + %strong= event.ref_name - .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 + = 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 + %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 diff --git a/app/views/projects/activity.html.haml b/app/views/projects/activity.html.haml index 27c8e3c7fca..fcf8877aed4 100644 --- a/app/views/projects/activity.html.haml +++ b/app/views/projects/activity.html.haml @@ -1,6 +1,7 @@ - page_title "Activity" = render "projects/head" -= render 'projects/last_push' +%div{ class: container_class } + = render 'projects/last_push' = render 'projects/activity' diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml index 502220232a1..041464110b1 100644 --- a/app/views/projects/merge_requests/index.html.haml +++ b/app/views/projects/merge_requests/index.html.haml @@ -5,12 +5,15 @@ - unless @project.default_issues_tracker? = content_for :sub_nav do = render "projects/merge_requests/head" -= render 'projects/last_push' - content_for :page_specific_javascripts do = webpack_bundle_tag 'common_vue' = webpack_bundle_tag 'filtered_search' + +%div{ class: container_class } + = render 'projects/last_push' + - if @project.merge_requests.exists? %div{ class: container_class } .top-area diff --git a/app/views/projects/tree/show.html.haml b/app/views/projects/tree/show.html.haml index b51955010ce..4daf5cd28db 100644 --- a/app/views/projects/tree/show.html.haml +++ b/app/views/projects/tree/show.html.haml @@ -4,7 +4,8 @@ = 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") = render "projects/commits/head" -= render 'projects/last_push' %div{ class: container_class } + = render 'projects/last_push' + = render 'projects/files', commit: @last_commit, project: @project, ref: @ref |