Skip to content

Commit

Permalink
Merge branch 'fix/taxonomy-empty-list' into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilelkihal committed Nov 25, 2024
2 parents 4d9b0fb + 9b1d123 commit 7c4252f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
6 changes: 4 additions & 2 deletions app/assets/stylesheets/taxonomy.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions app/helpers/components_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions app/views/taxonomy/_taxonomies.html.haml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7c4252f

Please sign in to comment.