Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Improve taxonomy page, fix static portal name, detect description link #850

Merged
merged 4 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion app/assets/stylesheets/taxonomy.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,18 @@
}
.taxonomy-card .description{
color: #666666;
padding-bottom: 5px;
}

.taxonomy-card .descriptionlink svg{
margin: 0px 2px;
height: 19px;
}

.taxonomy-card .descriptionlink svg path{
fill: #666666;
}
.category-link{
color: #666666 !important;
}
.taxonomy-slice-svg{
width: 35px;
Expand Down
1 change: 1 addition & 0 deletions app/components/display/taxonomy_card_component.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class Display::TaxonomyCardComponent < ViewComponent::Base
include UrlsHelper
def initialize(taxonomy: , ontologies_names: )
@taxonomy = taxonomy
@ontologies_names = ontologies_names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@
= "#{@taxonomy.name} (#{@taxonomy.acronym})"
%a{href: "https://#{@taxonomy.acronym}.#{$UI_URL.sub("https://", "")}"}
= inline_svg_tag('icons/slices.svg', class: "taxonomy-slice-svg #{@taxonomy.is_slice ? '' : 'd-none'}")

- if link?(@taxonomy.description)
.descriptionlink
%a.category-link{href: @taxonomy.description, target: '_blank'}
= @taxonomy.description
= inline_svg_tag 'icons/external-link.svg'

%a.ontologies{href: "/ontologies?#{@taxonomy.id.split('/')[-2]}=#{@taxonomy.acronym}"}
= inline_svg_tag('icons/ontology.svg')
.number-of-ontologies
= "#{@taxonomy.ontologies.length} ontologies"
.description
= render TextAreaFieldComponent.new(value: @taxonomy.description)

- unless link?(@taxonomy.description)
.description.mb-1
= render TextAreaFieldComponent.new(value: @taxonomy.description)

.ontologies-cards
- @taxonomy.ontologies.each_with_index do |ontology, index|
- if index>10
Expand Down
2 changes: 1 addition & 1 deletion app/views/taxonomy/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
= t('taxonomy.groups_and_categories')
.line
.taxonomy-page-decription
= t('taxonomy.description')
= t('taxonomy.description', portal: portal_name)

= render TabsContainerComponent.new do |c|
- c.item(title: 'Groups', selected: !@category_section_active)
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@ en:
privacy_policy_anchor: "#h-privacy-policy"
taxonomy:
groups_and_categories: Groups and Categories
description: In AgroPortal, ontologies are organized in groups and tagged with categories. Typically, groups associate ontologies from the same project or organization for better identification of the provenance. Whereas categories are about subjects/topics and enable to classify ontologies. As of 2016, AgroPortal's categories were established in cooperation with FAO AIMS. In 2024, we moved to UNESCO nomenclature for fields of science and technology. Groups and categories, along with other metadata, can be used on the “Browse” page of AgroPortal to filter out the list of ontologies.
description: "In %{portal}, ontologies are organized in groups and tagged with categories. Typically, groups associate ontologies from the same project or organization for better identification of the provenance. Whereas categories are about subjects/topics and enable to classify ontologies. As of 2016, %{portal}'s categories were established in cooperation with FAO AIMS. In 2024, we moved to UNESCO Thesaurus (https://vocabularies.unesco.org). Groups and categories, along with other metadata, can be used on the “Browse” page of %{portal} to filter out the list of ontologies."
show_sub_categories: Show sub categories

federation:
Expand Down
2 changes: 1 addition & 1 deletion config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ fr:
privacy_policy_anchor: "#h-vie-privee"
taxonomy:
groups_and_categories: Groupes et Catégories
description: Dans AgroPortal, les ontologies sont organisées en groupes et étiquetées avec des catégories. Typiquement, les groupes associent des ontologies provenant du même projet ou de la même organisation pour une meilleure identification de la provenance. Tandis que les catégories concernent des sujets/thématiques et permettent de classifier les ontologies. En 2016, les catégories d'AgroPortal ont été établies en coopération avec FAO AIMS. En 2024, nous sommes passés à la nomenclature de l'UNESCO pour les domaines des sciences et des technologies. Les groupes et les catégories, ainsi que d'autres métadonnées, peuvent être utilisés sur la page “Parcourir” d'AgroPortal pour filtrer la liste des ontologies.
description: "Dans %{portal}, les ontologies sont organisées en groupes et étiquetées avec des catégories. Typiquement, les groupes associent des ontologies provenant du même projet ou de la même organisation pour une meilleure identification de la provenance. Tandis que les catégories concernent des sujets/thématiques et permettent de classifier les ontologies. En 2016, les catégories d'%{portal} ont été établies en coopération avec FAO AIMS. En 2024, nous sommes passés au Thésaurus de l'UNESCO (https://vocabularies.unesco.org). Les groupes et les catégories, ainsi que d'autres métadonnées, peuvent être utilisés sur la page “Parcourir” d'%{portal} pour filtrer la liste des ontologies."
show_sub_categories: Afficher les sous-catégories
federation:
results_from_external_portals: Résultats provenant de portails externes
Expand Down
Loading