assign team to project from project page in public section
This commit is contained in:
parent
18bd1c9d30
commit
31d84d71d3
12 changed files with 129 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
|||
= link_to project_path(@project), class: "activities-tab tab" do
|
||||
%i.icon-home
|
||||
Show
|
||||
= nav_link(controller: :team_members) do
|
||||
= nav_link(controller: [:team_members, :teams]) do
|
||||
= link_to project_team_index_path(@project), class: "team-tab tab" do
|
||||
%i.icon-user
|
||||
Team
|
||||
|
|
22
app/views/projects/teams/avaliable.html.haml
Normal file
22
app/views/projects/teams/avaliable.html.haml
Normal file
|
@ -0,0 +1,22 @@
|
|||
= render "projects/project_head"
|
||||
|
||||
%h3.page_title
|
||||
= "Assign project to team of users"
|
||||
%hr
|
||||
%p.slead
|
||||
Read more about assign to team of users #{link_to "here", '#', class: 'vlink'}.
|
||||
= form_tag assign_project_teams_path(@project), method: 'post' do
|
||||
%p.slead Choose Team of users you want to assign:
|
||||
.padded
|
||||
= label_tag :team_id, "Team"
|
||||
.input= select_tag(:team_id, options_from_collection_for_select(@teams, :id, :name), prompt: "Select team", class: "chosen xxlarge", required: true)
|
||||
%p.slead Choose greatest user acces in team you want to assign:
|
||||
.padded
|
||||
= label_tag :team_ids, "Permission"
|
||||
.input= select_tag :greatest_project_access, options_for_select(UserTeam.access_roles), {class: "project-access-select chosen span3" }
|
||||
|
||||
|
||||
.actions
|
||||
= submit_tag 'Assign', class: "btn save-btn"
|
||||
= link_to "Cancel", project_team_index_path(@project), class: "btn cancel-btn"
|
||||
|
15
app/views/team_members/_show_team.html.haml
Normal file
15
app/views/team_members/_show_team.html.haml
Normal file
|
@ -0,0 +1,15 @@
|
|||
- team = team_rel.user_team
|
||||
- allow_admin = can? current_user, :admin_team_member, @project
|
||||
%li{id: dom_id(team), class: "user_team_row team_#{team.id}"}
|
||||
.row
|
||||
.span6
|
||||
%strong= link_to team.name, team_path(team), title: team.name, class: "dark"
|
||||
%br
|
||||
%small.cgray Members: #{team.members.count}
|
||||
|
||||
.span5.right
|
||||
.right
|
||||
- if allow_admin
|
||||
.left
|
||||
= link_to resign_project_team_path(@project, team), method: :delete, confirm: "Are you shure?", class: "btn danger small" do
|
||||
%i.icon-minus.icon-white
|
16
app/views/team_members/_teams.html.haml
Normal file
16
app/views/team_members/_teams.html.haml
Normal file
|
@ -0,0 +1,16 @@
|
|||
- grouper_project_teams(@project).each do |access, teams|
|
||||
.ui-box
|
||||
%h5.title
|
||||
= UserTeam.access_roles.key(access).pluralize
|
||||
%small= teams.size
|
||||
%ul.well-list
|
||||
- teams.sort_by(&:team_name).each do |tofr|
|
||||
= render(partial: 'team_members/show_team', locals: {team_rel: tofr})
|
||||
|
||||
|
||||
:javascript
|
||||
$(function(){
|
||||
$('.repo-access-select, .project-access-select').live("change", function() {
|
||||
$(this.form).submit();
|
||||
});
|
||||
})
|
|
@ -4,7 +4,7 @@
|
|||
= "Import team from another project"
|
||||
%hr
|
||||
%p.slead
|
||||
Read more about team import #{link_to "here", '#', class: 'vlink'}.
|
||||
Read more about project team import #{link_to "here", '#', class: 'vlink'}.
|
||||
= form_tag apply_import_project_team_members_path(@project), method: 'post' do
|
||||
%p.slead Choose project you want to use as team source:
|
||||
.padded
|
||||
|
|
|
@ -10,11 +10,24 @@
|
|||
%span.right
|
||||
= link_to import_project_team_members_path(@project), class: "btn small grouped", title: "Import team from another project" do
|
||||
Import team from another project
|
||||
= link_to avaliable_project_teams_path(@project), class: "btn small grouped", title: "Assign project to team of users" do
|
||||
Assign project to Team of users
|
||||
= link_to new_project_team_member_path(@project), class: "btn success small grouped", title: "New Team Member" do
|
||||
New Team Member
|
||||
%hr
|
||||
|
||||
%hr
|
||||
|
||||
.clearfix
|
||||
%div.team-table
|
||||
= render partial: "team_members/team", locals: {project: @project}
|
||||
|
||||
|
||||
%h3.page_title
|
||||
Assigned teams
|
||||
(#{@project.user_teams.count})
|
||||
|
||||
%hr
|
||||
|
||||
.clearfix
|
||||
%div.team-table
|
||||
= render partial: "team_members/teams", locals: {project: @project}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue