Skip to content

Commit

Permalink
Make it able to decorate search result description
Browse files Browse the repository at this point in the history
  • Loading branch information
mbajur committed Dec 12, 2024
1 parent 5bf62a7 commit 8eef68f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions app/components/inner_plan/searches/result_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def template
link_to(@result.title, @result, target: :_top)
end

div do
excerpt(@result.description, '')
end
description
end
end
end
Expand All @@ -46,6 +44,12 @@ def breadcrumbs

plain "#{parts.join(' – ')} · "
end

def description
div do
excerpt(@result.description, '')
end
end
end
end
end
2 changes: 1 addition & 1 deletion app/concepts/inner_plan/search/operation/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def apply_limit(ctx, scope:, **)

def apply_filter(ctx, scope:, params:, **)
ctx[:scope] = if params[:q].present?
scope.where('title LIKE ?', "%#{params[:q]}%")
scope.where('title iLIKE ?', "%#{params[:q]}%")
else
scope.none
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export default class extends Controller {
}

disconnect() {
this.element.removeEventListener('shown.bs.dropdown');
this.element.removeEventListener('hidden.bs.dropdown');
this.element.removeEventListener('shown.bs.dropdown', this.onDropdownShown.bind(this));
this.element.removeEventListener('hidden.bs.dropdown', this.onDropdownHidden.bind(this));
}

submit() {
Expand Down

0 comments on commit 8eef68f

Please sign in to comment.