Skip to content

Commit

Permalink
add tools page
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Apr 3, 2024
1 parent 2b676ce commit d672a34
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/assets/stylesheets/application.css.scss.erb
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@
@import "ontology_details_header";
@import "ontology_viewer";
@import "browse";
@import "tools";
@import "agent_tooltip";
/* Bootstrap and Font Awesome */
@import "bootstrap";
@import "bootstrap_overrides";
@import "agent_tooltip";

<% if (ui_theme = $UI_THEME.to_s.parameterize).present? && File.exists?(Rails.root.join('app', 'assets', 'stylesheets', 'themes', ui_theme)) %>
@import "themes/<%= ui_theme %>/main";
Expand Down
13 changes: 13 additions & 0 deletions app/assets/stylesheets/tools.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.tools-container{
svg path {
fill: var(--primary-color);
}
.summary-card{
height: 100%;
background-color: white;
}

.tool-description{
color: var(--gray-color) !important;
}
}
34 changes: 33 additions & 1 deletion app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def index
@upload_benefits = [
t('home.benefit1'),
t('home.benefit2'),
t('home.benefit3'),
t('home.benefit3'),
t('home.benefit4'),
t('home.benefit5')
]
Expand All @@ -39,6 +39,38 @@ def index

end

def tools
@tools = {
search: {
link: "search/ontologies/content",
icon: "icons/search.svg",
title: "Search content (coming)",
description: "This tool/service enables users to search for any Resource Description Framework (RDF) element within the portal.
Users can search by either the unique identifier (URI) associated with the RDF element or by its label.
It facilitates efficient navigation and retrieval of specific RDF elements, enhancing user experience and productivity within the portal.
",
},
converter: {
link: "/content_finder",
icon: "icons/settings.svg",
title: "Content converter (coming)",
description: "The Content Converter tool/service offers the capability to convert any RDF element into various formats such as RDF/XML, Turtle, Ntriples, or JSON.
This functionality allows users to transform RDF data into formats suitable for different purposes or compatible with various systems and applications.
It promotes interoperability and flexibility in handling RDF data within the portal ecosystem."
},
url_checker: {
link: check_resolvability_path,
icon: "check.svg",
title: "URI resolvability checker",
description: "This tool/service verifies the resolvability of Uniform Resource Identifiers (URIs) and their content negotiability.
It checks whether a given URI is accessible and whether the content associated with it can be negotiated based on the client's preferences.
This functionality ensures the reliability and accessibility of linked resources within the RDF ecosystem, aiding in maintaining data integrity and facilitating seamless integration with external resources."
}
}

@title = "#{helpers.portal_name} tools"
render 'tools', layout: 'tool'
end

def all_resources
@conceptid = params[:conceptid]
Expand Down
12 changes: 12 additions & 0 deletions app/views/home/tools.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
%div.d-flex.px-5.py-3.rounded.tools-container
- @tools.each_value do |tool|
= link_to tool[:link], class: "mx-2" do
= render Layout::CardComponent.new do |c|
- c.header do |h|
- h.text do
%div.d-flex.flex-column.align-items-center.text-primary
= inline_svg_tag(tool[:icon], height: "50px", width: "50px")
%h3.text-primary.mt-2
= tool[:title]
%p.px-4.tool-description
= tool[:description]
4 changes: 2 additions & 2 deletions app/views/layouts/tool.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
%div.p-5
%a.d-flex.flex-column.container-gradient.mx-auto.d-flex.justify-content-center.align-items-center{href: "/", style: 'width: 200px; height: 200px; border-radius: 100px;'}
%img{:src => asset_path("logo-white.svg"), style: 'width: 100px; height: 100px'}
%p.text-white.h3
= portal_name
%p.text-white.h3.text-center
= @title || portal_name
= yield


Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
root to: 'home#index'
mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development?

get'/tools', to: 'home#tools'
get 'auth/:provider/callback', to: 'login#create_omniauth'
get 'locale/:language', to: 'language#set_locale_language'
get 'metadata_export/index'
Expand Down

0 comments on commit d672a34

Please sign in to comment.