Skip to content

Commit

Permalink
add ontology search input component re-using search-input component
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jun 27, 2023
1 parent e57cbc3 commit 08bcb03
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/components/ontology_search_input_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

class OntologySearchInputComponent < ViewComponent::Base

def initialize(name: 'search', placeholder: 'Search for an ontology or concept (Ex: Agrovoc ...)', scroll_down: true)
@name = name
@placeholder = placeholder
@scroll_down = scroll_down
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
= render SearchInputComponent.new(placeholder: @placeholder,
name: @name, scroll_down: @scroll_down,
actions_links: {search_ontology_content: "/search?query=o", see_all_ontologies: "/ontologies?search=o"}) do |s|

- s.template do
%a{href: "LINK", class: "home-search-ontology-content", 'data-turbo-frame': '_top'}
%p#seached-ontology.home-searched-ontology
NAME(ACRONYM)
%p.home-result-type
TYPE

0 comments on commit 08bcb03

Please sign in to comment.