Move team project management to own controller
This commit is contained in:
parent
cca9935970
commit
b7470440ff
8 changed files with 121 additions and 0 deletions
16
app/views/admin/teams/projects/_form.html.haml
Normal file
16
app/views/admin/teams/projects/_form.html.haml
Normal file
|
@ -0,0 +1,16 @@
|
|||
= form_tag admin_team_project_path(@team, @project), method: :put do
|
||||
-if @project.errors.any?
|
||||
.alert-message.block-message.error
|
||||
%ul
|
||||
- @project.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
|
||||
.clearfix
|
||||
%label Max access for Team members:
|
||||
.input
|
||||
= select_tag :greatest_project_access, options_for_select(UserTeam.access_roles, @team.max_project_access(@project)), class: "project-access-select chosen span3"
|
||||
|
||||
%br
|
||||
.actions
|
||||
= submit_tag 'Save', class: "btn primary"
|
||||
= link_to 'Cancel', :back, class: "btn"
|
16
app/views/admin/teams/projects/edit.html.haml
Normal file
16
app/views/admin/teams/projects/edit.html.haml
Normal file
|
@ -0,0 +1,16 @@
|
|||
%h3
|
||||
Edit max access in #{@project.name} for #{@team.name} team
|
||||
|
||||
%hr
|
||||
%table.zebra-striped
|
||||
%tr
|
||||
%td Project:
|
||||
%td= @project.name
|
||||
%tr
|
||||
%td Team:
|
||||
%td= @team.name
|
||||
%tr
|
||||
%td Since:
|
||||
%td= assigned_since(@team, @project).stamp("Nov 11, 2010")
|
||||
|
||||
= render 'form'
|
23
app/views/admin/teams/projects/new.html.haml
Normal file
23
app/views/admin/teams/projects/new.html.haml
Normal file
|
@ -0,0 +1,23 @@
|
|||
%h3.page_title
|
||||
Team: #{@team.name}
|
||||
|
||||
%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 primary", id: :assign_projects_to_team
|
Loading…
Add table
Add a link
Reference in a new issue