Skip to content

Commit

Permalink
extract discover ontologies button on home page to a helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilelkihal committed Jan 10, 2024
1 parent 2d5b4b3 commit 746d463
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 8 additions & 0 deletions app/helpers/home_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ def format_number_abbreviated(number)
end
end

def discover_ontologies_button
render Buttons::RegularButtonComponent.new(id: 'discover-ontologies-button', value: t('home.discover_ontologies_button'), variant: "secondary", state: "regular", href: "/ontologies") do |btn|
btn.icon_right do
inline_svg_tag "arrow-right.svg"
end
end
end

end
4 changes: 1 addition & 3 deletions app/views/home/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@
.home-upload-ontology-button
= upload_ontology_button
.discover-ontologies
= render Buttons::RegularButtonComponent.new(id: 'discover-ontologies-button', value: t('home.discover_ontologies_button'), variant: "secondary", state: "regular", href: "/ontologies") do |btn|
- btn.icon_right do
- inline_svg_tag "arrow-right.svg"
= discover_ontologies_button

.home-section
%h4
Expand Down

0 comments on commit 746d463

Please sign in to comment.