Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
ec02cdf2
Commit
ec02cdf2
authored
Mar 12, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into mr-filter-by-title
Conflicts: app/controllers/projects/merge_requests_controller.rb
parents
80b2f3fb
fdfa79a7
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
95 additions
and
64 deletions
+95
-64
CHANGELOG
CHANGELOG
+1
-0
app/controllers/admin/groups_controller.rb
app/controllers/admin/groups_controller.rb
+3
-3
app/controllers/admin/projects_controller.rb
app/controllers/admin/projects_controller.rb
+3
-3
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+2
-0
app/controllers/dashboard/groups_controller.rb
app/controllers/dashboard/groups_controller.rb
+1
-1
app/controllers/dashboard/milestones_controller.rb
app/controllers/dashboard/milestones_controller.rb
+1
-1
app/controllers/dashboard_controller.rb
app/controllers/dashboard_controller.rb
+2
-2
app/controllers/explore/groups_controller.rb
app/controllers/explore/groups_controller.rb
+1
-1
app/controllers/explore/projects_controller.rb
app/controllers/explore/projects_controller.rb
+3
-3
app/controllers/groups/milestones_controller.rb
app/controllers/groups/milestones_controller.rb
+1
-1
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+2
-2
app/controllers/profiles_controller.rb
app/controllers/profiles_controller.rb
+1
-1
app/controllers/projects/branches_controller.rb
app/controllers/projects/branches_controller.rb
+1
-1
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-1
app/controllers/projects/labels_controller.rb
app/controllers/projects/labels_controller.rb
+1
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-1
app/controllers/projects/milestones_controller.rb
app/controllers/projects/milestones_controller.rb
+1
-1
app/controllers/projects/tags_controller.rb
app/controllers/projects/tags_controller.rb
+1
-1
app/controllers/projects/wikis_controller.rb
app/controllers/projects/wikis_controller.rb
+1
-1
app/controllers/snippets_controller.rb
app/controllers/snippets_controller.rb
+2
-2
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+0
-9
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+12
-0
app/helpers/namespaces_helper.rb
app/helpers/namespaces_helper.rb
+1
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+10
-0
app/views/admin/groups/show.html.haml
app/views/admin/groups/show.html.haml
+1
-1
app/views/dashboard/groups/index.html.haml
app/views/dashboard/groups/index.html.haml
+1
-1
app/views/groups/edit.html.haml
app/views/groups/edit.html.haml
+1
-1
app/views/groups/show.html.haml
app/views/groups/show.html.haml
+1
-1
app/views/projects/services/_form.html.haml
app/views/projects/services/_form.html.haml
+2
-2
app/views/users/_groups.html.haml
app/views/users/_groups.html.haml
+1
-1
lib/gitlab/ldap/access.rb
lib/gitlab/ldap/access.rb
+8
-1
spec/helpers/application_helper_spec.rb
spec/helpers/application_helper_spec.rb
+0
-18
spec/helpers/groups_helper.rb
spec/helpers/groups_helper.rb
+21
-0
spec/lib/gitlab/ldap/access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+6
-1
No files found.
CHANGELOG
View file @
ec02cdf2
...
@@ -60,6 +60,7 @@ v 7.9.0 (unreleased)
...
@@ -60,6 +60,7 @@ v 7.9.0 (unreleased)
- Remove annoying notice messages when create/update merge request
- Remove annoying notice messages when create/update merge request
- Allow smb:// links in Markdown text.
- Allow smb:// links in Markdown text.
- Filter merge request by title or description at Merge Requests page
- Filter merge request by title or description at Merge Requests page
- Block user if he/she was blocked in Active Directory
v 7.8.4
v 7.8.4
- Fix issue_tracker_id substitution in custom issue trackers
- Fix issue_tracker_id substitution in custom issue trackers
...
...
app/controllers/admin/groups_controller.rb
View file @
ec02cdf2
...
@@ -5,12 +5,12 @@ class Admin::GroupsController < Admin::ApplicationController
...
@@ -5,12 +5,12 @@ class Admin::GroupsController < Admin::ApplicationController
@groups
=
Group
.
all
@groups
=
Group
.
all
@groups
=
@groups
.
sort
(
@sort
=
params
[
:sort
])
@groups
=
@groups
.
sort
(
@sort
=
params
[
:sort
])
@groups
=
@groups
.
search
(
params
[
:name
])
if
params
[
:name
].
present?
@groups
=
@groups
.
search
(
params
[
:name
])
if
params
[
:name
].
present?
@groups
=
@groups
.
page
(
params
[
:page
]).
per
(
20
)
@groups
=
@groups
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
show
def
show
@members
=
@group
.
members
.
order
(
"access_level DESC"
).
page
(
params
[
:members_page
]).
per
(
30
)
@members
=
@group
.
members
.
order
(
"access_level DESC"
).
page
(
params
[
:members_page
]).
per
(
PER_PAGE
)
@projects
=
@group
.
projects
.
page
(
params
[
:projects_page
]).
per
(
30
)
@projects
=
@group
.
projects
.
page
(
params
[
:projects_page
]).
per
(
PER_PAGE
)
end
end
def
new
def
new
...
...
app/controllers/admin/projects_controller.rb
View file @
ec02cdf2
...
@@ -11,15 +11,15 @@ class Admin::ProjectsController < Admin::ApplicationController
...
@@ -11,15 +11,15 @@ class Admin::ProjectsController < Admin::ApplicationController
@projects
=
@projects
.
abandoned
if
params
[
:abandoned
].
present?
@projects
=
@projects
.
abandoned
if
params
[
:abandoned
].
present?
@projects
=
@projects
.
search
(
params
[
:name
])
if
params
[
:name
].
present?
@projects
=
@projects
.
search
(
params
[
:name
])
if
params
[
:name
].
present?
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
includes
(
:namespace
).
order
(
"namespaces.path, projects.name ASC"
).
page
(
params
[
:page
]).
per
(
20
)
@projects
=
@projects
.
includes
(
:namespace
).
order
(
"namespaces.path, projects.name ASC"
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
show
def
show
if
@group
if
@group
@group_members
=
@group
.
members
.
order
(
"access_level DESC"
).
page
(
params
[
:group_members_page
]).
per
(
30
)
@group_members
=
@group
.
members
.
order
(
"access_level DESC"
).
page
(
params
[
:group_members_page
]).
per
(
PER_PAGE
)
end
end
@project_members
=
@project
.
project_members
.
page
(
params
[
:project_members_page
]).
per
(
30
)
@project_members
=
@project
.
project_members
.
page
(
params
[
:project_members_page
]).
per
(
PER_PAGE
)
end
end
def
transfer
def
transfer
...
...
app/controllers/application_controller.rb
View file @
ec02cdf2
...
@@ -4,6 +4,8 @@ class ApplicationController < ActionController::Base
...
@@ -4,6 +4,8 @@ class ApplicationController < ActionController::Base
include
Gitlab
::
CurrentSettings
include
Gitlab
::
CurrentSettings
include
GitlabRoutingHelper
include
GitlabRoutingHelper
PER_PAGE
=
20
before_filter
:authenticate_user_from_token!
before_filter
:authenticate_user_from_token!
before_filter
:authenticate_user!
before_filter
:authenticate_user!
before_filter
:reject_blocked!
before_filter
:reject_blocked!
...
...
app/controllers/dashboard/groups_controller.rb
View file @
ec02cdf2
class
Dashboard::GroupsController
<
ApplicationController
class
Dashboard::GroupsController
<
ApplicationController
def
index
def
index
@user_groups
=
current_user
.
group_members
.
page
(
params
[
:page
]).
per
(
20
)
@user_groups
=
current_user
.
group_members
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
leave
def
leave
...
...
app/controllers/dashboard/milestones_controller.rb
View file @
ec02cdf2
...
@@ -8,7 +8,7 @@ class Dashboard::MilestonesController < ApplicationController
...
@@ -8,7 +8,7 @@ class Dashboard::MilestonesController < ApplicationController
else
state
(
'active'
)
else
state
(
'active'
)
end
end
@dashboard_milestones
=
Milestones
::
GroupService
.
new
(
project_milestones
).
execute
@dashboard_milestones
=
Milestones
::
GroupService
.
new
(
project_milestones
).
execute
@dashboard_milestones
=
Kaminari
.
paginate_array
(
@dashboard_milestones
).
page
(
params
[
:page
]).
per
(
30
)
@dashboard_milestones
=
Kaminari
.
paginate_array
(
@dashboard_milestones
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
show
def
show
...
...
app/controllers/dashboard_controller.rb
View file @
ec02cdf2
...
@@ -25,13 +25,13 @@ class DashboardController < ApplicationController
...
@@ -25,13 +25,13 @@ class DashboardController < ApplicationController
def
merge_requests
def
merge_requests
@merge_requests
=
get_merge_requests_collection
@merge_requests
=
get_merge_requests_collection
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
20
)
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@merge_requests
=
@merge_requests
.
preload
(
:author
,
:target_project
)
@merge_requests
=
@merge_requests
.
preload
(
:author
,
:target_project
)
end
end
def
issues
def
issues
@issues
=
get_issues_collection
@issues
=
get_issues_collection
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
20
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@issues
=
@issues
.
preload
(
:author
,
:project
)
@issues
=
@issues
.
preload
(
:author
,
:project
)
respond_to
do
|
format
|
respond_to
do
|
format
|
...
...
app/controllers/explore/groups_controller.rb
View file @
ec02cdf2
...
@@ -8,6 +8,6 @@ class Explore::GroupsController < ApplicationController
...
@@ -8,6 +8,6 @@ class Explore::GroupsController < ApplicationController
@groups
=
GroupsFinder
.
new
.
execute
(
current_user
)
@groups
=
GroupsFinder
.
new
.
execute
(
current_user
)
@groups
=
@groups
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@groups
=
@groups
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@groups
=
@groups
.
sort
(
@sort
=
params
[
:sort
])
@groups
=
@groups
.
sort
(
@sort
=
params
[
:sort
])
@groups
=
@groups
.
page
(
params
[
:page
]).
per
(
20
)
@groups
=
@groups
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
end
end
app/controllers/explore/projects_controller.rb
View file @
ec02cdf2
...
@@ -11,17 +11,17 @@ class Explore::ProjectsController < ApplicationController
...
@@ -11,17 +11,17 @@ class Explore::ProjectsController < ApplicationController
@projects
=
@projects
.
where
(
visibility_level:
params
[
:visibility_level
])
if
params
[
:visibility_level
].
present?
@projects
=
@projects
.
where
(
visibility_level:
params
[
:visibility_level
])
if
params
[
:visibility_level
].
present?
@projects
=
@projects
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@projects
=
@projects
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
sort
(
@sort
=
params
[
:sort
])
@projects
=
@projects
.
includes
(
:namespace
).
page
(
params
[
:page
]).
per
(
20
)
@projects
=
@projects
.
includes
(
:namespace
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
trending
def
trending
@trending_projects
=
TrendingProjectsFinder
.
new
.
execute
(
current_user
)
@trending_projects
=
TrendingProjectsFinder
.
new
.
execute
(
current_user
)
@trending_projects
=
@trending_projects
.
page
(
params
[
:page
]).
per
(
10
)
@trending_projects
=
@trending_projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
starred
def
starred
@starred_projects
=
ProjectsFinder
.
new
.
execute
(
current_user
)
@starred_projects
=
ProjectsFinder
.
new
.
execute
(
current_user
)
@starred_projects
=
@starred_projects
.
reorder
(
'star_count DESC'
)
@starred_projects
=
@starred_projects
.
reorder
(
'star_count DESC'
)
@starred_projects
=
@starred_projects
.
page
(
params
[
:page
]).
per
(
10
)
@starred_projects
=
@starred_projects
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
end
end
app/controllers/groups/milestones_controller.rb
View file @
ec02cdf2
...
@@ -10,7 +10,7 @@ class Groups::MilestonesController < ApplicationController
...
@@ -10,7 +10,7 @@ class Groups::MilestonesController < ApplicationController
else
state
(
'active'
)
else
state
(
'active'
)
end
end
@group_milestones
=
Milestones
::
GroupService
.
new
(
project_milestones
).
execute
@group_milestones
=
Milestones
::
GroupService
.
new
(
project_milestones
).
execute
@group_milestones
=
Kaminari
.
paginate_array
(
@group_milestones
).
page
(
params
[
:page
]).
per
(
30
)
@group_milestones
=
Kaminari
.
paginate_array
(
@group_milestones
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
show
def
show
...
...
app/controllers/groups_controller.rb
View file @
ec02cdf2
...
@@ -52,13 +52,13 @@ class GroupsController < Groups::ApplicationController
...
@@ -52,13 +52,13 @@ class GroupsController < Groups::ApplicationController
def
merge_requests
def
merge_requests
@merge_requests
=
get_merge_requests_collection
@merge_requests
=
get_merge_requests_collection
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
20
)
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@merge_requests
=
@merge_requests
.
preload
(
:author
,
:target_project
)
@merge_requests
=
@merge_requests
.
preload
(
:author
,
:target_project
)
end
end
def
issues
def
issues
@issues
=
get_issues_collection
@issues
=
get_issues_collection
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
20
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
@issues
=
@issues
.
preload
(
:author
,
:project
)
@issues
=
@issues
.
preload
(
:author
,
:project
)
respond_to
do
|
format
|
respond_to
do
|
format
|
...
...
app/controllers/profiles_controller.rb
View file @
ec02cdf2
...
@@ -43,7 +43,7 @@ class ProfilesController < ApplicationController
...
@@ -43,7 +43,7 @@ class ProfilesController < ApplicationController
end
end
def
history
def
history
@events
=
current_user
.
recent_events
.
page
(
params
[
:page
]).
per
(
20
)
@events
=
current_user
.
recent_events
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
update_username
def
update_username
...
...
app/controllers/projects/branches_controller.rb
View file @
ec02cdf2
...
@@ -8,7 +8,7 @@ class Projects::BranchesController < Projects::ApplicationController
...
@@ -8,7 +8,7 @@ class Projects::BranchesController < Projects::ApplicationController
def
index
def
index
@sort
=
params
[
:sort
]
||
'name'
@sort
=
params
[
:sort
]
||
'name'
@branches
=
@repository
.
branches_sorted_by
(
@sort
)
@branches
=
@repository
.
branches_sorted_by
(
@sort
)
@branches
=
Kaminari
.
paginate_array
(
@branches
).
page
(
params
[
:page
]).
per
(
30
)
@branches
=
Kaminari
.
paginate_array
(
@branches
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
recent
def
recent
...
...
app/controllers/projects/issues_controller.rb
View file @
ec02cdf2
...
@@ -20,7 +20,7 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -20,7 +20,7 @@ class Projects::IssuesController < Projects::ApplicationController
terms
=
params
[
'issue_search'
]
terms
=
params
[
'issue_search'
]
@issues
=
get_issues_collection
@issues
=
get_issues_collection
@issues
=
@issues
.
full_search
(
terms
)
if
terms
.
present?
@issues
=
@issues
.
full_search
(
terms
)
if
terms
.
present?
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
20
)
@issues
=
@issues
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
...
...
app/controllers/projects/labels_controller.rb
View file @
ec02cdf2
...
@@ -7,7 +7,7 @@ class Projects::LabelsController < Projects::ApplicationController
...
@@ -7,7 +7,7 @@ class Projects::LabelsController < Projects::ApplicationController
respond_to
:js
,
:html
respond_to
:js
,
:html
def
index
def
index
@labels
=
@project
.
labels
.
page
(
params
[
:page
]).
per
(
20
)
@labels
=
@project
.
labels
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
new
def
new
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
ec02cdf2
...
@@ -20,7 +20,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -20,7 +20,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
terms
=
params
[
'issue_search'
]
terms
=
params
[
'issue_search'
]
@merge_requests
=
get_merge_requests_collection
@merge_requests
=
get_merge_requests_collection
@merge_requests
=
@merge_requests
.
full_search
(
terms
)
if
terms
.
present?
@merge_requests
=
@merge_requests
.
full_search
(
terms
)
if
terms
.
present?
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
20
)
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
format
.
html
...
...
app/controllers/projects/milestones_controller.rb
View file @
ec02cdf2
...
@@ -18,7 +18,7 @@ class Projects::MilestonesController < Projects::ApplicationController
...
@@ -18,7 +18,7 @@ class Projects::MilestonesController < Projects::ApplicationController
end
end
@milestones
=
@milestones
.
includes
(
:project
)
@milestones
=
@milestones
.
includes
(
:project
)
@milestones
=
@milestones
.
page
(
params
[
:page
]).
per
(
20
)
@milestones
=
@milestones
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
new
def
new
...
...
app/controllers/projects/tags_controller.rb
View file @
ec02cdf2
...
@@ -7,7 +7,7 @@ class Projects::TagsController < Projects::ApplicationController
...
@@ -7,7 +7,7 @@ class Projects::TagsController < Projects::ApplicationController
def
index
def
index
sorted
=
VersionSorter
.
rsort
(
@repository
.
tag_names
)
sorted
=
VersionSorter
.
rsort
(
@repository
.
tag_names
)
@tags
=
Kaminari
.
paginate_array
(
sorted
).
page
(
params
[
:page
]).
per
(
30
)
@tags
=
Kaminari
.
paginate_array
(
sorted
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
create
def
create
...
...
app/controllers/projects/wikis_controller.rb
View file @
ec02cdf2
...
@@ -7,7 +7,7 @@ class Projects::WikisController < Projects::ApplicationController
...
@@ -7,7 +7,7 @@ class Projects::WikisController < Projects::ApplicationController
before_filter
:load_project_wiki
before_filter
:load_project_wiki
def
pages
def
pages
@wiki_pages
=
Kaminari
.
paginate_array
(
@project_wiki
.
pages
).
page
(
params
[
:page
]).
per
(
30
)
@wiki_pages
=
Kaminari
.
paginate_array
(
@project_wiki
.
pages
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
show
def
show
...
...
app/controllers/snippets_controller.rb
View file @
ec02cdf2
...
@@ -16,7 +16,7 @@ class SnippetsController < ApplicationController
...
@@ -16,7 +16,7 @@ class SnippetsController < ApplicationController
layout
:determine_layout
layout
:determine_layout
def
index
def
index
@snippets
=
SnippetsFinder
.
new
.
execute
(
current_user
,
filter: :all
).
page
(
params
[
:page
]).
per
(
20
)
@snippets
=
SnippetsFinder
.
new
.
execute
(
current_user
,
filter: :all
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
end
def
user_index
def
user_index
...
@@ -28,7 +28,7 @@ class SnippetsController < ApplicationController
...
@@ -28,7 +28,7 @@ class SnippetsController < ApplicationController
filter: :by_user
,
filter: :by_user
,
user:
@user
,
user:
@user
,
scope:
params
[
:scope
]
}).
scope:
params
[
:scope
]
}).
page
(
params
[
:page
]).
per
(
20
)
page
(
params
[
:page
]).
per
(
PER_PAGE
)
if
@user
==
current_user
if
@user
==
current_user
render
'current_user_index'
render
'current_user_index'
...
...
app/helpers/application_helper.rb
View file @
ec02cdf2
...
@@ -86,15 +86,6 @@ module ApplicationHelper
...
@@ -86,15 +86,6 @@ module ApplicationHelper
end
end
end
end
def
group_icon
(
group_path
)
group
=
Group
.
find_by
(
path:
group_path
)
if
group
&&
group
.
avatar
.
present?
group
.
avatar
.
url
else
image_path
(
'no_group_avatar.png'
)
end
end
def
avatar_icon
(
user_email
=
''
,
size
=
nil
)
def
avatar_icon
(
user_email
=
''
,
size
=
nil
)
user
=
User
.
find_by
(
email:
user_email
)
user
=
User
.
find_by
(
email:
user_email
)
...
...
app/helpers/groups_helper.rb
View file @
ec02cdf2
...
@@ -40,4 +40,16 @@ module GroupsHelper
...
@@ -40,4 +40,16 @@ module GroupsHelper
false
false
end
end
end
end
def
group_icon
(
group
)
if
group
.
is_a?
(
String
)
group
=
Group
.
find_by
(
path:
group
)
end
if
group
&&
group
.
avatar
.
present?
group
.
avatar
.
url
else
image_path
(
'no_group_avatar.png'
)
end
end
end
end
app/helpers/namespaces_helper.rb
View file @
ec02cdf2
...
@@ -28,7 +28,7 @@ module NamespacesHelper
...
@@ -28,7 +28,7 @@ module NamespacesHelper
def
namespace_icon
(
namespace
,
size
=
40
)
def
namespace_icon
(
namespace
,
size
=
40
)
if
namespace
.
kind_of?
(
Group
)
if
namespace
.
kind_of?
(
Group
)
group_icon
(
namespace
.
path
)
group_icon
(
namespace
)
else
else
avatar_icon
(
namespace
.
owner
.
email
,
size
)
avatar_icon
(
namespace
.
owner
.
email
,
size
)
end
end
...
...
app/helpers/projects_helper.rb
View file @
ec02cdf2
...
@@ -265,4 +265,14 @@ module ProjectsHelper
...
@@ -265,4 +265,14 @@ module ProjectsHelper
"success"
"success"
end
end
end
end
def
service_field_value
(
type
,
value
)
return
value
unless
type
==
'password'
if
value
.
present?
"***********"
else
nil
end
end
end
end
app/views/admin/groups/show.html.haml
View file @
ec02cdf2
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
Group info:
Group info:
%ul
.well-list
%ul
.well-list
%li
%li
=
image_tag
group_icon
(
@group
.
path
),
class:
"avatar s60"
=
image_tag
group_icon
(
@group
),
class:
"avatar s60"
%li
%li
%span
.light
Name:
%span
.light
Name:
%strong
=
@group
.
name
%strong
=
@group
.
name
...
...
app/views/dashboard/groups/index.html.haml
View file @
ec02cdf2
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
%i
.fa.fa-sign-out
%i
.fa.fa-sign-out
Leave
Leave
=
image_tag
group_icon
(
group
.
path
),
class:
"avatar s40 avatar-tile"
=
image_tag
group_icon
(
group
),
class:
"avatar s40 avatar-tile"
=
link_to
group
,
class:
'group-name'
do
=
link_to
group
,
class:
'group-name'
do
%strong
=
group
.
name
%strong
=
group
.
name
...
...
app/views/groups/edit.html.haml
View file @
ec02cdf2
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
.form-group
.form-group
.col-sm-2
.col-sm-2
.col-sm-10
.col-sm-10
=
image_tag
group_icon
(
@group
.
to_param
),
alt:
''
,
class:
'avatar group-avatar s160'
=
image_tag
group_icon
(
@group
),
alt:
''
,
class:
'avatar group-avatar s160'
%p
.light
%p
.light
-
if
@group
.
avatar?
-
if
@group
.
avatar?
You can change your group avatar here
You can change your group avatar here
...
...
app/views/groups/show.html.haml
View file @
ec02cdf2
.dashboard
.dashboard
%div
%div
=
image_tag
group_icon
(
@group
.
path
),
class:
"avatar group-avatar s90"
=
image_tag
group_icon
(
@group
),
class:
"avatar group-avatar s90"
.clearfix
.clearfix
%h2
%h2
=
@group
.
name
=
@group
.
name
...
...
app/views/projects/services/_form.html.haml
View file @
ec02cdf2
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
-
@service
.
fields
.
each
do
|
field
|
-
@service
.
fields
.
each
do
|
field
|
-
name
=
field
[
:name
]
-
name
=
field
[
:name
]
-
title
=
field
[
:title
]
||
name
.
humanize
-
title
=
field
[
:title
]
||
name
.
humanize
-
value
=
@service
.
send
(
name
)
unless
field
[
:type
]
==
'password'
-
value
=
service_field_value
(
field
[
:type
],
@service
.
send
(
name
))
-
type
=
field
[
:type
]
-
type
=
field
[
:type
]
-
placeholder
=
field
[
:placeholder
]
-
placeholder
=
field
[
:placeholder
]
-
choices
=
field
[
:choices
]
-
choices
=
field
[
:choices
]
...
@@ -94,7 +94,7 @@
...
@@ -94,7 +94,7 @@
-
elsif
type
==
'select'
-
elsif
type
==
'select'
=
f
.
select
name
,
options_for_select
(
choices
,
value
?
value
:
default_choice
),
{},
{
class:
"form-control"
}
=
f
.
select
name
,
options_for_select
(
choices
,
value
?
value
:
default_choice
),
{},
{
class:
"form-control"
}
-
elsif
type
==
'password'
-
elsif
type
==
'password'
=
f
.
password_field
name
,
class:
'form-control'
=
f
.
password_field
name
,
placeholder:
value
,
class:
'form-control'
-
if
help
-
if
help
%span
.help-block
=
help
%span
.help-block
=
help
...
...
app/views/users/_groups.html.haml
View file @
ec02cdf2
.clearfix
.clearfix
-
groups
.
each
do
|
group
|
-
groups
.
each
do
|
group
|
=
link_to
group
,
class:
'profile-groups-avatars inline'
,
title:
group
.
name
do
=
link_to
group
,
class:
'profile-groups-avatars inline'
,
title:
group
.
name
do
=
image_tag
group_icon
(
group
.
path
),
class:
'avatar group-avatar s40'
=
image_tag
group_icon
(
group
),
class:
'avatar group-avatar s40'
lib/gitlab/ldap/access.rb
View file @
ec02cdf2
...
@@ -34,7 +34,14 @@ module Gitlab
...
@@ -34,7 +34,14 @@ module Gitlab
def
allowed?
def
allowed?
if
Gitlab
::
LDAP
::
Person
.
find_by_dn
(
user
.
ldap_identity
.
extern_uid
,
adapter
)
if
Gitlab
::
LDAP
::
Person
.
find_by_dn
(
user
.
ldap_identity
.
extern_uid
,
adapter
)
return
true
unless
ldap_config
.
active_directory
return
true
unless
ldap_config
.
active_directory
!
Gitlab
::
LDAP
::
Person
.
disabled_via_active_directory?
(
user
.
ldap_identity
.
extern_uid
,
adapter
)
# Block user in GitLab if he/she was blocked in AD
if
Gitlab
::
LDAP
::
Person
.
disabled_via_active_directory?
(
user
.
ldap_identity
.
extern_uid
,
adapter
)
user
.
block
unless
user
.
blocked?
false
else
true
end
else
else
false
false
end
end
...
...
spec/helpers/application_helper_spec.rb
View file @
ec02cdf2
...
@@ -39,24 +39,6 @@ describe ApplicationHelper do
...
@@ -39,24 +39,6 @@ describe ApplicationHelper do
end
end
end
end
describe
'group_icon'
do
avatar_file_path
=
File
.
join
(
Rails
.
root
,
'public'
,
'gitlab_logo.png'
)
it
'should return an url for the avatar'
do
group
=
create
(
:group
)
group
.
avatar
=
File
.
open
(
avatar_file_path
)
group
.
save!
expect
(
group_icon
(
group
.
path
).
to_s
).
to
match
(
"/uploads/group/avatar/
#{
group
.
id
}
/gitlab_logo.png"
)
end
it
'should give default avatar_icon when no avatar is present'
do
group
=
create
(
:group
)
group
.
save!
expect
(
group_icon
(
group
.
path
)).
to
match
(
'group_avatar.png'
)
end
end
describe
'project_icon'
do
describe
'project_icon'
do
avatar_file_path
=
File
.
join
(
Rails
.
root
,
'public'
,
'gitlab_logo.png'
)
avatar_file_path
=
File
.
join
(
Rails
.
root
,
'public'
,
'gitlab_logo.png'
)
...
...
spec/helpers/groups_helper.rb
0 → 100644
View file @
ec02cdf2
require
'spec_helper'
describe
GroupsHelper
do
describe
'group_icon'
do
avatar_file_path
=
File
.
join
(
Rails
.
root
,
'public'
,
'gitlab_logo.png'
)
it
'should return an url for the avatar'
do
group
=
create
(
:group
)
group
.
avatar
=
File
.
open
(
avatar_file_path
)
group
.
save!
expect
(
group_icon
(
group
.
path
).
to_s
).
to
match
(
"/uploads/group/avatar/
#{
group
.
id
}
/gitlab_logo.png"
)
end
it
'should give default avatar_icon when no avatar is present'
do
group
=
create
(
:group
)
group
.
save!
expect
(
group_icon
(
group
.
path
)).
to
match
(
'group_avatar.png'
)
end
end
end
spec/lib/gitlab/ldap/access_spec.rb
View file @
ec02cdf2
...
@@ -20,6 +20,11 @@ describe Gitlab::LDAP::Access do
...
@@ -20,6 +20,11 @@ describe Gitlab::LDAP::Access do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
disabled_via_active_directory?:
true
)
}
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
disabled_via_active_directory?:
true
)
}
it
{
is_expected
.
to
be_falsey
}
it
{
is_expected
.
to
be_falsey
}
it
"should block user in GitLab"
do
access
.
allowed?
user
.
should
be_blocked
end
end
end
context
'and has no disabled flag in active diretory'
do
context
'and has no disabled flag in active diretory'
do
...
@@ -38,4 +43,4 @@ describe Gitlab::LDAP::Access do
...
@@ -38,4 +43,4 @@ describe Gitlab::LDAP::Access do
end
end
end
end
end
end
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment