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
Léo-Paul Géneau
gitlab-ce
Commits
983173ce
Commit
983173ce
authored
Feb 28, 2019
by
Brandon Labuschagne
Committed by
Clement Ho
Feb 28, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug where project topics truncate
parent
23eb41fc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
app/presenters/project_presenter.rb
app/presenters/project_presenter.rb
+4
-0
app/views/projects/_home_panel.html.haml
app/views/projects/_home_panel.html.haml
+11
-4
changelogs/unreleased/57788-project-labels-tooltip-missing.yml
...elogs/unreleased/57788-project-labels-tooltip-missing.yml
+5
-0
No files found.
app/presenters/project_presenter.rb
View file @
983173ce
...
@@ -315,6 +315,10 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
...
@@ -315,6 +315,10 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
project
.
tag_list
.
take
(
MAX_TOPICS_TO_SHOW
)
# rubocop: disable CodeReuse/ActiveRecord
project
.
tag_list
.
take
(
MAX_TOPICS_TO_SHOW
)
# rubocop: disable CodeReuse/ActiveRecord
end
end
def
topics_not_shown
project
.
tag_list
-
topics_to_show
end
def
count_of_extra_topics_not_shown
def
count_of_extra_topics_not_shown
if
project
.
tag_list
.
count
>
MAX_TOPICS_TO_SHOW
if
project
.
tag_list
.
count
>
MAX_TOPICS_TO_SHOW
project
.
tag_list
.
count
-
MAX_TOPICS_TO_SHOW
project
.
tag_list
.
count
-
MAX_TOPICS_TO_SHOW
...
...
app/views/projects/_home_panel.html.haml
View file @
983173ce
-
empty_repo
=
@project
.
empty_repo?
-
empty_repo
=
@project
.
empty_repo?
-
show_auto_devops_callout
=
show_auto_devops_callout?
(
@project
)
-
show_auto_devops_callout
=
show_auto_devops_callout?
(
@project
)
-
max_project_topic_length
=
15
.project-home-panel
{
class:
(
"empty-project"
if
empty_repo
)
}
.project-home-panel
{
class:
(
"empty-project"
if
empty_repo
)
}
.row.append-bottom-8
.row.append-bottom-8
.home-panel-title-row.col-md-12.col-lg-6.d-flex
.home-panel-title-row.col-md-12.col-lg-6.d-flex
...
@@ -19,15 +20,21 @@
...
@@ -19,15 +20,21 @@
%span
.access-request-links.prepend-left-8
%span
.access-request-links.prepend-left-8
=
render
'shared/members/access_request_links'
,
source:
@project
=
render
'shared/members/access_request_links'
,
source:
@project
-
if
@project
.
tag_list
.
present?
-
if
@project
.
tag_list
.
present?
%span
.home-panel-topic-list.d-inline-flex.prepend-left-8
.has-tooltip
{
data:
{
container:
'body'
},
title:
@project
.
has_extra_topics?
?
@project
.
tag_list
.
join
(
', '
)
:
nil
}
%span
.home-panel-topic-list.d-inline-flex.prepend-left-8
=
sprite_icon
(
'tag'
,
size:
16
,
css_class:
'icon append-right-4'
)
=
sprite_icon
(
'tag'
,
size:
16
,
css_class:
'icon append-right-4'
)
-
@project
.
topics_to_show
.
each
do
|
topic
|
-
@project
.
topics_to_show
.
each
do
|
topic
|
%a
{
class:
'badge badge-pill badge-secondary append-right-5 str-truncated-30'
,
href:
explore_projects_path
(
tag:
topic
)
}
-
project_topics_classes
=
"badge badge-pill badge-secondary append-right-5"
=
topic
.
titleize
-
explore_project_topic_path
=
explore_projects_path
(
tag:
topic
)
-
if
topic
.
length
>
max_project_topic_length
%a
{
class:
"#{ project_topics_classes } str-truncated-30 has-tooltip"
,
data:
{
container:
"body"
},
title:
topic
,
href:
explore_project_topic_path
}
=
topic
.
titleize
-
else
%a
{
class:
project_topics_classes
,
href:
explore_project_topic_path
}
=
topic
.
titleize
-
if
@project
.
has_extra_topics?
-
if
@project
.
has_extra_topics?
.text-nowrap
.text-nowrap
.has-tooltip
{
data:
{
container:
'body'
},
title:
@project
.
has_extra_topics?
?
@project
.
topics_not_shown
.
join
(
', '
)
:
nil
}
=
_
(
"+ %{count} more"
)
%
{
count:
@project
.
count_of_extra_topics_not_shown
}
=
_
(
"+ %{count} more"
)
%
{
count:
@project
.
count_of_extra_topics_not_shown
}
...
...
changelogs/unreleased/57788-project-labels-tooltip-missing.yml
0 → 100644
View file @
983173ce
---
title
:
Fix bug where project topics truncate
merge_request
:
25398
author
:
type
:
fixed
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