-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CR feedback; Refactor secondary metatadata components
- Loading branch information
1 parent
4a77892
commit fe8e44b
Showing
11 changed files
with
419 additions
and
336 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
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
109 changes: 57 additions & 52 deletions
109
lib/osf-components/addon/components/search-result-card/file-secondary-metadata/template.hbs
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,52 +1,57 @@ | ||
<dl> | ||
{{#if @result.fileTitle}} | ||
<dt>{{t 'osf-components.search-result-card.title'}}</dt> | ||
<dd>{{@result.fileTitle}}</dd> | ||
{{/if}} | ||
{{#if @result.description}} | ||
<dt>{{t 'osf-components.search-result-card.description'}}</dt> | ||
<dd local-class='description'>{{@result.description}}</dd> | ||
{{/if}} | ||
{{#if @result.nodeFunders}} | ||
<dt>{{t 'osf-components.search-result-card.funder'}}</dt> | ||
<dd> | ||
<InlineList | ||
@items={{@result.nodeFunders}} | ||
@total={{@result.nodeFunders.count}} | ||
@truncate={{5}} | ||
as |list| | ||
> | ||
{{#if list.item}} | ||
<a href={{list.item.identifier}} target='_blank' rel='noopener noreferrer'>{{list.item.name}}</a> | ||
{{else if list.remainingCount}} | ||
{{t 'osf-components.search-result-card.remaining_count' count=list.remainingCount}} | ||
{{/if}} | ||
</InlineList> | ||
</dd> | ||
{{/if}} | ||
{{#if @result.resourceNature}} | ||
<dt>{{t 'osf-components.search-result-card.resource_type'}}</dt> | ||
<dd>{{@result.resourceNature}}</dd> | ||
{{/if}} | ||
{{#if @result.nodeLicense}} | ||
<dt>{{t 'osf-components.search-result-card.license'}}</dt> | ||
<dd><a href={{@result.nodeLicense.identifier}} target='_blank' rel='noopener noreferrer'>{{@result.nodeLicense.name}}</a></dd> | ||
{{/if}} | ||
{{#if @result.absoluteUrl}} | ||
<dt>{{t 'osf-components.search-result-card.url'}}</dt> | ||
<dd><a href={{@result.absoluteUrl}} target='_blank' rel='noopener noreferrer'>{{@result.absoluteUrl}}</a></dd> | ||
{{/if}} | ||
{{#if @result.doi}} | ||
<dt>{{t 'osf-components.search-result-card.doi'}}</dt> | ||
<dd> | ||
<InlineList | ||
@items={{@result.doi}} | ||
@total={{@result.doi.count}} | ||
@truncate={{5}} | ||
as |list| | ||
> | ||
<a href={{list.item}} target='_blank' rel='noopener noreferrer'>{{list.item}}</a> | ||
</InlineList> | ||
</dd> | ||
{{/if}} | ||
</dl> | ||
<CpPanel class={{@wrapperClass}} id={{@wrapperId}} @open={{@isOpen}} as |panel|> | ||
<panel.body> | ||
<hr> | ||
<dl> | ||
{{#if @result.fileTitle}} | ||
<dt>{{t 'osf-components.search-result-card.title'}}</dt> | ||
<dd>{{@result.fileTitle}}</dd> | ||
{{/if}} | ||
{{#if @result.description}} | ||
<dt>{{t 'osf-components.search-result-card.description'}}</dt> | ||
<dd local-class='description'>{{@result.description}}</dd> | ||
{{/if}} | ||
{{#if @result.nodeFunders}} | ||
<dt>{{t 'osf-components.search-result-card.funder'}}</dt> | ||
<dd> | ||
<InlineList | ||
@items={{@result.nodeFunders}} | ||
@total={{@result.nodeFunders.count}} | ||
@truncate={{5}} | ||
as |list| | ||
> | ||
{{#if list.item}} | ||
<a href={{list.item.identifier}} target='_blank' rel='noopener noreferrer'>{{list.item.name}}</a> | ||
{{else if list.remainingCount}} | ||
{{t 'osf-components.search-result-card.remaining_count' count=list.remainingCount}} | ||
{{/if}} | ||
</InlineList> | ||
</dd> | ||
{{/if}} | ||
{{#if @result.resourceNature}} | ||
<dt>{{t 'osf-components.search-result-card.resource_type'}}</dt> | ||
<dd>{{@result.resourceNature}}</dd> | ||
{{/if}} | ||
{{#if @result.nodeLicense}} | ||
<dt>{{t 'osf-components.search-result-card.license'}}</dt> | ||
<dd><a href={{@result.nodeLicense.identifier}} target='_blank' rel='noopener noreferrer'>{{@result.nodeLicense.name}}</a></dd> | ||
{{/if}} | ||
{{#if @result.absoluteUrl}} | ||
<dt>{{t 'osf-components.search-result-card.url'}}</dt> | ||
<dd><a href={{@result.absoluteUrl}} target='_blank' rel='noopener noreferrer'>{{@result.absoluteUrl}}</a></dd> | ||
{{/if}} | ||
{{#if @result.doi}} | ||
<dt>{{t 'osf-components.search-result-card.doi'}}</dt> | ||
<dd> | ||
<InlineList | ||
@items={{@result.doi}} | ||
@total={{@result.doi.count}} | ||
@truncate={{5}} | ||
as |list| | ||
> | ||
<a href={{list.item}} target='_blank' rel='noopener noreferrer'>{{list.item}}</a> | ||
</InlineList> | ||
</dd> | ||
{{/if}} | ||
</dl> | ||
</panel.body> | ||
</CpPanel> |
Oops, something went wrong.