-
-
<%= raw content.html_safe %>
-
-
-
- <% document_title = jurisprudence.short_title || jurisprudence.title %>
- <% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.strftime : jurisprudence.year %>
-
<%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %>
+
+
+
<%= raw content.html_safe %>
+
+
+
+ <% document_title = jurisprudence.short_title || jurisprudence.title %>
+ <% date_or_year = jurisprudence.docdate.present? ? jurisprudence.docdate.strftime : jurisprudence.year %>
+
<%= [document_title, jurisprudence.reference_number, date_or_year].join(", ") %>
- <% annotations.each do |annotation| %>
-
- <% annotated_documents_title = [] %>
- <% annotation.documents.each do |annotated_document| %>
- <% ad_title = annotated_document.short_title || annotated_document.title %>
- <% ad_date_or_year = annotated_document.docdate.present? ? annotated_document.docdate.strftime("%B %d, %Y") : annotated_document.year %>
- <% annotated_documents_title << [" citing #{ad_title}", annotated_document.reference_number, ad_date_or_year].join(", ") %>
- <% end %>
+ <% annotations.each do |annotation| %>
+
+ <% annotated_documents_title = [] %>
+ <% annotation.documents.each do |annotated_document| %>
+ <% ad_title = annotated_document.short_title || annotated_document.title %>
+ <% ad_date_or_year = annotated_document.docdate.present? ? annotated_document.docdate.strftime("%B %d, %Y") : annotated_document.year %>
+ <% annotated_documents_title << [" citing #{ad_title}", annotated_document.reference_number, ad_date_or_year].join(", ") %>
+ <% end %>
- <%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %>
- <%= raw [document_title(annotation), annotation.document.reference_number, date_or_year(annotation), annotation.phil_rep, annotated_documents_title].reject(&:blank?).join(', ') %>
-
+
<%= "#{annotation.annomarks.map { |annomark| "(#{annomark.code})" }.join(" ")}" %>
+ <%= raw [document_title(annotation), annotation.document.reference_number, date_or_year(annotation), annotation.phil_rep, annotated_documents_title].reject(&:blank?).join(', ') %>
+
- <% if annotation.editor_notes.present? %>
-
-
- Editor's Note:
-
-
-
- <%= raw annotation.editor_notes %>
-
+ <% if annotation.editor_notes.present? %>
+
+
+ Editor's Note:
+
+
+
+ <%= raw annotation.editor_notes %>
+
+
+ <% end %>
+ <% end %>
- <% end %>
- <% end %>
-
-
+
-
+
diff --git a/app/components/subjects_accordion_component/subjects_accordion_component.html.erb b/app/components/subjects_accordion_component/subjects_accordion_component.html.erb
index cea499a..b787429 100644
--- a/app/components/subjects_accordion_component/subjects_accordion_component.html.erb
+++ b/app/components/subjects_accordion_component/subjects_accordion_component.html.erb
@@ -5,12 +5,16 @@
" data-bs-toggle="collapse" data-bs-target="#<%= children_accordion_id %>"
data-controller="subjects" data-subject-parent-id="<%= search_result["id"] %>" data-accordion-target="#<%= accordion_body_id %>"
data-action="click->subjects#loadSubjectsAccordion">
- <%= link_to search_result["name"], custom_url, class: "accordion-link text-decoration-none text-dark d-block sub#{search_result["heirarchy_level"] + 1} clickable-link" %>
- <%= link_to ''.html_safe, new_subject_index_path(parent_id: search_result["id"]), class: "text-decoration-none d-block sub#{search_result["heirarchy_level"]} clickable-link position-absolute end-0 me-5" %>
+ <%= link_to search_result["name"], "#", class: "accordion-link text-decoration-none text-dark d-block sub#{search_result["heirarchy_level"] + 1} clickable-link",
+ data: { controller: "application", href: custom_url, action: "click->application#openLink" } %>
+ <%= link_to ''.html_safe, new_subject_index_path(parent_id: search_result["id"]),
+ class: "text-decoration-none d-block sub#{search_result["heirarchy_level"]} clickable-link position-absolute end-0 me-5" %>
<% else %>
- <%= link_to search_result["name"], custom_url, class: "accordion-link text-decoration-none text-dark d-block sub#{search_result["heirarchy_level"] + 1} clickable-link" %>
- <%= link_to '
'.html_safe, new_subject_index_path(parent_id: search_result["id"]), class: "text-decoration-none d-block sub#{search_result["heirarchy_level"]} clickable-link position-absolute end-0 non-toggle" %>
+ <%= link_to search_result["name"], custom_url, class: "accordion-link text-decoration-none text-dark d-block sub#{search_result["heirarchy_level"] + 1} clickable-link",
+ data: { controller: "application", href: custom_url, action: "click->application#openLink" } %>
+ <%= link_to '
'.html_safe, new_subject_index_path(parent_id: search_result["id"]),
+ class: "text-decoration-none d-block sub#{search_result["heirarchy_level"]} clickable-link position-absolute end-0 non-toggle" %>
<% end %>
diff --git a/app/components/subjects_offcanvas_accordion_component/subjects_offcanvas_accordion_component.html.erb b/app/components/subjects_offcanvas_accordion_component/subjects_offcanvas_accordion_component.html.erb
index 89905da..6f6d992 100644
--- a/app/components/subjects_offcanvas_accordion_component/subjects_offcanvas_accordion_component.html.erb
+++ b/app/components/subjects_offcanvas_accordion_component/subjects_offcanvas_accordion_component.html.erb
@@ -5,10 +5,12 @@
" data-bs-toggle="collapse" data-bs-target="#<%= children_accordion_id %>"
data-controller="subjects" data-subject-parent-id="<%= search_result["id"] %>" data-accordion-target="#<%= accordion_body_id %>"
data-action="click->subjects#loadSubjectsOffcanvasAccordion">
- <%= link_to search_result["name"], index_url, class: "accordion-link text-decoration-none text-dark d-block sub#{search_result["heirarchy_level"] + 1} clickable-link" %>
+ <%= link_to search_result["name"], "#", class: "accordion-link text-decoration-none text-dark d-block sub#{search_result["heirarchy_level"] + 1} clickable-link",
+ data: { controller: "application", href: index_url, action: "click->application#openLink" } %>
<% else %>
- <%= link_to search_result["name"], index_url, class: "accordion-link text-decoration-none text-dark d-block sub#{search_result["heirarchy_level"] + 1} clickable-link" %>
+ <%= link_to search_result["name"], "#", class: "accordion-link text-decoration-none text-dark d-block sub#{search_result["heirarchy_level"] + 1} clickable-link",
+ data: { controller: "application", href: index_url, action: "click->application#openLink" } %>
<% end %>
diff --git a/app/components/subjects_offcanvas_component/subjects_offcanvas_component.html.erb b/app/components/subjects_offcanvas_component/subjects_offcanvas_component.html.erb
index 3103d4a..4062251 100644
--- a/app/components/subjects_offcanvas_component/subjects_offcanvas_component.html.erb
+++ b/app/components/subjects_offcanvas_component/subjects_offcanvas_component.html.erb
@@ -15,10 +15,12 @@
data-controller="subjects" data-subject-parent-id="<%= root.id %>"
data-accordion-target="#<%= ['subjectsOffCanvasAccordionBody', root.id].join %>"
data-action="click->subjects#loadSubjectsOffcanvasAccordion">
- <%= link_to root.name, search_documents_path(subject_ids: root.id, is_index_table: true), class: "accordion-link text-decoration-none text-dark d-block sub1 clickable-link" %>
+ <%= link_to root.name, "#", class: "accordion-link text-decoration-none text-dark d-block sub1 clickable-link",
+ data: { controller: "application", href: search_documents_path(subject_ids: root.id, is_index_table: true), action: "click->application#openLink" } %>
<% else %>
- <%= link_to root.name, search_documents_path(subject_ids: root.id, is_index_table: true), class: "accordion-link text-decoration-none text-dark d-block sub1 clickable-link" %>
+ <%= link_to root.name, search_documents_path(subject_ids: root.id, is_index_table: true), class: "accordion-link text-decoration-none text-dark d-block sub1 clickable-link",
+ data: { controller: "application", href: search_documents_path(subject_ids: root.id, is_index_table: true), action: "click->application#openLink" } %>
<% end %>
diff --git a/app/controllers/concerns/document_search.rb b/app/controllers/concerns/document_search.rb
index f490049..bbdc95b 100644
--- a/app/controllers/concerns/document_search.rb
+++ b/app/controllers/concerns/document_search.rb
@@ -16,8 +16,6 @@ module DocumentSearch
with(:citation_finders_names).any_of(sanitize_citer_finder_param(search_params[:citation_finder])) if search_params[:citation_finder].present?
- with(:is_only_in_premium_libraries, false)
-
if search_params[:sort_by].blank?
order_by :search_year, :desc
order_by :search_doc_date, :desc
diff --git a/app/controllers/concerns/jurisprudence_search.rb b/app/controllers/concerns/jurisprudence_search.rb
index 8f5101e..7c880a9 100644
--- a/app/controllers/concerns/jurisprudence_search.rb
+++ b/app/controllers/concerns/jurisprudence_search.rb
@@ -24,8 +24,6 @@ module JurisprudenceSearch
without(:id).any_of(search_params[:exclude_ids]) if search_params[:exclude_ids].present?
- with(:is_only_in_premium_libraries, false)
-
if search_params[:sort_by].blank?
order_by :search_year, :desc
order_by :search_doc_date, :desc
diff --git a/app/javascript/controllers/application_controller.js b/app/javascript/controllers/application_controller.js
index b8c87c0..12bfe9b 100644
--- a/app/javascript/controllers/application_controller.js
+++ b/app/javascript/controllers/application_controller.js
@@ -21,22 +21,6 @@ import Selectize from "selectize";
*/
export default class extends Controller {
connect () {
- $(".clickable-link").on("click", function (e) {
- e.preventDefault();
-
- let $href = $(this).attr("href");
- if ($href !== undefined) {
- window.location.href = $href;
- }
- });
-
- $(".clickable-tr").on("click", function () {
- let $href = $(this).attr("href");
- if ($href !== undefined) {
- window.open($href);
- }
- })
-
$(".reset-document-advanced-search").on("click", function (ev) {
ev.preventDefault()
@@ -54,6 +38,16 @@ export default class extends Controller {
StimulusReflex.register(this)
}
+ openLink ($event) {
+ $event.preventDefault()
+ window.location.href = this.element.dataset['href']
+ }
+
+ openLinkToNewTab ($event) {
+ $event.preventDefault()
+ window.open(this.element.dataset['href'])
+ }
+
/* Application-wide lifecycle methods
*
* Use these methods to handle lifecycle concerns for the entire application.
diff --git a/app/javascript/controllers/doctrines_controller.js b/app/javascript/controllers/doctrines_controller.js
index dc919c0..6fcdaf6 100644
--- a/app/javascript/controllers/doctrines_controller.js
+++ b/app/javascript/controllers/doctrines_controller.js
@@ -196,7 +196,6 @@ export default class extends ApplicationController {
content: $modal.find("input[name='document_title']").val(), phil_rep: $modal.find("#phil_rep").val(),
editor_notes: $modal.find("input[name='editor_notes']").val(), annomark_ids: $modal.find("select[name='annomark_ids[]']").val() }
- console.log(annotaitons_attributes_index.length)
if (annotaitons_attributes_index.length > 0) {
annotations_attributes.splice(annotaitons_attributes_index, 1, params)
$( ".toast-body" ).html( "