Skip to content

Commit aa1f1eb

Browse files
committed
Merge pull request gitlabhq#2746 from gitlabhq/features/teams
New feature: Teams
2 parents 097e605 + d839f6c commit aa1f1eb

File tree

115 files changed

+2714
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2714
-174
lines changed

app/assets/javascripts/dashboard.js.coffee

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ window.dashboardPage = ->
44
event.preventDefault()
55
toggleFilter $(this)
66
reloadActivities()
7-
7+
88
reloadActivities = ->
99
$(".content_list").html ''
1010
Pager.init 20, true
11-
11+
1212
toggleFilter = (sender) ->
1313
sender.parent().toggleClass "inactive"
1414
event_filters = $.cookie("event_filter")
@@ -17,11 +17,11 @@ toggleFilter = (sender) ->
1717
event_filters = event_filters.split(",")
1818
else
1919
event_filters = new Array()
20-
20+
2121
index = event_filters.indexOf(filter)
2222
if index is -1
2323
event_filters.push filter
2424
else
2525
event_filters.splice index, 1
26-
26+
2727
$.cookie "event_filter", event_filters.join(",")

app/assets/javascripts/merge_requests.js.coffee

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
#
22
# * Filter merge requests
3-
#
3+
#
44
@merge_requestsPage = ->
55
$('#assignee_id').chosen()
66
$('#milestone_id').chosen()
77
$('#milestone_id, #assignee_id').on 'change', ->
88
$(this).closest('form').submit()
99

1010
class MergeRequest
11-
11+
1212
constructor: (@opts) ->
1313
this.$el = $('.merge-request')
1414
@diffs_loaded = false
1515
@commits_loaded = false
16-
16+
1717
this.activateTab(@opts.action)
18-
18+
1919
this.bindEvents()
20-
20+
2121
this.initMergeWidget()
2222
this.$('.show-all-commits').on 'click', =>
2323
this.showAllCommits()
@@ -28,7 +28,7 @@ class MergeRequest
2828

2929
initMergeWidget: ->
3030
this.showState( @opts.current_state )
31-
31+
3232
if this.$('.automerge_widget').length and @opts.check_enable
3333
$.get @opts.url_to_automerge_check, (data) =>
3434
this.showState( data.state )
@@ -42,12 +42,12 @@ class MergeRequest
4242
bindEvents: ->
4343
this.$('.nav-tabs').on 'click', 'a', (event) =>
4444
a = $(event.currentTarget)
45-
45+
4646
href = a.attr('href')
4747
History.replaceState {path: href}, document.title, href
48-
48+
4949
event.preventDefault()
50-
50+
5151
this.$('.nav-tabs').on 'click', 'li', (event) =>
5252
this.activateTab($(event.currentTarget).data('action'))
5353

app/assets/stylesheets/sections/projects.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
@extend .right;
88

99
.groups_box,
10+
.teams_box,
1011
.projects_box {
1112
> .title {
1213
padding: 2px 15px;

app/controllers/admin_controller.rb renamed to app/controllers/admin/application_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Provides a base class for Admin controllers to subclass
22
#
33
# Automatically sets the layout and ensures an administrator is logged in
4-
class AdminController < ApplicationController
4+
class Admin::ApplicationController < ApplicationController
55
layout 'admin'
66
before_filter :authenticate_admin!
77

app/controllers/admin/dashboard_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Admin::DashboardController < AdminController
1+
class Admin::DashboardController < Admin::ApplicationController
22
def index
33
@projects = Project.order("created_at DESC").limit(10)
44
@users = User.order("created_at DESC").limit(10)

app/controllers/admin/groups_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Admin::GroupsController < AdminController
1+
class Admin::GroupsController < Admin::ApplicationController
22
before_filter :group, only: [:edit, :show, :update, :destroy, :project_update, :project_teams_update]
33

44
def index

app/controllers/admin/hooks_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Admin::HooksController < AdminController
1+
class Admin::HooksController < Admin::ApplicationController
22
def index
33
@hooks = SystemHook.all
44
@hook = SystemHook.new
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
class Admin::LogsController < AdminController
1+
class Admin::LogsController < Admin::ApplicationController
22
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Provides a base class for Admin controllers to subclass
2+
#
3+
# Automatically sets the layout and ensures an administrator is logged in
4+
class Admin::Projects::ApplicationController < Admin::ApplicationController
5+
6+
protected
7+
8+
def project
9+
@project ||= Project.find_by_path(params[:project_id])
10+
end
11+
end
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
class Admin::Projects::MembersController < Admin::Projects::ApplicationController
2+
def edit
3+
@member = team_member
4+
@project = project
5+
@team_member_relation = team_member_relation
6+
end
7+
8+
def update
9+
if team_member_relation.update_attributes(params[:team_member])
10+
redirect_to [:admin, project], notice: 'Project Access was successfully updated.'
11+
else
12+
render action: "edit"
13+
end
14+
end
15+
16+
def destroy
17+
team_member_relation.destroy
18+
19+
redirect_to :back
20+
end
21+
22+
private
23+
24+
def team_member
25+
@member ||= project.users.find(params[:id])
26+
end
27+
28+
def team_member_relation
29+
team_member.users_projects.find_by_project_id(project)
30+
end
31+
32+
end

0 commit comments

Comments
 (0)