Commit 4daf68b57f92bf697a375ebfa4bc2ebc2e3e0312

Authored by Dmitriy Zaporozhets
1 parent 62a9bb5a

Style page for project assign to team. Fix test for admin:teams

app/views/admin/teams/projects/new.html.haml
1 1 %h3.page_title
2 2 Team: #{@team.name}
  3 +%hr
  4 += form_tag admin_team_projects_path(@team), id: "assign_projects", class: "bulk_import", method: :post do
  5 + %h6 Choose Projects you want to assign:
  6 + .clearfix
  7 + = label_tag :project_ids, "Projects"
  8 + .input
  9 + = select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name_with_namespace), multiple: true, data: {placeholder: 'Select projects'}, class: 'chosen span5'
3 10  
4   -%fieldset
5   - %legend Projects (#{@team.projects.count})
6   - = form_tag admin_team_projects_path(@team), id: "assign_projects", class: "bulk_import", method: :post do
7   - %table#projects_list
8   - %thead
9   - %tr
10   - %th Project name
11   - %th Max access
12   - %th
13   - - @team.projects.each do |project|
14   - %tr.project
15   - %td
16   - = link_to project.name_with_namespace, [:admin, project]
17   - %td
18   - %span= @team.human_max_project_access(project)
19   - %td
20   - %tr
21   - %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name_with_namespace), multiple: true, data: {placeholder: 'Select projects'}, class: 'chosen span5'
22   - %td= select_tag :greatest_project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3" }
23   - %td= submit_tag 'Add', class: "btn btn-primary", id: :assign_projects_to_team
  11 + %h6 Choose greatest user acces for your team in this projects:
  12 + .clearfix
  13 + = label_tag :greatest_project_access, "Greatest Access"
  14 + .input
  15 + = select_tag :greatest_project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3" }
  16 +
  17 + .form-actions
  18 + = submit_tag 'Add team to projects', class: "btn btn-create", id: :assign_projects_to_team
... ...
features/steps/admin/admin_teams.rb
... ... @@ -85,7 +85,7 @@ class AdminTeams < Spinach::FeatureSteps
85 85 end
86 86  
87 87 Then 'I should see empty projects table' do
88   - page.has_no_css?("#projects_list").must_equal true
  88 + page.should have_content "Projects (0)"
89 89 end
90 90  
91 91 When 'I select project "Shop" with max access "Reporter"' do
... ...