Move access request buttons to project header
This commit is contained in:
parent
546fa165ff
commit
8c2297f00b
5 changed files with 27 additions and 18 deletions
|
@ -178,8 +178,10 @@
|
|||
.download-button,
|
||||
.dropdown-toggle,
|
||||
.notification-dropdown,
|
||||
.project-dropdown {
|
||||
.project-dropdown,
|
||||
.access-button {
|
||||
margin-left: 10px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.notification-dropdown .dropdown-menu {
|
||||
|
@ -201,7 +203,7 @@
|
|||
display: inline-block;
|
||||
|
||||
input {
|
||||
height: 29px;
|
||||
height: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -255,7 +257,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;
|
||||
|
|
|
@ -26,3 +26,6 @@
|
|||
- if @project.feature_available?(:repository, current_user)
|
||||
.project-clone-holder
|
||||
= render "shared/clone_panel"
|
||||
|
||||
- if current_user
|
||||
= render 'shared/members/access_request_buttons', source: @project
|
||||
|
|
|
@ -69,7 +69,6 @@
|
|||
%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
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
- 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))
|
||||
= 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)
|
||||
= 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)
|
||||
= link_to 'Request Access', polymorphic_path([:request_access, source, :members]),
|
||||
method: :post,
|
||||
class: 'btn'
|
||||
.access-button.inline.hidden-sm.hidden-xs
|
||||
- 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)
|
||||
= 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)
|
||||
= link_to 'Request Access', polymorphic_path([:request_access, source, :members]),
|
||||
method: :post,
|
||||
class: 'btn'
|
||||
|
|
4
changelogs/unreleased/leave-project-btn.yml
Normal file
4
changelogs/unreleased/leave-project-btn.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
title: Move access project button to header
|
||||
merge_request:
|
||||
author:
|
Loading…
Reference in a new issue