From 10a7220f49d429bae313d759dcafd65f851b3827 Mon Sep 17 00:00:00 2001 From: Bilel Kihal <61744974+Bilelkihal@users.noreply.github.com> Date: Mon, 25 Mar 2024 09:57:04 +0100 Subject: [PATCH] Feature: Add view badge to the summary header section (#526) * Distinguish views on the summary page * fix image position issue in summary page --- .../stylesheets/components/chip_button.scss | 1 - .../stylesheets/ontology_details_header.scss | 1 + .../layouts/ontology_viewer/_header.html.haml | 6 +++++ .../_ontology_description_section.html.haml | 25 +++++++++++-------- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/app/assets/stylesheets/components/chip_button.scss b/app/assets/stylesheets/components/chip_button.scss index 6ef85174d..4f3fe0410 100644 --- a/app/assets/stylesheets/components/chip_button.scss +++ b/app/assets/stylesheets/components/chip_button.scss @@ -23,7 +23,6 @@ color: var(--primary-color) !important; font-weight: 500; font-size: 15px; - cursor: grab; display: inline; } .chip_button_container_clickable a{ diff --git a/app/assets/stylesheets/ontology_details_header.scss b/app/assets/stylesheets/ontology_details_header.scss index 3f87f5017..179856d4a 100644 --- a/app/assets/stylesheets/ontology_details_header.scss +++ b/app/assets/stylesheets/ontology_details_header.scss @@ -58,6 +58,7 @@ align-items: center; font-size: 14px; color: #888888; + margin-top: 12px; } .ontology-details-last-update img{ margin-right: 10px; diff --git a/app/views/layouts/ontology_viewer/_header.html.haml b/app/views/layouts/ontology_viewer/_header.html.haml index de094918a..dc56729b5 100644 --- a/app/views/layouts/ontology_viewer/_header.html.haml +++ b/app/views/layouts/ontology_viewer/_header.html.haml @@ -5,6 +5,10 @@ .ontology-details-header-container .ontology-details-path %a{href: "/ontologies"} ontologies + - if @ontology.viewOf + %img{src: asset_path("arrow-right-outlined.svg")}/ + %div + = @ontology.viewOf.split('/').last %img{src: asset_path("arrow-right-outlined.svg")}/ %div = @ontology.acronym @@ -15,6 +19,8 @@ = @ontology.name %span{data: { controller: 'tooltip'}, title: ontology_alternative_names} = "("+ @ontology.acronym+")" + - if @ontology.viewOf + = render ChipButtonComponent.new(class: 'chip_button_small mr-1', text: 'view', type: 'clickable', clickable: false) - if @ontology.private? = render ChipButtonComponent.new(class: 'chip_button_small mr-1') do = private_ontology_icon(@ontology.private?) diff --git a/app/views/ontologies/sections/metadata/_ontology_description_section.html.haml b/app/views/ontologies/sections/metadata/_ontology_description_section.html.haml index c0b4d946b..3f6cde411 100644 --- a/app/views/ontologies/sections/metadata/_ontology_description_section.html.haml +++ b/app/views/ontologies/sections/metadata/_ontology_description_section.html.haml @@ -2,21 +2,24 @@ - c.header(text: t("ontologies.sections.metadata.general_information")) = render Layout::ListComponent.new do |l| - l.row do - .d-flex.align-items-center - %div - - if @submission_latest&.abstract.blank? - .creation_text - = render TextAreaFieldComponent.new(value: @submission_latest&.description) - - else + %div + - if @submission_latest&.abstract.blank? + .creation_text.d-flex.align-items-center + = render TextAreaFieldComponent.new(value: @submission_latest&.description) + - unless @submission_latest&.logo.nil? || !link?(@submission_latest&.logo) + = image_tag(@submission_latest&.logo, class: 'description_img ml-2', width: '145px') + - else + .d-flex.align-items-center = render FieldContainerComponent.new(label: t("ontologies.sections.metadata.abstract")) do .creation_text = render TextAreaFieldComponent.new(value: @submission_latest&.abstract) - = render FieldContainerComponent.new(label: t("ontologies.sections.metadata.description")) do - .creation_text - = render TextAreaFieldComponent.new(value: @submission_latest&.description) + - unless @submission_latest&.logo.nil? || !link?(@submission_latest&.logo) + = image_tag(@submission_latest&.logo, class: 'description_img ml-2', width: '145px') + = render FieldContainerComponent.new(label: t("ontologies.sections.metadata.description")) do + .creation_text + = render TextAreaFieldComponent.new(value: @submission_latest&.description) - - unless @submission_latest&.logo.nil? || !link?(@submission_latest&.logo) - = image_tag(@submission_latest&.logo, class: 'description_img', width: '145px') + - l.row do