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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
6aead799
Commit
6aead799
authored
Mar 01, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix decorate calls on collections after draper update
parent
520f0225
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
14 deletions
+15
-14
app/controllers/admin/teams/members_controller.rb
app/controllers/admin/teams/members_controller.rb
+1
-1
app/controllers/commits_controller.rb
app/controllers/commits_controller.rb
+1
-1
app/controllers/compare_controller.rb
app/controllers/compare_controller.rb
+1
-1
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+3
-3
app/controllers/teams/members_controller.rb
app/controllers/teams/members_controller.rb
+1
-1
app/decorators/application_decorator.rb
app/decorators/application_decorator.rb
+8
-7
No files found.
app/controllers/admin/teams/members_controller.rb
View file @
6aead799
class
Admin::Teams::MembersController
<
Admin
::
Teams
::
ApplicationController
class
Admin::Teams::MembersController
<
Admin
::
Teams
::
ApplicationController
def
new
def
new
@users
=
User
.
potential_team_members
(
user_team
)
@users
=
User
.
potential_team_members
(
user_team
)
@users
=
UserDecorator
.
decorate
@users
@users
=
UserDecorator
.
decorate
_collection
@users
end
end
def
create
def
create
...
...
app/controllers/commits_controller.rb
View file @
6aead799
...
@@ -13,7 +13,7 @@ class CommitsController < ProjectResourceController
...
@@ -13,7 +13,7 @@ class CommitsController < ProjectResourceController
@limit
,
@offset
=
(
params
[
:limit
]
||
40
),
(
params
[
:offset
]
||
0
)
@limit
,
@offset
=
(
params
[
:limit
]
||
40
),
(
params
[
:offset
]
||
0
)
@commits
=
@repo
.
commits
(
@ref
,
@path
,
@limit
,
@offset
)
@commits
=
@repo
.
commits
(
@ref
,
@path
,
@limit
,
@offset
)
@commits
=
CommitDecorator
.
decorate
(
@commits
)
@commits
=
CommitDecorator
.
decorate
_collection
(
@commits
)
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
# index.html.erb
format
.
html
# index.html.erb
...
...
app/controllers/compare_controller.rb
View file @
6aead799
...
@@ -16,7 +16,7 @@ class CompareController < ProjectResourceController
...
@@ -16,7 +16,7 @@ class CompareController < ProjectResourceController
@refs_are_same
=
result
[
:same
]
@refs_are_same
=
result
[
:same
]
@line_notes
=
[]
@line_notes
=
[]
@commits
=
CommitDecorator
.
decorate
(
@commits
)
@commits
=
CommitDecorator
.
decorate
_collection
(
@commits
)
end
end
def
create
def
create
...
...
app/controllers/merge_requests_controller.rb
View file @
6aead799
...
@@ -94,12 +94,12 @@ class MergeRequestsController < ProjectResourceController
...
@@ -94,12 +94,12 @@ class MergeRequestsController < ProjectResourceController
def
branch_from
def
branch_from
@commit
=
@repository
.
commit
(
params
[
:ref
])
@commit
=
@repository
.
commit
(
params
[
:ref
])
@commit
=
CommitDecorator
.
decorate
(
@commit
)
@commit
=
CommitDecorator
.
decorate
_collection
(
@commit
)
end
end
def
branch_to
def
branch_to
@commit
=
@repository
.
commit
(
params
[
:ref
])
@commit
=
@repository
.
commit
(
params
[
:ref
])
@commit
=
CommitDecorator
.
decorate
(
@commit
)
@commit
=
CommitDecorator
.
decorate
_collection
(
@commit
)
end
end
def
ci_status
def
ci_status
...
@@ -143,7 +143,7 @@ class MergeRequestsController < ProjectResourceController
...
@@ -143,7 +143,7 @@ class MergeRequestsController < ProjectResourceController
# Get commits from repository
# Get commits from repository
# or from cache if already merged
# or from cache if already merged
@commits
=
@merge_request
.
commits
@commits
=
@merge_request
.
commits
@commits
=
CommitDecorator
.
decorate
(
@commits
)
@commits
=
CommitDecorator
.
decorate
_collection
(
@commits
)
@allowed_to_merge
=
allowed_to_merge?
@allowed_to_merge
=
allowed_to_merge?
@show_merge_controls
=
@merge_request
.
opened?
&&
@commits
.
any?
&&
@allowed_to_merge
@show_merge_controls
=
@merge_request
.
opened?
&&
@commits
.
any?
&&
@allowed_to_merge
...
...
app/controllers/teams/members_controller.rb
View file @
6aead799
...
@@ -8,7 +8,7 @@ class Teams::MembersController < Teams::ApplicationController
...
@@ -8,7 +8,7 @@ class Teams::MembersController < Teams::ApplicationController
def
new
def
new
@users
=
User
.
potential_team_members
(
user_team
)
@users
=
User
.
potential_team_members
(
user_team
)
@users
=
UserDecorator
.
decorate
@users
@users
=
UserDecorator
.
decorate
_collection
@users
end
end
def
create
def
create
...
...
app/decorators/application_decorator.rb
View file @
6aead799
class
ApplicationDecorator
<
Draper
::
Base
class
ApplicationDecorator
<
Draper
::
Decorator
delegate_all
# Lazy Helpers
# Lazy Helpers
# PRO: Call Rails helpers without the h. proxy
# PRO: Call Rails helpers without the h. proxy
# ex: number_to_currency(model.price)
# ex: number_to_currency(model.price)
# CON: Add a bazillion methods into your decorator's namespace
# CON: Add a bazillion methods into your decorator's namespace
# and probably sacrifice performance/memory
# and probably sacrifice performance/memory
#
#
# Enable them by uncommenting this line:
# Enable them by uncommenting this line:
# lazy_helpers
# lazy_helpers
# Shared Decorations
# Shared Decorations
# Consider defining shared methods common to all your models.
# Consider defining shared methods common to all your models.
#
#
# Example: standardize the formatting of timestamps
# Example: standardize the formatting of timestamps
#
#
# def formatted_timestamp(time)
# def formatted_timestamp(time)
# h.content_tag :span, time.strftime("%a %m/%d/%y"),
# h.content_tag :span, time.strftime("%a %m/%d/%y"),
# class: 'timestamp'
# class: 'timestamp'
# end
# end
#
#
# def created_at
# def created_at
# formatted_timestamp(model.created_at)
# formatted_timestamp(model.created_at)
# end
# end
#
#
# def updated_at
# def updated_at
# formatted_timestamp(model.updated_at)
# formatted_timestamp(model.updated_at)
# end
# end
...
...
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