Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
ba67af79
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,发现更多精彩内容 >>
未验证
提交
ba67af79
编写于
11月 05, 2015
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More release related logic to separate resource
Signed-off-by:
N
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
上级
1c4d1c3b
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
46 addition
and
11 deletion
+46
-11
app/controllers/projects/releases_controller.rb
app/controllers/projects/releases_controller.rb
+32
-0
app/controllers/projects/tags_controller.rb
app/controllers/projects/tags_controller.rb
+0
-8
app/models/project.rb
app/models/project.rb
+2
-1
app/views/projects/releases/edit.html.haml
app/views/projects/releases/edit.html.haml
+6
-0
app/views/projects/releases/show.html.haml
app/views/projects/releases/show.html.haml
+1
-0
app/views/projects/tags/_tag.html.haml
app/views/projects/tags/_tag.html.haml
+1
-1
app/views/projects/tags/edit.html.haml
app/views/projects/tags/edit.html.haml
+0
-0
config/routes.rb
config/routes.rb
+4
-1
未找到文件。
app/controllers/projects/releases_controller.rb
0 → 100644
浏览文件 @
ba67af79
class
Projects::ReleasesController
<
Projects
::
ApplicationController
# Authorize
before_action
:require_non_empty_project
before_action
:authorize_download_code!
before_action
:authorize_push_code!
before_action
:tag
before_action
:release
def
show
end
def
edit
end
def
update
description
=
params
[
:release
][
:description
]
release
.
update_attributes
(
description:
description
)
release
.
save
redirect_to
namespace_project_tag_release_path
(
@project
.
namespace
,
@project
,
@tag
.
name
)
end
private
def
tag
@tag
||=
@repository
.
find_tag
(
params
[
:tag_id
])
end
def
release
@release
||=
@project
.
releases
.
find_or_initialize_by
(
tag:
@tag
.
name
)
end
end
app/controllers/projects/tags_controller.rb
浏览文件 @
ba67af79
...
...
@@ -10,14 +10,6 @@ class Projects::TagsController < Projects::ApplicationController
@tags
=
Kaminari
.
paginate_array
(
sorted
).
page
(
params
[
:page
]).
per
(
PER_PAGE
)
end
def
edit
# TODO: implement
end
def
update
# TODO: implement
end
def
create
result
=
CreateTagService
.
new
(
@project
,
current_user
).
execute
(
params
[
:tag_name
],
params
[
:ref
],
params
[
:message
])
...
...
app/models/project.rb
浏览文件 @
ba67af79
...
...
@@ -121,6 +121,7 @@ class Project < ActiveRecord::Base
has_many
:starrers
,
through: :users_star_projects
,
source: :user
has_many
:ci_commits
,
dependent: :destroy
,
class_name:
'Ci::Commit'
,
foreign_key: :gl_project_id
has_many
:ci_builds
,
through: :ci_commits
,
source: :builds
,
dependent: :destroy
,
class_name:
'Ci::Build'
has_many
:releases
,
dependent: :destroy
has_one
:import_data
,
dependent: :destroy
,
class_name:
"ProjectImportData"
has_one
:gitlab_ci_project
,
dependent: :destroy
,
class_name:
"Ci::Project"
,
foreign_key: :gitlab_id
...
...
@@ -247,7 +248,7 @@ class Project < ActiveRecord::Base
joins
(
:namespace
).
iwhere
(
'namespaces.path'
=>
namespace_path
)
projects
.
where
(
'projects.path'
=>
project_path
).
take
||
projects
.
where
(
'projects.path'
=>
project_path
).
take
||
projects
.
iwhere
(
'projects.path'
=>
project_path
).
take
end
...
...
app/views/projects/releases/edit.html.haml
0 → 100644
浏览文件 @
ba67af79
=
form_for
(
@release
,
method: :put
,
url:
namespace_project_tag_release_path
(
@project
.
namespace
,
@project
,
@tag
.
name
),
html:
{
class:
'form-horizontal gfm-form'
})
do
|
f
|
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"md-preview"
,
referenced_users:
true
}
do
=
render
'projects/zen'
,
f:
f
,
attr: :description
,
classes:
'js-quick-submit'
=
render
'projects/notes/hints'
.error-alert
=
f
.
submit
'Save changes'
,
class:
'btn btn-save'
app/views/projects/releases/show.html.haml
0 → 100644
浏览文件 @
ba67af79
=
debug
@release
app/views/projects/tags/_tag.html.haml
浏览文件 @
ba67af79
...
...
@@ -9,7 +9,7 @@
=
strip_gpg_signature
(
tag
.
message
)
.controls
=
link_to
edit_namespace_project_tag_path
(
@project
.
namespace
,
@project
,
tag
.
name
),
class:
'btn-grouped btn'
do
=
link_to
edit_namespace_project_tag_
release_
path
(
@project
.
namespace
,
@project
,
tag
.
name
),
class:
'btn-grouped btn'
do
=
icon
(
"pencil"
)
-
if
can?
current_user
,
:download_code
,
@project
=
render
'projects/repositories/download_archive'
,
ref:
tag
.
name
,
btn_class:
'btn-grouped btn-group-xs'
...
...
app/views/projects/tags/edit.html.haml
已删除
100644 → 0
浏览文件 @
1c4d1c3b
config/routes.rb
浏览文件 @
ba67af79
...
...
@@ -569,7 +569,10 @@ Gitlab::Application.routes.draw do
end
resources
:branches
,
only:
[
:index
,
:new
,
:create
,
:destroy
],
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
}
resources
:tags
,
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
}
resources
:tags
,
only:
[
:index
,
:new
,
:create
,
:destroy
],
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
}
do
resource
:release
end
resources
:protected_branches
,
only:
[
:index
,
:create
,
:update
,
:destroy
],
constraints:
{
id:
Gitlab
::
Regex
.
git_reference_regex
}
resource
:variables
,
only:
[
:show
,
:update
]
resources
:triggers
,
only:
[
:index
,
:create
,
:destroy
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录