Skip to content

Commit

Permalink
Feature: Add view badge to the summary header section (#526)
Browse files Browse the repository at this point in the history
* Distinguish views on the summary page

* fix image position issue in summary page
  • Loading branch information
Bilelkihal authored and syphax-bouazzouni committed Mar 25, 2024
1 parent 9be2752 commit 10a7220
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
1 change: 0 additions & 1 deletion app/assets/stylesheets/components/chip_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
color: var(--primary-color) !important;
font-weight: 500;
font-size: 15px;
cursor: grab;
display: inline;
}
.chip_button_container_clickable a{
Expand Down
1 change: 1 addition & 0 deletions app/assets/stylesheets/ontology_details_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
align-items: center;
font-size: 14px;
color: #888888;
margin-top: 12px;
}
.ontology-details-last-update img{
margin-right: 10px;
Expand Down
6 changes: 6 additions & 0 deletions app/views/layouts/ontology_viewer/_header.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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?)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 10a7220

Please sign in to comment.