app/views/partials/labeling/skos/_search_result.html.erb in iqvoc-4.2.0 vs app/views/partials/labeling/skos/_search_result.html.erb in iqvoc-4.3.0
- old
+ new
@@ -1,17 +1,13 @@
-<%- if owner = result.owner -%>
- <dt>
- <% case owner.class.name %>
- <% when Iqvoc::Concept.base_class_name %>
- <%= link_to highlight_query(result.target.value, params[:query]), concept_path(:id => owner) %>
- <% when Iqvoc::Collection.base_class_name %>
- <%= link_to highlight_query(result.target.value, params[:query]), collection_path(:id => owner) %>
+<% if owner = result.owner %>
+<li class="search-result" data-rdf-namespace="<%= result.rdf_namespace %>" data-rdf-predicate="<%= result.rdf_predicate %>" data-rdf-value="<%= result.to_s %>" data-rdf-language="<%= result.language %>">
+ <%= link_to_object(owner, result.target.value, :class => 'search-result-link', :data => { 'resource-path' => rdf_path(owner.origin, :lang => nil, :format => nil) }) %> <% if owner.additional_info.present? %>(<%= owner.additional_info %>)<% end %>
+ <dl class="search-result-meta">
+ <dt class="search-result-key"><%= t('txt.views.search_results.type') %></dt>
+ <dd class="search-result-value" data-key="<%= t('txt.views.search_results.type') %>"><%= result.model_name.human %></dd>
+ <% if result.target.language %>
+ <dt class="search-result-key"><%= t('txt.views.search_results.language') %></dt>
+ <dd class="search-result-value" data-key="<%= t('txt.views.search_results.language') %>"><%= result.target.language %></dd>
<% end %>
- <%- if owner.additional_info.present? -%>
- (<%= owner.additional_info %>)
- <%- end -%>
- </dt>
- <dd><%= t('txt.views.search_results.type') %>: <%= result.class.model_name.human %></dd>
- <%- if result.target.language -%>
- <dd><%= t('txt.views.search_results.language') %>: <%= result.target.language %></dd>
- <%- end -%>
-<%- end -%>
+ </dl>
+</li>
+<% end %>