Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
6aead799
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6aead799
编写于
3月 01, 2013
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix decorate calls on collections after draper update
上级
520f0225
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
14 deletion
+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
未找到文件。
app/controllers/admin/teams/members_controller.rb
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录