forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use turbo streams to update ontologies result and the filters counts
- Loading branch information
1 parent
4408de7
commit e7d3f5e
Showing
2 changed files
with
86 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,76 @@ | ||
= turbo_frame_tag "search-results" do | ||
%p.browse-desc-text{:style => "margin-bottom: 15px;"} | ||
= "Showing "+ @ontologies.length.to_s | ||
-# Here we put our turbo frame "ontologies_frame" | ||
%div | ||
- @ontologies.each do |ontology| | ||
.browse-ontology-container | ||
.browse-ontology-description | ||
.browse-ontology-title-bar | ||
%a.browse-ontology-title{:href => "/ontologies/#{ontology[:acronym]}", data: {'turbo-frame': '_top'}} | ||
= ontology[:name]+" ("+ontology[:acronym]+")" | ||
- if ontology[:deprecated] | ||
.browse-ontology-deprecated | ||
deprecated | ||
- if ontology[:viewOfOnt] | ||
.browse-ontology-view | ||
view | ||
.browse-desc-container{data:{controller:"text-truncate", 'text-truncate-more-text-value': '+ Show more ...' , 'text-truncate-less-text-value': '- Show less ...'}} | ||
%p.browse-desc-text{'data-text-truncate-target': 'content'} | ||
= ontology[:description] | ||
.browse-show-more-button{data:{'text-truncate-target': 'button', 'action':"click->text-truncate#toggle"}} | ||
+ Show more ... | ||
%p.browse-desc-text{:style => "margin-bottom: 15px;"} | ||
= "Showing "+ @ontologies.length.to_s | ||
%div | ||
- @ontologies.each do |ontology| | ||
.browse-ontology-container | ||
.browse-ontology-description | ||
.browse-ontology-title-bar | ||
%a.browse-ontology-title{:href => "/ontologies/#{ontology[:acronym]}", data: {'turbo-frame': '_top'}} | ||
= ontology[:name]+" ("+ontology[:acronym]+")" | ||
- if ontology[:deprecated] | ||
.browse-ontology-deprecated | ||
deprecated | ||
- if ontology[:viewOfOnt] | ||
.browse-ontology-view | ||
view | ||
.browse-desc-container{data:{controller:"text-truncate", 'text-truncate-more-text-value': '+ Show more ...' , 'text-truncate-less-text-value': '- Show less ...'}} | ||
%p.browse-desc-text{'data-text-truncate-target': 'content'} | ||
= ontology[:description] | ||
.browse-show-more-button{data:{'text-truncate-target': 'button', 'action':"click->text-truncate#toggle"}} | ||
+ Show more ... | ||
|
||
|
||
- unless ontology[:fairScore].nil? || ontology[:acronym] == 'AGROVOC' | ||
.browse-fair | ||
%p.browse-fair-title | ||
FAIR score | ||
.browse-progress-bar | ||
.browse-faire-progress{:style => "width: #{ontology[:normalizedFairScore].to_s+"%"}"} | ||
%p.browse-fair-score | ||
= ontology[:fairScore] | ||
%a.browse-fair-details{:href => "/ontologies/#{ontology[:acronym]}#fair-details"} FAIR details ... | ||
.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 | ||
- unless ontology[:fairScore].nil? || ontology[:acronym] == 'AGROVOC' | ||
.browse-fair | ||
%p.browse-fair-title | ||
FAIR score | ||
.browse-progress-bar | ||
.browse-faire-progress{:style => "width: #{ontology[:normalizedFairScore].to_s+"%"}"} | ||
%p.browse-fair-score | ||
= ontology[:fairScore] | ||
%a.browse-fair-details{:href => "/ontologies/#{ontology[:acronym]}#fair-details"} FAIR details ... | ||
.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] | ||
- 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"} | ||
%p.browse-card-number | ||
= ontology[:class_count_formatted] | ||
%p.browse-card-text | ||
classes | ||
- if ontology[:individual_count] > 0 | ||
%a.browse-onology-card{:href => "/ontologies/#{ontology[:acronym]}?p=classes"} | ||
%p.browse-card-number | ||
= ontology[:individual_count_formatted] | ||
%p.browse-card-text | ||
= ontology[:format] == 'SKOS' ? "concepts" : "instances" | ||
- if ontology[:project_count] > 0 | ||
%a.browse-onology-card{:href => "/ontologies/#{ontology[:acronym]}#projects_content"} | ||
%p.browse-card-number | ||
= ontology[:project_count] | ||
%p.browse-card-text | ||
projects | ||
- if ontology[:note_count] > 0 | ||
%a.browse-onology-card{:href => "#"} | ||
%p.browse-card-number | ||
= ontology[:note_count] | ||
%p.browse-card-text | ||
notes | ||
.browse-ontology-cards | ||
- if ontology[:format] != 'SKOS' && ontology[:class_count] > 0 | ||
%a.browse-onology-card{:href => "/ontologies/#{ontology[:acronym]}?p=classes"} | ||
%p.browse-card-number | ||
= ontology[:class_count_formatted] | ||
%p.browse-card-text | ||
classes | ||
- if ontology[:individual_count] > 0 | ||
%a.browse-onology-card{:href => "/ontologies/#{ontology[:acronym]}?p=classes"} | ||
%p.browse-card-number | ||
= ontology[:individual_count_formatted] | ||
%p.browse-card-text | ||
= ontology[:format] == 'SKOS' ? "concepts" : "instances" | ||
- if ontology[:project_count] > 0 | ||
%a.browse-onology-card{:href => "/ontologies/#{ontology[:acronym]}#projects_content"} | ||
%p.browse-card-number | ||
= ontology[:project_count] | ||
%p.browse-card-text | ||
projects | ||
- if ontology[:note_count] > 0 | ||
%a.browse-onology-card{:href => "#"} | ||
%p.browse-card-number | ||
= ontology[:note_count] | ||
%p.browse-card-text | ||
notes | ||
|
||
%div.empty-state | ||
.browse-empty-illustration | ||
%img{:src => "#{asset_path("empty-box.svg")}"} | ||
%p No result was found | ||
%div.empty-state | ||
.browse-empty-illustration | ||
%img{:src => "#{asset_path("empty-box.svg")}"} | ||
%p No result was found |