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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
6c9c33f4
Commit
6c9c33f4
authored
Aug 31, 2016
by
tiagonbotelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filters tags by name
parent
4d042afe
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
7 deletions
+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
No files found.
CHANGELOG
View file @
6c9c33f4
Please view this file on the master branch, on stable branches it's out of date.
Please view this file on the master branch, on stable branches it's out of date.
v 8.12.0 (unreleased)
v 8.12.0 (unreleased)
- Filter tags by name !6121
- Make push events have equal vertical spacing.
- Make push events have equal vertical spacing.
- Add two-factor recovery endpoint to internal API !5510
- Add two-factor recovery endpoint to internal API !5510
- Remove vendor prefixes for linear-gradient CSS (ClemMakesApps)
- Remove vendor prefixes for linear-gradient CSS (ClemMakesApps)
...
...
app/controllers/projects/tags_controller.rb
View file @
6c9c33f4
class
Projects::TagsController
<
Projects
::
ApplicationController
class
Projects::TagsController
<
Projects
::
ApplicationController
include
SortingHelper
# Authorize
# Authorize
before_action
:require_non_empty_project
before_action
:require_non_empty_project
before_action
:authorize_download_code!
before_action
:authorize_download_code!
...
@@ -7,7 +8,7 @@ class Projects::TagsController < Projects::ApplicationController
...
@@ -7,7 +8,7 @@ class Projects::TagsController < Projects::ApplicationController
def
index
def
index
@sort
=
params
[
:sort
]
||
'name'
@sort
=
params
[
:sort
]
||
'name'
@tags
=
@repository
.
tags_sorted_by
(
@sort
)
@tags
=
TagsFinder
.
new
(
@repository
,
params
).
execute
@tags
=
Kaminari
.
paginate_array
(
@tags
).
page
(
params
[
:page
])
@tags
=
Kaminari
.
paginate_array
(
@tags
).
page
(
params
[
:page
])
@releases
=
project
.
releases
.
where
(
tag:
@tags
.
map
(
&
:name
))
@releases
=
project
.
releases
.
where
(
tag:
@tags
.
map
(
&
:name
))
...
...
app/helpers/tags_helper.rb
View file @
6c9c33f4
...
@@ -3,6 +3,16 @@ module TagsHelper
...
@@ -3,6 +3,16 @@ module TagsHelper
"/tags/
#{
tag
}
"
"/tags/
#{
tag
}
"
end
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
)
def
tag_list
(
project
)
html
=
''
html
=
''
project
.
tag_list
.
each
do
|
tag
|
project
.
tag_list
.
each
do
|
tag
|
...
...
app/views/projects/tags/index.html.haml
View file @
6c9c33f4
...
@@ -8,21 +8,23 @@
...
@@ -8,21 +8,23 @@
Tags give the ability to mark specific points in history as being important
Tags give the ability to mark specific points in history as being important
.nav-controls
.nav-controls
-
if
can?
current_user
,
:push_code
,
@project
=
form_tag
(
filter_tags_path
,
method: :get
)
do
=
link_to
new_namespace_project_tag_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-create new-tag-btn'
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
}
New tag
.dropdown.inline
.dropdown.inline
%button
.dropdown-toggle.btn
{
type:
'button'
,
data:
{
toggle:
'dropdown'
}
}
%button
.dropdown-toggle.btn
{
type:
'button'
,
data:
{
toggle:
'dropdown'
}
}
%span
.light
=
@sort
.
humanize
%span
.light
=
@sort
.
humanize
%b
.caret
%b
.caret
%ul
.dropdown-menu.dropdown-menu-align-right
%ul
.dropdown-menu.dropdown-menu-align-right
%li
%li
=
link_to
namespace_project
_tags_path
(
sort:
nil
)
do
=
link_to
filter
_tags_path
(
sort:
nil
)
do
Name
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
=
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
=
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
.tags
-
if
@tags
.
any?
-
if
@tags
.
any?
...
...
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