From 0e00dd3f0cfdd6701c95912b37c977f2b9ca0e09 Mon Sep 17 00:00:00 2001 From: "Alexander D. Bondoc" Date: Wed, 18 May 2022 10:26:03 +0800 Subject: [PATCH] Fix `link` in `citator#tab` --- app/components/citation_index_table_component.rb | 6 ++++++ .../citation_index_table_component.html.erb | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/components/citation_index_table_component.rb b/app/components/citation_index_table_component.rb index 5bd50aa..d38d8c3 100644 --- a/app/components/citation_index_table_component.rb +++ b/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 diff --git a/app/components/citation_index_table_component/citation_index_table_component.html.erb b/app/components/citation_index_table_component/citation_index_table_component.html.erb index 41cfee9..cf59c5b 100644 --- a/app/components/citation_index_table_component/citation_index_table_component.html.erb +++ b/app/components/citation_index_table_component/citation_index_table_component.html.erb @@ -1,4 +1,6 @@ - + <%= clean_reference_number %> <%= short_title || title %> <%= date_or_year %>