diff options
author | Rémy Coutable <remy@rymai.me> | 2016-06-02 19:05:06 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-06-14 14:18:14 +0300 |
commit | 515205d3c1c6655302ed0ae44cc5954dead7ae79 (patch) | |
tree | 5ac24884eb0e6faf56e1e460260303fbdb14b9cf /app/views/layouts | |
parent | 6d103a2f4764441b1650ba6d790732056c9a8516 (diff) |
UI and copywriting improvements
+ Move 'Edit Project/Group' out of membership-related partial
+ Show the access request buttons only to logged-in users
+ Put the request access buttons out of in a more visible button
+ Improve the copy in the #remove_member_message helper
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/views/layouts')
-rw-r--r-- | app/views/layouts/nav/_group_settings.html.haml | 17 | ||||
-rw-r--r-- | app/views/layouts/nav/_project.html.haml | 36 |
2 files changed, 29 insertions, 24 deletions
diff --git a/app/views/layouts/nav/_group_settings.html.haml b/app/views/layouts/nav/_group_settings.html.haml index b461772b87e..dac46648b9f 100644 --- a/app/views/layouts/nav/_group_settings.html.haml +++ b/app/views/layouts/nav/_group_settings.html.haml @@ -1,3 +1,16 @@ - if current_user - .controls - = render 'shared/group_or_project_home_dropdown', entity: @group + - if access = @group.users.find_by(id: current_user.id) + .controls + .dropdown.group-settings-dropdown + %a.dropdown-new.btn.btn-default#group-settings-button{href: '#', 'data-toggle' => 'dropdown'} + = icon('cog') + = icon('caret-down') + %ul.dropdown-menu.dropdown-menu-align-right + - if can?(current_user, :admin_group, @group) + = nav_link(path: 'groups#projects') do + = link_to projects_group_path(@group), title: 'Projects' do + Projects + %li.divider + %li + = link_to edit_group_path(@group) do + Edit Group diff --git a/app/views/layouts/nav/_project.html.haml b/app/views/layouts/nav/_project.html.haml index 3398794302f..ad019710830 100644 --- a/app/views/layouts/nav/_project.html.haml +++ b/app/views/layouts/nav/_project.html.haml @@ -1,33 +1,25 @@ - if current_user .controls - - access = user_max_access_in_project(current_user.id, @project) - - can_edit = can?(current_user, :admin_project, @project) .dropdown.project-settings-dropdown %a.dropdown-new.btn.btn-default#project-settings-button{href: '#', 'data-toggle' => 'dropdown'} = icon('cog') = icon('caret-down') %ul.dropdown-menu.dropdown-menu-align-right = render 'layouts/nav/project_settings' - %li.divider - - if can_edit - %li - = link_to edit_project_path(@project) do - Edit Project - - if access - %li - = link_to leave_path(@project), - data: { confirm: leave_confirmation_message(@project) }, method: :delete do - Leave Project - - elsif @project.access_requested?(current_user) - %li - = link_to leave_path(@project), - data: { confirm: withdraw_request_message(@project) }, method: :delete do - Withdraw Request - - else - %li - = link_to request_access_path(@project), - class: 'btn btn-gray', style: 'margin-left: 10px', method: :post do - Request Access + + - access = @project.team.max_member_access(current_user.id) + - can_edit = can?(current_user, :admin_project, @project) + - if can_edit || access + %li.divider + - if can_edit + %li + = link_to edit_project_path(@project) do + Edit Project + - if access + %li + = link_to polymorphic_path([:leave, @project, :members]), + data: { confirm: leave_confirmation_message(@project) }, method: :delete do + Leave Project %div{ class: nav_control_class } %ul.nav-links.scrolling-tabs |