Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
6c9c33f4
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 搜索 >>
提交
6c9c33f4
编写于
8月 31, 2016
作者:
T
tiagonbotelho
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
filters tags by name
上级
4d042afe
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
7 deletion
+21
-7
CHANGELOG
CHANGELOG
+1
-0
app/controllers/projects/tags_controller.rb
app/controllers/projects/tags_controller.rb
+2
-1
app/helpers/tags_helper.rb
app/helpers/tags_helper.rb
+10
-0
app/views/projects/tags/index.html.haml
app/views/projects/tags/index.html.haml
+8
-6
未找到文件。
CHANGELOG
浏览文件 @
6c9c33f4
Please view this file on the master branch, on stable branches it's out of date.
v 8.12.0 (unreleased)
- Filter tags by name !6121
- Make push events have equal vertical spacing.
- Add two-factor recovery endpoint to internal API !5510
- Remove vendor prefixes for linear-gradient CSS (ClemMakesApps)
...
...
app/controllers/projects/tags_controller.rb
浏览文件 @
6c9c33f4
class
Projects::TagsController
<
Projects
::
ApplicationController
include
SortingHelper
# Authorize
before_action
:require_non_empty_project
before_action
:authorize_download_code!
...
...
@@ -7,7 +8,7 @@ class Projects::TagsController < Projects::ApplicationController
def
index
@sort
=
params
[
:sort
]
||
'name'
@tags
=
@repository
.
tags_sorted_by
(
@sort
)
@tags
=
TagsFinder
.
new
(
@repository
,
params
).
execute
@tags
=
Kaminari
.
paginate_array
(
@tags
).
page
(
params
[
:page
])
@releases
=
project
.
releases
.
where
(
tag:
@tags
.
map
(
&
:name
))
...
...
app/helpers/tags_helper.rb
浏览文件 @
6c9c33f4
...
...
@@ -3,6 +3,16 @@ module TagsHelper
"/tags/
#{
tag
}
"
end
def
filter_tags_path
(
options
=
{})
exist_opts
=
{
search:
params
[
:search
],
sort:
params
[
:sort
]
}
options
=
exist_opts
.
merge
(
options
)
namespace_project_tags_path
(
@project
.
namespace
,
@project
,
@id
,
options
)
end
def
tag_list
(
project
)
html
=
''
project
.
tag_list
.
each
do
|
tag
|
...
...
app/views/projects/tags/index.html.haml
浏览文件 @
6c9c33f4
...
...
@@ -8,21 +8,23 @@
Tags give the ability to mark specific points in history as being important
.nav-controls
-
if
can?
current_user
,
:push_code
,
@project
=
link_to
new_namespace_project_tag_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-create new-tag-btn'
do
New tag
=
form_tag
(
filter_tags_path
,
method: :get
)
do
=
search_field_tag
:search
,
params
[
:search
],
{
placeholder:
'Filter by tag name'
,
id:
'tag-search'
,
class:
'form-control search-text-input input-short'
,
spellcheck:
false
}
.dropdown.inline
%button
.dropdown-toggle.btn
{
type:
'button'
,
data:
{
toggle:
'dropdown'
}
}
%span
.light
=
@sort
.
humanize
%b
.caret
%ul
.dropdown-menu.dropdown-menu-align-right
%li
=
link_to
namespace_project
_tags_path
(
sort:
nil
)
do
=
link_to
filter
_tags_path
(
sort:
nil
)
do
Name
=
link_to
namespace_project
_tags_path
(
sort:
sort_value_recently_updated
)
do
=
link_to
filter
_tags_path
(
sort:
sort_value_recently_updated
)
do
=
sort_title_recently_updated
=
link_to
namespace_project
_tags_path
(
sort:
sort_value_oldest_updated
)
do
=
link_to
filter
_tags_path
(
sort:
sort_value_oldest_updated
)
do
=
sort_title_oldest_updated
-
if
can?
current_user
,
:push_code
,
@project
=
link_to
new_namespace_project_tag_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-create new-tag-btn'
do
New tag
.tags
-
if
@tags
.
any?
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录