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