Skip to content

Commit

Permalink
add ontology contacts and format to the ontology card
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Apr 19, 2023
1 parent ac4e2e7 commit 8605597
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
27 changes: 14 additions & 13 deletions app/assets/stylesheets/browse.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
.browse-submit-new-ontology-and-you-are-admin-container{
display: flex;
margin-bottom: 20px;

}

.browse-desc-text{
Expand Down Expand Up @@ -51,13 +51,13 @@
.browse-you-are-admin h3{
font-size: 20px;
font-weight: 600;

}
.browse-you-are-admin div{
display: flex;

align-items: center;

}
.browse-you-are-admin div p{
margin-left: 20px;
Expand Down Expand Up @@ -112,12 +112,12 @@
.browse-first-row{
width: 300px;
margin-right: 20px;

}

.browse-second-row{
width: 846px;

}

#browse-title-line{
Expand Down Expand Up @@ -157,7 +157,7 @@
.browse-uploaded{
font-size: 13px;
height: 37px;
width: 160px;
max-width: 400px;
background-color: #E7E7E7;
border-radius: 5px;
display: flex;
Expand All @@ -169,6 +169,7 @@
}
.browse-uploaded-date{
font-weight: 600;
white-space: nowrap;
}
.browse-ontology-cards{
display: grid;
Expand Down Expand Up @@ -267,7 +268,7 @@
display: flex;
align-items: center;
justify-content: center;

border-radius: 14px;
padding: 20px;
background-color: var(--primary-color);
Expand All @@ -285,7 +286,7 @@
border-radius: 5px;
padding: 14px 20px;
margin-bottom: 10px;


}
.browse-filter-checks-container{
Expand Down Expand Up @@ -374,9 +375,9 @@
width: 24vw;
margin-right: 20px;
}

.browse-second-row{
width: 68vw;
width: 68vw;
}
.browse-search-bar input{
width: 94vw;
Expand Down Expand Up @@ -418,7 +419,7 @@
width:46vw;
box-shadow: rgba(100, 100, 111, 0.1) 0px 7px 29px 0px;
}

.browse-sub-container{
margin-top: 20px;
}
Expand All @@ -444,6 +445,6 @@
.browse-ontology-view{
margin-right: 0;
}

}

4 changes: 1 addition & 3 deletions app/controllers/ontologies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ def ontologies_filter
o[:submissionStatusFormatted] = submission_status2string(sub).gsub(/\(|\)/, '')

o[:format] = sub.hasOntologyLanguage
else
# Used to sort ontologies without submissions to the end when sorting on upload date
o[:creationDate] = DateTime.parse('19900601')
o[:contact] = sub.contact.map{|c| c.name}.first
end

@ontologies << o
Expand Down
19 changes: 15 additions & 4 deletions app/views/ontologies/_ontologies.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,21 @@
%p.browse-fair-score
= ontology[:fairScore]
%a.browse-fair-details{:href => "/ontologies/#{ontology[:acronym]}#fair-details"} FAIR details ...
.browse-uploaded
%p Uploaded:
%p.browse-uploaded-date
= ontology[:creationDate].to_s[0, 10]
.d-flex.align-items-baseline
- if ontology[:creationDate]
.browse-uploaded
%p.mr-1 Uploaded
%p.browse-uploaded-date{data:{controller: 'timeago', 'timeago-datetime-value': ontology[:creationDate], 'timeago-add-suffix-value': 'true'}}
- if ontology[:contact]
%p.mx-1 by
%p.browse-uploaded-date.text-truncate
= ontology[:contact].humanize


- if ontology[:format]
.browse-ontology-view
= ontology[:format]

.browse-ontology-cards
- if ontology[:format] != 'SKOS' && ontology[:class_count] > 0
%a.browse-onology-card{:href => "/ontologies/#{ontology[:acronym]}?p=classes"}
Expand Down

0 comments on commit 8605597

Please sign in to comment.