From 4daf68b57f92bf697a375ebfa4bc2ebc2e3e0312 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 11 Jun 2013 15:50:25 +0300 Subject: [PATCH] Style page for project assign to team. Fix test for admin:teams --- app/views/admin/teams/projects/new.html.haml | 35 ++++++++++++---------------- features/steps/admin/admin_teams.rb | 2 +- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/app/views/admin/teams/projects/new.html.haml b/app/views/admin/teams/projects/new.html.haml index b60dad352..dcb3dbbc4 100644 --- a/app/views/admin/teams/projects/new.html.haml +++ b/app/views/admin/teams/projects/new.html.haml @@ -1,23 +1,18 @@ %h3.page_title Team: #{@team.name} +%hr += form_tag admin_team_projects_path(@team), id: "assign_projects", class: "bulk_import", method: :post do + %h6 Choose Projects you want to assign: + .clearfix + = label_tag :project_ids, "Projects" + .input + = select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name_with_namespace), multiple: true, data: {placeholder: 'Select projects'}, class: 'chosen span5' -%fieldset - %legend Projects (#{@team.projects.count}) - = form_tag admin_team_projects_path(@team), id: "assign_projects", class: "bulk_import", method: :post do - %table#projects_list - %thead - %tr - %th Project name - %th Max access - %th - - @team.projects.each do |project| - %tr.project - %td - = link_to project.name_with_namespace, [:admin, project] - %td - %span= @team.human_max_project_access(project) - %td - %tr - %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name_with_namespace), multiple: true, data: {placeholder: 'Select projects'}, class: 'chosen span5' - %td= select_tag :greatest_project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3" } - %td= submit_tag 'Add', class: "btn btn-primary", id: :assign_projects_to_team + %h6 Choose greatest user acces for your team in this projects: + .clearfix + = label_tag :greatest_project_access, "Greatest Access" + .input + = select_tag :greatest_project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3" } + + .form-actions + = submit_tag 'Add team to projects', class: "btn btn-create", id: :assign_projects_to_team diff --git a/features/steps/admin/admin_teams.rb b/features/steps/admin/admin_teams.rb index 65c7e485f..066fc3fa6 100644 --- a/features/steps/admin/admin_teams.rb +++ b/features/steps/admin/admin_teams.rb @@ -85,7 +85,7 @@ class AdminTeams < Spinach::FeatureSteps end Then 'I should see empty projects table' do - page.has_no_css?("#projects_list").must_equal true + page.should have_content "Projects (0)" end When 'I select project "Shop" with max access "Reporter"' do -- 2.11.0