Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
312cf11b
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
312cf11b
编写于
11月 05, 2015
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add release description to new tag form
Signed-off-by:
N
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
上级
850bb21b
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
28 addition
and
1 deletion
+28
-1
app/assets/javascripts/dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+3
-0
app/controllers/projects/tags_controller.rb
app/controllers/projects/tags_controller.rb
+7
-0
app/views/projects/tags/new.html.haml
app/views/projects/tags/new.html.haml
+18
-1
未找到文件。
app/assets/javascripts/dispatcher.js.coffee
浏览文件 @
312cf11b
...
...
@@ -39,6 +39,9 @@ class Dispatcher
shortcut_handler
=
new
ShortcutsNavigation
()
new
DropzoneInput
(
$
(
'.merge-request-form'
))
new
IssuableForm
(
$
(
'.merge-request-form'
))
when
'projects:tags:new'
new
ZenMode
()
new
DropzoneInput
(
$
(
'.tag-form'
))
when
'projects:releases:edit'
new
ZenMode
()
new
DropzoneInput
(
$
(
'.release-form'
))
...
...
app/controllers/projects/tags_controller.rb
浏览文件 @
312cf11b
...
...
@@ -23,6 +23,13 @@ class Projects::TagsController < Projects::ApplicationController
if
result
[
:status
]
==
:success
@tag
=
result
[
:tag
]
if
params
[
:release_description
]
release
=
@project
.
releases
.
find_or_initialize_by
(
tag:
@tag
.
name
)
release
.
update_attributes
(
description:
params
[
:release_description
])
release
.
save
end
redirect_to
namespace_project_tags_path
(
@project
.
namespace
,
@project
)
else
@error
=
result
[
:message
]
...
...
app/views/projects/tags/new.html.haml
浏览文件 @
312cf11b
...
...
@@ -8,7 +8,7 @@
%h3
.page-title
%i
.fa.fa-code-fork
New tag
=
form_tag
namespace_project_tags_path
,
method: :post
,
id:
"new-tag-form"
,
class:
"form-horizontal"
do
=
form_tag
namespace_project_tags_path
,
method: :post
,
id:
"new-tag-form"
,
class:
"form-horizontal
tag-form
"
do
.form-group
=
label_tag
:tag_name
,
'Name for new tag'
,
class:
'control-label'
.col-sm-10
...
...
@@ -23,6 +23,23 @@
.col-sm-10
=
text_field_tag
:message
,
nil
,
placeholder:
'Enter message.'
,
required:
false
,
tabindex:
3
,
class:
'form-control'
.light
(Optional) Entering a message will create an annotated tag.
%hr
.form-group
=
label_tag
:release_description
,
'Release description'
,
class:
'control-label'
.col-sm-10
=
render
layout:
'projects/md_preview'
,
locals:
{
preview_class:
"md-preview"
,
referenced_users:
true
}
do
.zennable
%input
#zen-toggle-comment
.zen-toggle-comment
(
tabindex=
"-1"
type=
"checkbox"
)
.zen-backdrop
=
text_area_tag
:release_description
,
nil
,
class:
'js-gfm-input markdown-area description js-quick-submit form-control'
,
placeholder:
''
%a
.zen-enter-link
(
tabindex=
"-1"
href=
"#"
)
=
icon
(
'expand'
)
Edit in fullscreen
%a
.zen-leave-link
(
href=
"#"
)
=
icon
(
'compress'
)
=
render
'projects/notes/hints'
.help-block
You can add release description to your tag. It will be stored in GitLab database and displayed on tags page
.form-actions
=
button_tag
'Create tag'
,
class:
'btn btn-create'
,
tabindex:
3
=
link_to
'Cancel'
,
namespace_project_tags_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-cancel'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录