Commit 741f0c2af442952457ab179328d3506efcd536f2
Committed by
Luciano Prestes
1 parent
bb84c3e5
Exists in
master
and in
5 other branches
Add translation to empty catalog search
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com> Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com>
Showing
2 changed files
with
45 additions
and
1 deletions
Show diff stats
@@ -0,0 +1,44 @@ | @@ -0,0 +1,44 @@ | ||
1 | +<div id="search-results" class="<%= !multiple_search? ? 'only-one-result-box' : 'multiple-results-boxes' %>"> | ||
2 | + <% @assets.each do |name| %> | ||
3 | + <% search = @searches[name] %> | ||
4 | + | ||
5 | + <input type="hidden" id="empty_result" value="<%= search[:results].blank? %>" /> | ||
6 | + | ||
7 | + <div class="search-results-<%= name %> search-results-box"> | ||
8 | + <% if !search[:results].blank? %> | ||
9 | + | ||
10 | + <% if multiple_search?(@searches) %> | ||
11 | + <h3><%= @names[name] %></h3> | ||
12 | + <% if search[:results].total_entries > SearchController::MULTIPLE_SEARCH_LIMIT %> | ||
13 | + <%= link_to(_('see all (%d)') % search[:results].total_entries, params.merge(:action => name), :class => 'see-more' ) %> | ||
14 | + <% end %> | ||
15 | + <% end %> | ||
16 | + | ||
17 | + <% display = display_filter(name, params[:display]) %> | ||
18 | + | ||
19 | + <div class="search-results-innerbox search-results-type-<%= name.to_s.singularize %> <%= 'common-profile-list-block' if SearchHelper::COMMON_PROFILE_LIST_BLOCK.include?(name) %>"> | ||
20 | + <ul> | ||
21 | + <% search[:results].each do |hit| %> | ||
22 | + <% partial = partial_for_class(hit.class, display) %> | ||
23 | + <% variable_name = partial.gsub("#{display}_", '').to_sym %> | ||
24 | + <%= render :partial => partial, :locals => {variable_name => hit} %> | ||
25 | + <% end %> | ||
26 | + </ul> | ||
27 | + </div> | ||
28 | + <% else %> | ||
29 | + <% if multiple_search? %> | ||
30 | + <h3><%= @names[name] %></h3> | ||
31 | + <% end %> | ||
32 | + | ||
33 | + <div id="search-results-empty"></div> | ||
34 | + | ||
35 | + <input type="hidden" id="message-no-catalog-selected" value="<%= _('No software found. Try more general filters') %>" /> | ||
36 | + <input type="hidden" id="message-catalog-selected" value="<%= _('No software found. Try more general filters or check the software category individually') %>" /> | ||
37 | + <% end %> | ||
38 | + </div> | ||
39 | + <% end %> | ||
40 | + | ||
41 | + <div style="clear:both"></div> | ||
42 | + | ||
43 | + <%= add_zoom_to_images %> | ||
44 | +</div> |
views/search/software_infos.html.erb
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | 3 | ||
4 | <%= render :partial => 'software_search_form', :locals => { :hint => _("Type words about the %s you're looking for") % @asset.to_s.singularize } %> | 4 | <%= render :partial => 'software_search_form', :locals => { :hint => _("Type words about the %s you're looking for") % @asset.to_s.singularize } %> |
5 | 5 | ||
6 | - <%= display_results(@searches, @asset) %> | 6 | + <%= render partial:"catalog_result_list" %> |
7 | 7 | ||
8 | <div id="software-pagination"> | 8 | <div id="software-pagination"> |
9 | <% if params[:display] != 'map' %> | 9 | <% if params[:display] != 'map' %> |