From 7f7adcff073c1dfe808b4822baf43b94ee02a903 Mon Sep 17 00:00:00 2001 From: Angel Aviel Domaoan Date: Mon, 28 Feb 2022 14:17:13 +0800 Subject: [PATCH] Remove syllabus --- .../document_advanced_search_component.html.erb | 11 +++-------- app/controllers/concerns/jurisprudence_search.rb | 6 +++--- app/controllers/documents_controller.rb | 2 +- app/models/cdao/citation_finder.rb | 2 +- app/models/cdao/jurisprudence.rb | 8 +++----- 5 files changed, 11 insertions(+), 18 deletions(-) diff --git a/app/components/document_advanced_search_component/document_advanced_search_component.html.erb b/app/components/document_advanced_search_component/document_advanced_search_component.html.erb index 478e65f..81c3dd1 100644 --- a/app/components/document_advanced_search_component/document_advanced_search_component.html.erb +++ b/app/components/document_advanced_search_component/document_advanced_search_component.html.erb @@ -12,17 +12,12 @@ <%= text_field_tag :title, params[:short_title], class: "form-control mb-0" %> - + <% if opts[:is_decisions_index].present? %>
<%= text_field_tag :ponente, params[:ponente], class: "form-control mb-0" %>
- -
- - <%= text_field_tag :syllabus, params[:syllabus], class: "form-control mb-0" %> -
<% end %>
@@ -30,7 +25,7 @@ <%= select_tag :year_start, options_for_select(years, params[:year_start]), class: "form-select", include_blank: true %>
- +
<%= select_tag :year_end, options_for_select(years, params[:year_end]), class: "form-select", include_blank: true %>
@@ -40,7 +35,7 @@ <%= text_field_tag :citation_finder, params[:citation_finder], class: "form-control mb-0" %> - +
diff --git a/app/controllers/concerns/jurisprudence_search.rb b/app/controllers/concerns/jurisprudence_search.rb index d80abe0..0b6b9c8 100644 --- a/app/controllers/concerns/jurisprudence_search.rb +++ b/app/controllers/concerns/jurisprudence_search.rb @@ -5,7 +5,7 @@ module JurisprudenceSearch search = Cdao::Jurisprudence.search do fulltext search_params[:q], fields: fulltext_fields if search_params[:q].present? - %i[reference_number title short_title ponente syllabus].each do |field| + %i[reference_number title short_title ponente].each do |field| fulltext search_params[field], fields: [field], query_phrase_slop: 1 if search_params[field].present? end @@ -22,9 +22,9 @@ module JurisprudenceSearch with(:citation_finders_names).any_of(search_params[:citation_finder]) if search_params[:citation_finder].present? without(:id).any_of(search_params[:exclude_ids]) if search_params[:exclude_ids].present? - + with(:is_only_in_premium_libraries, false) - + order_by :doc_date, :desc order_by :year, :desc diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index f102b36..71a9b66 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -33,7 +33,7 @@ class DocumentsController < ApplicationController private def search_params - params.permit(:reference_number, :title, :short_title, :ponente, :syllabus, + params.permit(:reference_number, :title, :short_title, :ponente, :year_start, :year_end, :citation_finder, :subject_ids, :q, :page, :per_page) end diff --git a/app/models/cdao/citation_finder.rb b/app/models/cdao/citation_finder.rb index cce8f54..deb2101 100644 --- a/app/models/cdao/citation_finder.rb +++ b/app/models/cdao/citation_finder.rb @@ -4,7 +4,7 @@ class Cdao::CitationFinder < Cdao::Base TYPES = %w[SCRA PhilRep].freeze belongs_to :jurisprudence, class_name: "Cdao::Jurisprudence", optional: false - delegate :title, :content, :ponente, :syllabus, :reference_number, :docdate, to: :jurisprudence + delegate :title, :content, :ponente, :reference_number, :docdate, to: :jurisprudence def display_name @display_name || set_display_name diff --git a/app/models/cdao/jurisprudence.rb b/app/models/cdao/jurisprudence.rb index 980a911..1ebaa2f 100644 --- a/app/models/cdao/jurisprudence.rb +++ b/app/models/cdao/jurisprudence.rb @@ -72,7 +72,7 @@ class Cdao::Jurisprudence < Cdao::Base doc.url Rails.application.routes.url_helpers.jurisprudence_path(self) end end - + def subjects doctrines.map(&:subjects).flatten.uniq end @@ -112,7 +112,7 @@ class Cdao::Jurisprudence < Cdao::Base end end end - + names end @@ -124,7 +124,7 @@ class Cdao::Jurisprudence < Cdao::Base def scra return "" if citation_finders.blank? - + citation_finders.where(citation_source_id: 0).map(&:display_name).join(' | ') end @@ -133,11 +133,9 @@ class Cdao::Jurisprudence < Cdao::Base text :title, stored: true text :short_title, stored: true text :ponente, stored: true - text :syllabus, stored: true string :reference_number string :ponente - string :syllabus string :title do (title.present? ? title.first(32760).strip : short_title || "").titleize end