Skip to content

Commit

Permalink
add registration template info to search result card
Browse files Browse the repository at this point in the history
  • Loading branch information
adlius committed Aug 9, 2023
1 parent b0c5f89 commit 66b8bd8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/models/search-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ export default class SearchResultModel extends Model {
get hasSupplementalResource() {
return this.resourceMetadata.hasSupplementalResource;
}

get registrationTemplate() {
return this.resourceMetadata['https://osf.io/vocab/2022/registration_type']?.[0]?.['@value'];
}
}

declare module 'ember-data/types/registries/model' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
</InlineList>
</div>
{{/if}}
<div>
<span>{{t 'osf-components.search-result-card.registration_template'}}:</span>
</div>
{{#if @result.registrationTemplate}}
<div>
<span>{{t 'osf-components.search-result-card.registration_template'}}: {{@result.registrationTemplate}}</span>
</div>
{{/if}}
{{#if @result.license}}
<div>
<span>{{t 'osf-components.search-result-card.license'}}: <a href={{@result.license.identifier}} target='_blank' rel='noopener noreferrer'>{{@result.license.name}}</a></span>
Expand Down

0 comments on commit 66b8bd8

Please sign in to comment.