Commit 3597666b authored by Fatih Acet's avatar Fatih Acet Committed by Douglas Barbosa Alexandre

Merge branch 'leave-project-btn' into 'master'

Move buttons to project header

Closes #25692    
Before:   
<img src="/uploads/fb65f1ca8021f1669071a3980e5f8258/Screen_Shot_2016-12-14_at_3.52.19_PM.png" width="800px">
After (with Koding setup):   
<img src="/uploads/236e0103186a1b482c4302aa3a4b94b1/Screen_Shot_2016-12-16_at_10.09.53_AM.png" width="800px">
After (without Koding setup):
<img src="/uploads/04bc8360831c98a4c86d3b11ee24826d/Screen_Shot_2016-12-16_at_10.18.35_AM.png" width="800px">


See merge request !8095
parent f350c8f9
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
}); });
$(document).off('ajax:success', '.notification-form').on('ajax:success', '.notification-form', function(e, data) { $(document).off('ajax:success', '.notification-form').on('ajax:success', '.notification-form', function(e, data) {
if (data.saved) { if (data.saved) {
return $(e.currentTarget).closest('.notification-dropdown').replaceWith(data.html); return $(e.currentTarget).closest('.js-notification-dropdown').replaceWith(data.html);
} else { } else {
return new Flash('Failed to save new settings', 'alert'); return new Flash('Failed to save new settings', 'alert');
} }
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
} }
// Display Star and Fork buttons without counters on mobile. // Display Star and Fork buttons without counters on mobile.
.project-action-buttons { .project-repo-buttons {
display: block; display: block;
.count-buttons .btn { .count-buttons .btn {
......
...@@ -24,6 +24,7 @@ $gray-lightest: #fdfdfd; ...@@ -24,6 +24,7 @@ $gray-lightest: #fdfdfd;
$gray-light: #fafafa; $gray-light: #fafafa;
$gray-lighter: #f9f9f9; $gray-lighter: #f9f9f9;
$gray-normal: #f5f5f5; $gray-normal: #f5f5f5;
$gray-dark: darken($gray-light, $darken-dark-factor);
$gray-darker: #eee; $gray-darker: #eee;
$gray-darkest: #c4c4c4; $gray-darkest: #c4c4c4;
......
...@@ -27,12 +27,6 @@ ...@@ -27,12 +27,6 @@
} }
} }
.group-buttons {
.notification-dropdown {
display: inline-block;
}
}
.groups-header { .groups-header {
@media (min-width: $screen-sm-min) { @media (min-width: $screen-sm-min) {
.nav-links { .nav-links {
......
...@@ -145,8 +145,6 @@ ...@@ -145,8 +145,6 @@
.project-repo-buttons, .project-repo-buttons,
.group-buttons { .group-buttons {
margin-top: 15px;
.btn { .btn {
@include btn-gray; @include btn-gray;
padding: 3px 10px; padding: 3px 10px;
...@@ -175,11 +173,9 @@ ...@@ -175,11 +173,9 @@
} }
} }
.download-button, .project-action-button {
.dropdown-toggle, margin: 15px 5px 0;
.notification-dropdown, vertical-align: top;
.project-dropdown {
margin-left: 10px;
} }
.notification-dropdown .dropdown-menu { .notification-dropdown .dropdown-menu {
...@@ -195,13 +191,15 @@ ...@@ -195,13 +191,15 @@
.count-buttons { .count-buttons {
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
margin-top: 15px;
} }
.project-clone-holder { .project-clone-holder {
display: inline-block; display: inline-block;
margin: 15px 5px 0 0;
input { input {
height: 29px; height: 28px;
} }
} }
...@@ -255,7 +253,7 @@ ...@@ -255,7 +253,7 @@
line-height: 13px; line-height: 13px;
padding: $gl-vert-padding $gl-padding; padding: $gl-vert-padding $gl-padding;
letter-spacing: .4px; letter-spacing: .4px;
padding: 7px 14px; padding: 6px 14px;
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
touch-action: manipulation; touch-action: manipulation;
...@@ -492,6 +490,7 @@ a.deploy-project-label { ...@@ -492,6 +490,7 @@ a.deploy-project-label {
.project-stats { .project-stats {
font-size: 0; font-size: 0;
text-align: center;
border-bottom: 1px solid $border-color; border-bottom: 1px solid $border-color;
.nav { .nav {
......
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
position: relative; position: relative;
z-index: 2; z-index: 2;
.download-button { .project-action-button {
margin-left: $btn-side-margin; margin-left: $btn-side-margin;
} }
} }
...@@ -18,11 +18,19 @@ ...@@ -18,11 +18,19 @@
= link_to project_path(forked_from_project) do = link_to project_path(forked_from_project) do
= forked_from_project.namespace.try(:name) = forked_from_project.namespace.try(:name)
.project-repo-buttons.project-action-buttons .project-repo-buttons
.count-buttons .count-buttons
= render 'projects/buttons/star' = render 'projects/buttons/star'
= render 'projects/buttons/fork' = render 'projects/buttons/fork'
%span.hidden-xs
- if @project.feature_available?(:repository, current_user) - if @project.feature_available?(:repository, current_user)
.project-clone-holder .project-clone-holder
= render "shared/clone_panel" = render "shared/clone_panel"
- if current_user && can?(current_user, :download_code, @project)
= render 'projects/buttons/download', project: @project, ref: @ref
= render 'projects/buttons/dropdown'
= render 'shared/notifications/button', notification_setting: @notification_setting
= render 'projects/buttons/koding'
= render 'shared/members/access_request_buttons', source: @project
- if !project.empty_repo? && can?(current_user, :download_code, project) - if !project.empty_repo? && can?(current_user, :download_code, project)
.dropdown.inline.download-button .project-action-button.dropdown.inline
%button.btn{ 'data-toggle' => 'dropdown' } %button.btn{ 'data-toggle' => 'dropdown' }
= icon('download') = icon('download')
= icon("caret-down") = icon("caret-down")
......
- if current_user - if current_user
.dropdown.inline .project-action-button.dropdown.inline
%a.btn.dropdown-toggle{href: '#', "data-toggle" => "dropdown"} %a.btn.dropdown-toggle{href: '#', "data-toggle" => "dropdown"}
= icon('plus') = icon('plus')
= icon("caret-down") = icon("caret-down")
......
- if koding_enabled? && current_user && can_push_branch?(@project, @project.default_branch) - if koding_enabled? && current_user && @repository.koding_yml && can_push_branch?(@project, @project.default_branch)
- if @repository.koding_yml = link_to koding_project_url(@project), class: 'btn project-action-button inline', target: '_blank' do
= link_to koding_project_url(@project), class: 'btn', target: '_blank' do
Run in IDE (Koding) Run in IDE (Koding)
- else
= link_to add_koding_stack_path(@project), class: 'btn' do
Set Up Koding
...@@ -64,20 +64,11 @@ ...@@ -64,20 +64,11 @@
- unless @repository.gitlab_ci_yml - unless @repository.gitlab_ci_yml
%li.missing %li.missing
= link_to add_special_file_path(@project, file_name: '.gitlab-ci.yml') do = link_to add_special_file_path(@project, file_name: '.gitlab-ci.yml') do
Set Up CI Set up CI
- if koding_enabled? && @repository.koding_yml.blank?
%li.project-repo-buttons.right %li.missing
.project-right-buttons = link_to 'Set up Koding', add_koding_stack_path(@project)
- if current_user
= render 'shared/members/access_request_buttons', source: @project
= render "projects/buttons/koding"
.btn-group.project-repo-btn-group
= render 'projects/buttons/download', project: @project, ref: @ref
= render 'projects/buttons/dropdown'
.pull-right
= render 'shared/notifications/button', notification_setting: @notification_setting
- if @repository.commit - if @repository.commit
.project-last-commit{ class: container_class } .project-last-commit{ class: container_class }
= render 'projects/last_commit', commit: @repository.commit, ref: current_ref, project: @project = render 'projects/last_commit', commit: @repository.commit, ref: current_ref, project: @project
......
- model_name = source.model_name.to_s.downcase - model_name = source.model_name.to_s.downcase
- if can?(current_user, :"destroy_#{model_name}_member", source.members.find_by(user_id: current_user.id)) .project-action-button.inline
- if can?(current_user, :"destroy_#{model_name}_member", source.members.find_by(user_id: current_user.id))
= link_to "Leave #{model_name}", polymorphic_path([:leave, source, :members]), = link_to "Leave #{model_name}", polymorphic_path([:leave, source, :members]),
method: :delete, method: :delete,
data: { confirm: leave_confirmation_message(source) }, data: { confirm: leave_confirmation_message(source) },
class: 'btn' class: 'btn'
- elsif requester = source.requesters.find_by(user_id: current_user.id) - elsif requester = source.requesters.find_by(user_id: current_user.id)
= link_to 'Withdraw Access Request', polymorphic_path([:leave, source, :members]), = link_to 'Withdraw Access Request', polymorphic_path([:leave, source, :members]),
method: :delete, method: :delete,
data: { confirm: remove_member_message(requester) }, data: { confirm: remove_member_message(requester) },
class: 'btn' class: 'btn'
- elsif source.request_access_enabled && can?(current_user, :request_access, source) - elsif source.request_access_enabled && can?(current_user, :request_access, source)
= link_to 'Request Access', polymorphic_path([:request_access, source, :members]), = link_to 'Request Access', polymorphic_path([:request_access, source, :members]),
method: :post, method: :post,
class: 'btn' class: 'btn'
- if notification_setting - if notification_setting
.dropdown.notification-dropdown .js-notification-dropdown.notification-dropdown.project-action-button.dropdown.inline
= form_for notification_setting, remote: true, html: { class: "inline notification-form" } do |f| = form_for notification_setting, remote: true, html: { class: "inline notification-form" } do |f|
= hidden_setting_source_input(notification_setting) = hidden_setting_source_input(notification_setting)
= f.hidden_field :level, class: "notification_setting_level" = f.hidden_field :level, class: "notification_setting_level"
......
---
title: Move all action buttons to project header
merge_request:
author:
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