Skip to content

Commit

Permalink
Feature: Move metrics section up in homepage and Summary page (#747)
Browse files Browse the repository at this point in the history
* in home page move metrics up and have news if not enabled

* move metrics section up in the summary page

* Update home statistics layout to improve balance and alignment

---------

Co-authored-by: Bilel KIHAL <[email protected]>
  • Loading branch information
syphax-bouazzouni and Bilelkihal authored Nov 7, 2024
1 parent aa7e247 commit ef83f95
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 55 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ i.fa.fa-caret-square-o-down {
.home-statistics-container > div {
display: flex;
align-items: start;
justify-content: center;
justify-content: flex-start;
flex-wrap: wrap;
}
.home-agroportal-figures{
Expand Down
103 changes: 51 additions & 52 deletions app/views/home/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,56 @@
= upload_ontology_button
.discover-ontologies
= discover_ontologies_button
.home-section
%h4
= t('home.agroportal_figures', site: current_slice_name || portal_name)
%hr.home-section-line/
.home-statistics-container
.home-statistics
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:ontologies_count])
%p= t("home.ontologies")
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:class_count])
%p= t("home.classes")
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:individuals_count])
%p= t("home.individuals")
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:properties_count])
%p= t("home.properties")
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:projects_count])
%p= t("home.projects")
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:mappings_count])
%p= t("home.mappings")
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:users_count])
%p= t("home.users")
.home-statistics-link.justify-content-end{style: @analytics.empty? && "visibility: hidden"}
= link_to t("home.see_details"),'/statistics', target: "_blank"

.home-section
%h4
Expand Down Expand Up @@ -125,57 +175,6 @@
= render LoaderComponent.new(type: 'pulsing')
%script{:async => "", :charset => "utf-8", :src => "https://platform.twitter.com/widgets.js"}

.home-section
%h4
= t('home.agroportal_figures', site: current_slice_name || portal_name)
%hr.home-section-line/
.home-statistics-container
.home-statistics
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:ontologies_count])
%p= t("home.ontologies")
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:class_count])
%p= t("home.classes")
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:individuals_count])
%p= t("home.individuals")
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:properties_count])
%p= t("home.properties")
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:projects_count])
%p= t("home.projects")
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:mappings_count])
%p= t("home.mappings")
.home-statistics-item
%hr/
%div
%h4
= format_number_abbreviated(@metrics[:users_count])
%p= t("home.users")
.home-statistics-link.justify-content-end{style: @analytics.empty? && "visibility: hidden"}
= link_to t("home.see_details"),'/statistics', target: "_blank"

- if slices_enabled?
.home-section
.home-section-title
Expand Down Expand Up @@ -238,4 +237,4 @@
}
function submitRecommender(){
document.getElementById("recommender_submit").click()
}
}
2 changes: 1 addition & 1 deletion app/views/ontologies/sections/_metadata.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
.summary-page-center
.summary-page-first-row
= render partial: 'ontologies/sections/metadata/ontology_description_section'
= render partial: 'ontologies/sections/metadata/ontology_metrics_section'
= render partial: 'ontologies/sections/metadata/ontology_fairness_section'
= render partial: 'ontologies/sections/metadata/ontology_relations_network'
= render partial: 'ontologies/sections/metadata/ontology_submissions_section'
= render partial: 'ontologies/sections/metadata/ontology_metrics_section'
.summary-page-second-row
= ontology_depiction_card
= properties_card(t('ontologies.sections.identifiers'),t("ontologies.sections.identifiers"), @identifiers) do |values|
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2023_11_30_210229) do
ActiveRecord::Schema[7.0].define(version: 2020_09_21_120918) do
create_table "analytics", id: :integer, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.string "segment"
t.string "action"
Expand Down

0 comments on commit ef83f95

Please sign in to comment.