Skip to content

Commit

Permalink
[webui] Don't truncate project or packages names on search results. F…
Browse files Browse the repository at this point in the history
…ixes #883
  • Loading branch information
Moises committed Jul 2, 2015
1 parent 1379591 commit b0cbba4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/api/app/helpers/webui/webui_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def link_to_package(prj, pkg, opts)
opts[:package_text] ||= opts[:package]

opts[:project_text], opts[:package_text] =
elide_two(opts[:project_text], opts[:package_text], opts[:trim_to])
elide_two(opts[:project_text], opts[:package_text], opts[:trim_to]) unless opts[:trim_to].nil?

if opts[:short]
out = ''.html_safe
Expand Down Expand Up @@ -458,7 +458,8 @@ def link_to_project(prj, opts)
else
out = 'project '.html_safe
end
out + link_to_if(prj, elide(opts[:project_text], opts[:trim_to]),
project_text = opts[:trim_to].nil? ? opts[:project_text] : elide(opts[:project_text], opts[:trim_to])
out + link_to_if(prj, project_text,
{ controller: 'project', action: 'show', project: opts[:project] },
{ class: 'project', title: opts[:project] })
end
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/views/webui/search/_results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<div class="search_result">
<h6 class="data-title">
<%= sprite_tag(rtype, class: rtype, title: rtype.humanize) %>
<%= project_or_package_link project: project, package: package, short: false %>
<%= project_or_package_link project: project, package: package, short: false, trim_to: nil %>
<%= content_tag :span, result.sphinx_attributes, style: 'display:none' %>
</h6>

Expand Down

0 comments on commit b0cbba4

Please sign in to comment.