Browse Source

Merge pull request #137 from lexintegritastech/fix-ux-for-clickable-links

Fix `link` in `citator#tab`
pull/138/head
Alexander D. Bondoc 4 years ago committed by GitHub
parent
commit
6b4830b22a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      app/components/citation_index_table_component.rb
  2. 4
      app/components/citation_index_table_component/citation_index_table_component.html.erb

6
app/components/citation_index_table_component.rb

@ -20,4 +20,10 @@ class CitationIndexTableComponent < BaseComponent
def doctrine_annotations_path(doctrine_id)
doctrine_annotations_path(doctrine_id: doctrine_id)
end
def citator_path
return document_path(search_result.document.id, is_citator_tab: true) if search_result.document.present?
document_path(search_result.id, is_citator_tab: true)
end
end

4
app/components/citation_index_table_component/citation_index_table_component.html.erb

@ -1,4 +1,6 @@
<tr class="clickable-tr" data-controller="application" data-href="<%= document_path(search_result.id, is_citator_tab: true) %>" data-action="click->application#openLinkToNewTab">
<tr class="clickable-tr" data-controller="application"
data-href="<%= citator_path %>"
data-action="click->application#openLinkToNewTab">
<td> <%= clean_reference_number %> </td>
<td> <%= short_title || title %> </td>
<td> <%= date_or_year %> </td>

Loading…
Cancel
Save