Add teams into Public sections
This commit is contained in:
parent
82499a4cbf
commit
695becc4cb
14 changed files with 706 additions and 0 deletions
33
app/views/teams/_filter.html.haml
Normal file
33
app/views/teams/_filter.html.haml
Normal file
|
@ -0,0 +1,33 @@
|
|||
= form_tag team_filter_path(entity), method: 'get' do
|
||||
%fieldset.dashboard-search-filter
|
||||
= search_field_tag "search", params[:search], { placeholder: 'Search', class: 'search-text-input' }
|
||||
= button_tag type: 'submit', class: 'btn' do
|
||||
%i.icon-search
|
||||
|
||||
%fieldset
|
||||
%legend Status:
|
||||
%ul.nav.nav-pills.nav-stacked
|
||||
%li{class: ("active" if !params[:status])}
|
||||
= link_to team_filter_path(entity, status: nil) do
|
||||
Open
|
||||
%li{class: ("active" if params[:status] == 'closed')}
|
||||
= link_to team_filter_path(entity, status: 'closed') do
|
||||
Closed
|
||||
%li{class: ("active" if params[:status] == 'all')}
|
||||
= link_to team_filter_path(entity, status: 'all') do
|
||||
All
|
||||
|
||||
%fieldset
|
||||
%legend Projects:
|
||||
%ul.nav.nav-pills.nav-stacked
|
||||
- @projects.each do |project|
|
||||
- unless entities_per_project(project, entity).zero?
|
||||
%li{class: ("active" if params[:project_id] == project.id.to_s)}
|
||||
= link_to team_filter_path(entity, project_id: project.id) do
|
||||
= project.name_with_namespace
|
||||
%small.right= entities_per_project(project, entity)
|
||||
|
||||
%fieldset
|
||||
%hr
|
||||
= link_to "Reset", team_filter_path(entity), class: 'btn right'
|
||||
|
22
app/views/teams/_projects.html.haml
Normal file
22
app/views/teams/_projects.html.haml
Normal file
|
@ -0,0 +1,22 @@
|
|||
.projects_box
|
||||
%h5.title
|
||||
Projects
|
||||
%small
|
||||
(#{projects.count})
|
||||
- if can? current_user, :manage_group, @group
|
||||
%span.right
|
||||
= link_to new_project_path(namespace_id: @group.id), class: "btn very_small info" do
|
||||
%i.icon-plus
|
||||
New Project
|
||||
%ul.well-list
|
||||
- if projects.blank?
|
||||
%p.nothing_here_message This groups has no projects yet
|
||||
- projects.each do |project|
|
||||
%li
|
||||
= link_to project_path(project), class: dom_class(project) do
|
||||
%strong.well-title= truncate(project.name, length: 25)
|
||||
%span.arrow
|
||||
→
|
||||
%span.last_activity
|
||||
%strong Last activity:
|
||||
%span= project_last_activity(project)
|
19
app/views/teams/_team_head.html.haml
Normal file
19
app/views/teams/_team_head.html.haml
Normal file
|
@ -0,0 +1,19 @@
|
|||
%ul.nav.nav-tabs
|
||||
= nav_link(path: 'teams#show') do
|
||||
= link_to team_path(@user_team), class: "activities-tab tab" do
|
||||
%i.icon-home
|
||||
Show
|
||||
= nav_link(controller: [:members]) do
|
||||
= link_to team_members_path(@user_team), class: "team-tab tab" do
|
||||
%i.icon-user
|
||||
Members
|
||||
= nav_link(controller: [:projects]) do
|
||||
= link_to team_projects_path(@user_team), class: "team-tab tab" do
|
||||
%i.icon-briefcase
|
||||
Projects
|
||||
|
||||
- if can? current_user, :manage_user_team, @user_team
|
||||
= nav_link(path: 'teams#edit', html_options: {class: 'right'}) do
|
||||
= link_to edit_team_path(@user_team), class: "stat-tab tab " do
|
||||
%i.icon-edit
|
||||
Edit
|
32
app/views/teams/edit.html.haml
Normal file
32
app/views/teams/edit.html.haml
Normal file
|
@ -0,0 +1,32 @@
|
|||
= render "team_head"
|
||||
|
||||
%h3.page_title= "Edit Team #{@user_team.name}"
|
||||
%hr
|
||||
= form_for @user_team, url: teams_path do |f|
|
||||
- if @user_team.errors.any?
|
||||
.alert-message.block-message.error
|
||||
%span= @user_team.errors.full_messages.first
|
||||
.clearfix
|
||||
= f.label :name do
|
||||
Team name is
|
||||
.input
|
||||
= f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left"
|
||||
|
||||
.clearfix
|
||||
= f.label :path do
|
||||
Team path is
|
||||
.input
|
||||
= f.text_field :path, placeholder: "opensource", class: "xxlarge left"
|
||||
.clearfix
|
||||
.input.span3.center
|
||||
= f.submit 'Save team changes', class: "btn primary"
|
||||
.input.span3.center
|
||||
= link_to 'Delete team', team_path(@user_team), method: :delete, confirm: "You are shure?", class: "btn danger"
|
||||
%hr
|
||||
.padded
|
||||
%ul
|
||||
%li Team is kind of directory for several projects
|
||||
%li All created teams are private
|
||||
%li People within a team see only projects they have access to
|
||||
%li All projects of team will be stored in team directory
|
||||
%li You will be able to move existing projects into team
|
37
app/views/teams/index.html.haml
Normal file
37
app/views/teams/index.html.haml
Normal file
|
@ -0,0 +1,37 @@
|
|||
%h3.page_title
|
||||
Teams
|
||||
%small
|
||||
list of all teams
|
||||
|
||||
= link_to 'New Team', new_team_path, class: "btn small right"
|
||||
%br
|
||||
|
||||
= form_tag search_teams_path, method: :get, class: 'form-inline' do
|
||||
= text_field_tag :name, params[:name], class: "xlarge"
|
||||
= submit_tag "Search", class: "btn submit primary"
|
||||
|
||||
%table.teams_list
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
Name
|
||||
%i.icon-sort-down
|
||||
%th Path
|
||||
%th Projects
|
||||
%th Members
|
||||
%th Owner
|
||||
%th
|
||||
|
||||
- @teams.each do |team|
|
||||
%tr
|
||||
%td
|
||||
%strong= link_to team.name, team_path(team)
|
||||
%td= team.path
|
||||
%td= link_to team.projects.count, team_projects_path(team)
|
||||
%td= link_to team.members.count, team_members_path(team)
|
||||
%td= link_to team.owner.name, team_member_path(team, team.owner)
|
||||
%td
|
||||
- if current_user.can?(:manage_user_team, team)
|
||||
- if team.owner == current_user
|
||||
= link_to "Destroy", team_path(team), method: :delete, confirm: "You are shure?", class: "danger btn small right"
|
||||
= link_to "Edit", edit_team_path(team), class: "btn small right"
|
25
app/views/teams/issues.html.haml
Normal file
25
app/views/teams/issues.html.haml
Normal file
|
@ -0,0 +1,25 @@
|
|||
= render "team_head"
|
||||
|
||||
%h3.page_title
|
||||
Issues
|
||||
%small (in Team projects assigned to Team members)
|
||||
%small.right #{@issues.total_count} issues
|
||||
|
||||
%hr
|
||||
.row
|
||||
.span3
|
||||
= render 'filter', entity: 'issue'
|
||||
.span9
|
||||
- if @issues.any?
|
||||
- @issues.group_by(&:project).each do |group|
|
||||
%div.ui-box
|
||||
- @project = group[0]
|
||||
%h5.title
|
||||
= link_to_project @project
|
||||
%ul.well-list.issues_table
|
||||
- group[1].each do |issue|
|
||||
= render(partial: 'issues/show', locals: {issue: issue})
|
||||
%hr
|
||||
= paginate @issues, theme: "gitlab"
|
||||
- else
|
||||
%p.nothing_here_message Nothing to show here
|
24
app/views/teams/merge_requests.html.haml
Normal file
24
app/views/teams/merge_requests.html.haml
Normal file
|
@ -0,0 +1,24 @@
|
|||
%h3.page_title
|
||||
Merge Requests
|
||||
%small (authored by or assigned to Team members)
|
||||
%small.right #{@merge_requests.total_count} merge requests
|
||||
|
||||
%hr
|
||||
.row
|
||||
.span3
|
||||
= render 'filter', entity: 'merge_request'
|
||||
.span9
|
||||
- if @merge_requests.any?
|
||||
- @merge_requests.group_by(&:project).each do |group|
|
||||
.ui-box
|
||||
- @project = group[0]
|
||||
%h5.title
|
||||
= link_to_project @project
|
||||
%ul.well-list
|
||||
- group[1].each do |merge_request|
|
||||
= render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request})
|
||||
%hr
|
||||
= paginate @merge_requests, theme: "gitlab"
|
||||
|
||||
- else
|
||||
%h3.nothing_here_message Nothing to show here
|
21
app/views/teams/new.html.haml
Normal file
21
app/views/teams/new.html.haml
Normal file
|
@ -0,0 +1,21 @@
|
|||
%h3.page_title New Team
|
||||
%hr
|
||||
= form_for @team, url: teams_path do |f|
|
||||
- if @team.errors.any?
|
||||
.alert-message.block-message.error
|
||||
%span= @team.errors.full_messages.first
|
||||
.clearfix
|
||||
= f.label :name do
|
||||
Team name is
|
||||
.input
|
||||
= f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left"
|
||||
|
||||
= f.submit 'Create team', class: "btn primary"
|
||||
%hr
|
||||
.padded
|
||||
%ul
|
||||
%li Team is kind of directory for several projects
|
||||
%li All created teams are private
|
||||
%li People within a team see only projects they have access to
|
||||
%li All projects of team will be stored in team directory
|
||||
%li You will be able to move existing projects into team
|
11
app/views/teams/search.html.haml
Normal file
11
app/views/teams/search.html.haml
Normal file
|
@ -0,0 +1,11 @@
|
|||
= render "team_head"
|
||||
|
||||
= form_tag search_team_path(@user_team), method: :get, class: 'form-inline' do |f|
|
||||
.padded
|
||||
= label_tag :search do
|
||||
%strong Looking for
|
||||
.input
|
||||
= search_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge search-text-input", id: "dashboard_search"
|
||||
= submit_tag 'Search', class: "btn primary wide"
|
||||
- if params[:search].present?
|
||||
= render 'search/result'
|
30
app/views/teams/show.html.haml
Normal file
30
app/views/teams/show.html.haml
Normal file
|
@ -0,0 +1,30 @@
|
|||
= render "team_head"
|
||||
|
||||
.projects
|
||||
.activities.span8
|
||||
= link_to dashboard_path, class: 'btn very_small' do
|
||||
← To dashboard
|
||||
|
||||
%span.cgray Events and projects are filtered in scope of team
|
||||
%hr
|
||||
- if @events.any?
|
||||
.content_list
|
||||
- else
|
||||
%p.nothing_here_message Projects activity will be displayed here
|
||||
.loading.hide
|
||||
.side.span4
|
||||
= render "projects", projects: @projects
|
||||
%div
|
||||
%span.rss-icon
|
||||
= link_to dashboard_path(:atom, { private_token: current_user.private_token }) do
|
||||
= image_tag "rss_ui.png", title: "feed"
|
||||
%strong News Feed
|
||||
|
||||
%hr
|
||||
.gitlab-promo
|
||||
= link_to "Homepage", "http://gitlabhq.com"
|
||||
= link_to "Blog", "http://blog.gitlabhq.com"
|
||||
= link_to "@gitlabhq", "https://twitter.com/gitlabhq"
|
||||
|
||||
:javascript
|
||||
$(function(){ Pager.init(20, true); });
|
Loading…
Add table
Add a link
Reference in a new issue