summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/stylesheets/pages/projects.scss8
-rw-r--r--app/views/projects/_home_panel.html.haml3
-rw-r--r--app/views/projects/show.html.haml1
-rw-r--r--app/views/shared/members/_access_request_buttons.html.haml29
-rw-r--r--changelogs/unreleased/leave-project-btn.yml4
5 files changed, 27 insertions, 18 deletions
diff --git a/app/assets/stylesheets/pages/projects.scss b/app/assets/stylesheets/pages/projects.scss
index 3b1b375133d..29a8f5b3995 100644
--- a/app/assets/stylesheets/pages/projects.scss
+++ b/app/assets/stylesheets/pages/projects.scss
@@ -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;
diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml
index 5a04c3318cf..d13177f6776 100644
--- a/app/views/projects/_home_panel.html.haml
+++ b/app/views/projects/_home_panel.html.haml
@@ -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
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index c50093cf47c..20ea8600a40 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -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
diff --git a/app/views/shared/members/_access_request_buttons.html.haml b/app/views/shared/members/_access_request_buttons.html.haml
index e166dfab710..e9b9ed554c1 100644
--- a/app/views/shared/members/_access_request_buttons.html.haml
+++ b/app/views/shared/members/_access_request_buttons.html.haml
@@ -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'
diff --git a/changelogs/unreleased/leave-project-btn.yml b/changelogs/unreleased/leave-project-btn.yml
new file mode 100644
index 00000000000..ff07dfeed17
--- /dev/null
+++ b/changelogs/unreleased/leave-project-btn.yml
@@ -0,0 +1,4 @@
+---
+title: Move access project button to header
+merge_request:
+author: