diff --git a/app/assets/stylesheets/taxonomy.scss b/app/assets/stylesheets/taxonomy.scss index 50828b5ba..077b5bcda 100644 --- a/app/assets/stylesheets/taxonomy.scss +++ b/app/assets/stylesheets/taxonomy.scss @@ -111,14 +111,16 @@ .taxonomy-empty-illustration{ display: flex; - gap: 15px; flex-direction: column; align-items: center; justify-content: center; width: 100%; - margin-top: 40px; + .browse-empty-illustration { + margin-top: 40px; + } } + .taxonomy-empty-illustration-text{ color: var(--gray-color); diff --git a/app/helpers/components_helper.rb b/app/helpers/components_helper.rb index 8c04a869d..53a5e34cb 100644 --- a/app/helpers/components_helper.rb +++ b/app/helpers/components_helper.rb @@ -274,8 +274,8 @@ def properties_dropdown(id, title, tooltip, properties, is_open: false, &block) end end - def regular_button(id, value, variant: "secondary", state: "regular", size: "slim", &block) - render Buttons::RegularButtonComponent.new(id:id, value: value, variant: variant, state: state, size: size) do |btn| + def regular_button(id, value, variant: "secondary", state: "regular", size: "slim", href: nil, &block) + render Buttons::RegularButtonComponent.new(id:id, value: value, variant: variant, state: state, size: size, href: href) do |btn| capture(btn, &block) if block_given? end end diff --git a/app/views/taxonomy/_taxonomies.html.haml b/app/views/taxonomy/_taxonomies.html.haml index 4c16393c2..f6c0b3eb8 100644 --- a/app/views/taxonomy/_taxonomies.html.haml +++ b/app/views/taxonomy/_taxonomies.html.haml @@ -1,12 +1,10 @@ .taxonomy-section - if taxonomies.blank? .taxonomy-empty-illustration - = inline_svg_tag 'empty-box.svg' - .taxonomy-empty-illustration-text - No group is created yet - - if session[:user]&.admin? + = empty_state(t('taxonomy.no_taxonomy_created', type: type)) + - if current_user_admin? .taxonomy-empty-illustration-button - = render Buttons::RegularButtonComponent.new(id:'create-taxonomy', value: "Create #{type}", variant: "secondary", size: "slim", href: "/admin?section=#{type}") + = regular_button('create-taxonomy', "Create #{type}", variant: "secondary", size: "slim", href: "/admin?section=#{type}") - else - pairs, impairs = taxonomies.each_with_index.partition { |_, index| index.even? } - taxonomies_first_row = pairs.map(&:first) diff --git a/config/locales/en.yml b/config/locales/en.yml index 5269b506b..8bcd055c9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1480,7 +1480,7 @@ en: groups_and_categories: Groups and Categories 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 - + no_taxonomy_created: "No %{type} are created yet" federation: results_from_external_portals: Results from external portals not_responding: is not responding. diff --git a/config/locales/fr.yml b/config/locales/fr.yml index dc4724702..d471829cf 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1516,6 +1516,8 @@ fr: groups_and_categories: Groupes et Catégories 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 + no_taxonomy_created: "Aucun %{type} n'a encore été créé" + federation: results_from_external_portals: Résultats provenant de portails externes not_responding: ne répond pas.