]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3325 Searching for files when package names are too longs
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Thu, 22 Nov 2012 15:16:19 +0000 (16:16 +0100)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Thu, 22 Nov 2012 15:16:19 +0000 (16:16 +0100)
sonar-server/src/main/webapp/WEB-INF/app/views/search/_autocomplete.html.erb

index 3e2f99eee50b5664da6dbadf7053c75b3ca8b78c..b3ab23700dcad38d40aaed28946aa812d47cf564 100644 (file)
 %>
         <li id="<%= resource.id -%>">
           <div class="q"><%= message("qualifiers.#{resource.qualifier}") if first -%></div>
-          <%= qualifier_icon resource -%> <%= highlight(truncate(resource.name(true), :length => 70), params[:s]) -%>
+          <%
+            displayed_resource_name=resource.name(true)
+            name_length=displayed_resource_name.mb_chars.length
+            if name_length>70
+              displayed_resource_name=truncate(displayed_resource_name.reverse, :length => 70).reverse
+            end
+          %>
+          <span title="<%= resource.name(true) -%>"><%= qualifier_icon resource -%> <%= highlight(displayed_resource_name, params[:s]) -%></span>
         </li>
 <%             first=false
              end