Restyle project members page to fit both group and personal projects
This commit is contained in:
parent
7d57b96ee0
commit
ed9cff9a3c
7 changed files with 42 additions and 61 deletions
|
@ -16,6 +16,12 @@
|
|||
color: #888;
|
||||
}
|
||||
|
||||
&.unstyled {
|
||||
&:hover {
|
||||
background: none;
|
||||
}
|
||||
}
|
||||
|
||||
&.smoke { background-color: #f5f5f5; }
|
||||
|
||||
&:hover {
|
||||
|
|
|
@ -34,11 +34,12 @@ class DashboardController < ApplicationController
|
|||
@projects
|
||||
end
|
||||
|
||||
@projects = @projects.tagged_with(params[:label]) if params[:label].present?
|
||||
@projects = @projects.search(params[:search]) if params[:search].present?
|
||||
@projects = @projects.page(params[:page]).per(30)
|
||||
|
||||
@labels = Project.where(id: @projects.map(&:id)).tags_on(:labels)
|
||||
|
||||
@projects = @projects.tagged_with(params[:label]) if params[:label].present?
|
||||
@projects = @projects.page(params[:page]).per(30)
|
||||
end
|
||||
|
||||
# Get authored or assigned open merge requests
|
||||
|
|
|
@ -63,7 +63,7 @@ class GroupsController < ApplicationController
|
|||
|
||||
def people
|
||||
@project = group.projects.find(params[:project_id]) if params[:project_id]
|
||||
@members = group.users_groups
|
||||
@members = group.users_groups.order('group_access DESC')
|
||||
@users_group = UsersGroup.new
|
||||
end
|
||||
|
||||
|
|
|
@ -4,11 +4,8 @@ class TeamMembersController < ProjectResourceController
|
|||
before_filter :authorize_admin_project!, except: [:index, :show]
|
||||
|
||||
def index
|
||||
@team = @project.users_projects.scoped
|
||||
@team = @team.send(params[:type]) if %w(masters developers reporters guests).include?(params[:type])
|
||||
@team = @team.sort_by(&:project_access).reverse.group_by(&:project_access)
|
||||
|
||||
@group = @project.group
|
||||
@users_projects = @project.users_projects.order('project_access DESC')
|
||||
@assigned_teams = @project.user_team_project_relationships
|
||||
end
|
||||
|
||||
|
|
7
app/views/team_members/_group_members.html.haml
Normal file
7
app/views/team_members/_group_members.html.haml
Normal file
|
@ -0,0 +1,7 @@
|
|||
.ui-box
|
||||
%h5.title
|
||||
= link_to people_group_path(@group) do
|
||||
Members of #{@group.name} group
|
||||
%ul.well-list
|
||||
- @group.users_groups.order('group_access DESC').each do |member|
|
||||
= render 'users_groups/users_group', member: member, show_controls: false
|
|
@ -1,10 +1,8 @@
|
|||
.team-table
|
||||
- can_admin_project = (can? current_user, :admin_project, @project)
|
||||
- team.each do |access, members|
|
||||
- role = Project.access_options.key(access).pluralize
|
||||
.ui-box{class: role.downcase}
|
||||
.ui-box
|
||||
%h5.title
|
||||
= role
|
||||
%span.light (#{members.size})
|
||||
Project members (#{members.count})
|
||||
%ul.well-list
|
||||
- members.sort_by(&:user_name).each do |team_member|
|
||||
- members.each do |team_member|
|
||||
= render 'team_members/team_member', member: team_member, current_user_can_admin_project: can_admin_project
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
= render "projects/settings_nav"
|
||||
%h3.page_title
|
||||
Project Members
|
||||
(#{@project.users.count})
|
||||
%small
|
||||
Read more about project permissions
|
||||
%strong= link_to "here", help_permissions_path, class: "vlink"
|
||||
Users with access to this project
|
||||
|
||||
- if can? current_user, :admin_team_member, @project
|
||||
%span.pull-right
|
||||
|
@ -15,32 +11,23 @@
|
|||
= link_to new_project_team_member_path(@project), class: "btn btn-primary small grouped", title: "New Team Member" do
|
||||
New Team Member
|
||||
|
||||
%hr
|
||||
%p.light
|
||||
Read more about project permissions
|
||||
%strong= link_to "here", help_permissions_path, class: "vlink"
|
||||
|
||||
|
||||
|
||||
.clearfix
|
||||
|
||||
- if @group
|
||||
.row
|
||||
.span3
|
||||
%ul.nav.nav-pills.nav-stacked
|
||||
%li{class: ("active" if !params[:type])}
|
||||
= link_to project_team_index_path(type: nil) do
|
||||
All
|
||||
%li{class: ("active" if params[:type] == 'masters')}
|
||||
= link_to project_team_index_path(type: 'masters') do
|
||||
Masters
|
||||
%span.pull-right= @project.users_projects.masters.count
|
||||
%li{class: ("active" if params[:type] == 'developers')}
|
||||
= link_to project_team_index_path(type: 'developers') do
|
||||
Developers
|
||||
%span.pull-right= @project.users_projects.developers.count
|
||||
%li{class: ("active" if params[:type] == 'reporters')}
|
||||
= link_to project_team_index_path(type: 'reporters') do
|
||||
Reporters
|
||||
%span.pull-right= @project.users_projects.reporters.count
|
||||
%li{class: ("active" if params[:type] == 'guests')}
|
||||
= link_to project_team_index_path(type: 'guests') do
|
||||
Guests
|
||||
%span.pull-right= @project.users_projects.guests.count
|
||||
.span6
|
||||
= render "team_members/group_members"
|
||||
.span6
|
||||
= render "team_members/team", members: @users_projects
|
||||
|
||||
- else
|
||||
= render "team_members/team", members: @users_projects
|
||||
|
||||
- if @assigned_teams.present?
|
||||
%h5
|
||||
|
@ -48,18 +35,3 @@
|
|||
(#{@project.user_teams.count})
|
||||
%div
|
||||
= render "team_members/assigned_teams", assigned_teams: @assigned_teams
|
||||
|
||||
.span9
|
||||
- if @group
|
||||
.ui-box
|
||||
%h5.title
|
||||
= link_to people_group_path(@group) do
|
||||
Members of #{@group.name} group
|
||||
%ul.well-list
|
||||
- @group.users_groups.each do |member|
|
||||
= render 'users_groups/users_group', member: member, show_controls: false
|
||||
%div.team-table
|
||||
= render "team_members/team", team: @team
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue