summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-19 19:48:48 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-19 19:48:48 +0300
commitb3ef63a0a547610ba8ac6435674eabc5a2130c3d (patch)
treeb90c2d38c8ea93941fd0067e89a0e03f60b00c9c /app
parentcf8b465cb96f5aa6e53fec60c0d6e62ad1ccbc5e (diff)
downloadgitlab-ce-b3ef63a0a547610ba8ac6435674eabc5a2130c3d.tar.gz
Migrate global project taks. Removed more teams related functionality
Diffstat (limited to 'app')
-rw-r--r--app/controllers/application_controller.rb8
-rw-r--r--app/helpers/admin/teams/members_helper.rb5
-rw-r--r--app/helpers/admin/teams/projects_helper.rb5
-rw-r--r--app/helpers/namespaces_helper.rb1
-rw-r--r--app/models/concerns/issuable.rb1
-rw-r--r--app/models/project.rb6
-rw-r--r--app/views/dashboard/_teams.html.haml23
-rw-r--r--app/views/layouts/nav/_team.html.haml25
-rw-r--r--app/views/team_members/_assigned_team.html.haml10
-rw-r--r--app/views/team_members/_assigned_teams.html.haml4
-rw-r--r--app/views/team_members/index.html.haml7
11 files changed, 0 insertions, 95 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index fda05feefc0..e84220c1e57 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -95,14 +95,6 @@ class ApplicationController < ActionController::Base
return access_denied! unless can?(current_user, :create_team, nil)
end
- def authorize_manage_user_team!
- return access_denied! unless user_team.present? && can?(current_user, :manage_user_team, user_team)
- end
-
- def authorize_admin_user_team!
- return access_denied! unless user_team.present? && can?(current_user, :admin_user_team, user_team)
- end
-
def access_denied!
render "errors/access_denied", layout: "errors", status: 404
end
diff --git a/app/helpers/admin/teams/members_helper.rb b/app/helpers/admin/teams/members_helper.rb
deleted file mode 100644
index 58b9f1896c4..00000000000
--- a/app/helpers/admin/teams/members_helper.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module Admin::Teams::MembersHelper
- def member_since(team, member)
- team.user_team_user_relationships.find_by_user_id(member).created_at
- end
-end
diff --git a/app/helpers/admin/teams/projects_helper.rb b/app/helpers/admin/teams/projects_helper.rb
deleted file mode 100644
index b97cc403337..00000000000
--- a/app/helpers/admin/teams/projects_helper.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-module Admin::Teams::ProjectsHelper
- def assigned_since(team, project)
- team.user_team_project_relationships.find_by_project_id(project).created_at
- end
-end
diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb
index a6fcf8d8cf2..dc88e178360 100644
--- a/app/helpers/namespaces_helper.rb
+++ b/app/helpers/namespaces_helper.rb
@@ -7,7 +7,6 @@ module NamespacesHelper
users_opts = [ "Users", users.sort_by(&:human_name).map {|u| [u.human_name, u.id]} ]
options = []
- options << global_opts if current_user.admin
options << group_opts
options << users_opts
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb
index 11e3d8eed19..cb238c15ed8 100644
--- a/app/models/concerns/issuable.rb
+++ b/app/models/concerns/issuable.rb
@@ -21,7 +21,6 @@ module Issuable
scope :opened, -> { with_state(:opened) }
scope :closed, -> { with_state(:closed) }
scope :of_group, ->(group) { where(project_id: group.project_ids) }
- scope :of_user_team, ->(team) { where(project_id: team.project_ids, assignee_id: team.member_ids) }
scope :assigned_to, ->(u) { where(assignee_id: u.id)}
scope :recent, -> { order("created_at DESC") }
scope :assigned, -> { where("assignee_id IS NOT NULL") }
diff --git a/app/models/project.rb b/app/models/project.rb
index ff61eca60de..5045cb21303 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -61,12 +61,6 @@ class Project < ActiveRecord::Base
has_many :snippets, dependent: :destroy, class_name: "ProjectSnippet"
has_many :hooks, dependent: :destroy, class_name: "ProjectHook"
has_many :protected_branches, dependent: :destroy
- has_many :user_team_project_relationships, dependent: :destroy
-
- has_many :users, through: :users_projects
- has_many :user_teams, through: :user_team_project_relationships
- has_many :user_team_user_relationships, through: :user_teams
- has_many :user_teams_members, through: :user_team_user_relationships
has_many :deploy_keys_projects, dependent: :destroy
has_many :deploy_keys, through: :deploy_keys_projects
diff --git a/app/views/dashboard/_teams.html.haml b/app/views/dashboard/_teams.html.haml
deleted file mode 100644
index 95d87f508e0..00000000000
--- a/app/views/dashboard/_teams.html.haml
+++ /dev/null
@@ -1,23 +0,0 @@
-.ui-box.teams-box
- %h5.title
- Teams
- %span.light
- (#{teams.count})
- %span.pull-right
- = link_to new_team_path, class: "btn btn-small" do
- %i.icon-plus
- New Team
- %ul.well-list
- - teams.each do |team|
- %li
- = link_to team_path(id: team.path), class: dom_class(team) do
- %strong.well-title= truncate(team.name, length: 35)
- %span.pull-right.light
- - if team.owner == current_user
- %i.icon-wrench
- - tm = current_user.user_team_user_relationships.find_by_user_team_id(team.id)
- - if tm
- = tm.access_human
- - if teams.blank?
- %li
- %h3.nothing_here_message You have no teams yet.
diff --git a/app/views/layouts/nav/_team.html.haml b/app/views/layouts/nav/_team.html.haml
deleted file mode 100644
index 575c5b7e1f3..00000000000
--- a/app/views/layouts/nav/_team.html.haml
+++ /dev/null
@@ -1,25 +0,0 @@
-%ul
- = nav_link(path: 'teams#show', html_options: {class: 'home'}) do
- = link_to team_path(@team), title: "Home" do
- %i.icon-home
-
- = nav_link(path: 'teams#issues') do
- = link_to issues_team_path(@team) do
- Issues
- %span.count= Issue.opened.of_user_team(@team).count
-
- = nav_link(path: 'teams#merge_requests') do
- = link_to merge_requests_team_path(@team) do
- Merge Requests
- %span.count= MergeRequest.opened.of_user_team(@team).count
-
- = nav_link(controller: [:members]) do
- = link_to team_members_path(@team), class: "team-tab tab" do
- Members
- %span.count= @team.members.count
-
- - if can? current_user, :manage_user_team, @team
- = nav_link(path: 'teams#edit') do
- = link_to edit_team_path(@team), class: "stat-tab tab " do
- Settings
-
diff --git a/app/views/team_members/_assigned_team.html.haml b/app/views/team_members/_assigned_team.html.haml
deleted file mode 100644
index 51a31a6456d..00000000000
--- a/app/views/team_members/_assigned_team.html.haml
+++ /dev/null
@@ -1,10 +0,0 @@
-%li{id: dom_id(team), class: "user_team_row team_#{team.id}"}
- .pull-right
- - if can?(current_user, :admin_team_member, @project)
- = link_to resign_project_team_path(@project, team), method: :delete, confirm: "Are you sure?", class: "btn btn-remove btn-tiny" do
- %i.icon-minus.icon-white
-
- %strong= link_to team.name, team_path(team), title: team.name, class: "dark"
- %br
- %small.cgray Members: #{team.members.count}
- %small.cgray Max access: #{team_relation.human_max_access}
diff --git a/app/views/team_members/_assigned_teams.html.haml b/app/views/team_members/_assigned_teams.html.haml
deleted file mode 100644
index 91c6d8f7157..00000000000
--- a/app/views/team_members/_assigned_teams.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-.ui-box
- %ul.well-list
- - assigned_teams.sort_by(&:team_name).each do |team_relation|
- = render "team_members/assigned_team", team_relation: team_relation, team: team_relation.user_team
diff --git a/app/views/team_members/index.html.haml b/app/views/team_members/index.html.haml
index 781cb36a583..146e5c02f95 100644
--- a/app/views/team_members/index.html.haml
+++ b/app/views/team_members/index.html.haml
@@ -24,10 +24,3 @@
- else
= render "team_members/team", members: @users_projects
-
-- if @assigned_teams.present?
- %h5
- Assigned teams
- (#{@project.user_teams.count})
- %div
- = render "team_members/assigned_teams", assigned_teams: @assigned_teams