forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ontology search input component re-using search-input component
- Loading branch information
1 parent
e57cbc3
commit 08bcb03
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
10 changes: 10 additions & 0 deletions
10
app/components/ontology_search_input_component/ontology_search_input_component.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |