From 9d9722494141663e21826acc7979b0879ce4cea8 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 16 Oct 2013 14:17:41 +0300 Subject: [PATCH] Project share UI: Replace groups list with selectbox --- .../projects/group_links/index.html.haml | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/app/views/projects/group_links/index.html.haml b/app/views/projects/group_links/index.html.haml index 824cebe4cd..3ee7de5387 100644 --- a/app/views/projects/group_links/index.html.haml +++ b/app/views/projects/group_links/index.html.haml @@ -2,35 +2,36 @@ %p.light Project can be stored in one group at once. However you can share project with other groups here. %hr -.row - .span5.enabled-groups +- if @group_links.present? + .enabled-groups.append-bottom-20 %h4 - Already shared with: + Already shared with %ul.bordered-list - @group_links.each do |group_link| - group = group_link.group %li %h4 - .pull-left - = link_to project_group_link_path(@project, group_link), method: :delete, class: 'btn btn-small append-right-10' do - %i.icon-remove = link_to group do %i.icon-folder-open = group.name %small.light up to #{group_link.human_access} + .pull-right + = link_to project_group_link_path(@project, group_link), method: :delete, class: 'btn btn-small append-right-10' do + %i.icon-remove + disable sharing - .span5.available-groups +- if @available_groups.present? + .available-groups %h4 - Can be shared with: - %ul.bordered-list - - @available_groups.each do |group| - %li - .pull-right - = form_tag project_group_links_path(@project), method: :post do - = select_tag :group_access, options_for_select(ProjectGroupLink.access_options, ProjectGroupLink.default_access), class: "span2" - = hidden_field_tag :group_id, group.id - = submit_tag "Share", class: "btn btn-small" - %h4 - %i.icon-folder-close - = group.name + Can be shared with + %div + = form_tag project_group_links_path(@project), method: :post do + .control-group + = label_tag :group_id, 'Group' + .controls= select_tag :group_id, options_from_collection_for_select(@available_groups, :id, :name), class: 'chosen' + .control-group + = label_tag :group_access, 'Max access level' + .controls= select_tag :group_access, options_for_select(ProjectGroupLink.access_options, ProjectGroupLink.default_access), class: "span2" + .form-actions + = submit_tag "Share", class: "btn btn-create"