File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
records_ui/templates/semantic-ui/invenio_app_rdm/records
theme/assets/semantic-ui/js/invenio_app_rdm/components Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 231231 < div class ="right floated right aligned column ">
232232
233233 {% if record_ui["ui"]["resource_type"] %}
234- < span role ="note "
235- class ="ui label horizontal small neutral mb-5 "
236- aria-label ="{{ _('Resource type') }} "
234+ {% set rt_id = record_ui["ui"]["resource_type"]["id"] %}
235+ {% if "-" in rt_id %}
236+ {% set rt_filter = "resource_type%3A" ~ rt_id.split("-")[0] ~ "%2Binner%3A" ~ rt_id %}
237+ {% else %}
238+ {% set rt_filter = "resource_type%3A" ~ rt_id %}
239+ {% endif %}
240+ < a href ="/search?q=&f={{ rt_filter }} "
241+ role ="note "
242+ class ="ui label horizontal small neutral mb-5 "
243+ aria-label ="{{ _('Resource type') }} "
237244 >
238245 {{ record_ui["ui"]["resource_type"]["title_l10n"] }}
239- </ span >
246+ </ a >
240247 {% endif %}
241248
242249 < span role ="note "
Original file line number Diff line number Diff line change @@ -47,6 +47,10 @@ class RecordsResultsListItem extends Component {
4747 "ui.resource_type.title_l10n" ,
4848 i18next . t ( "No resource type" )
4949 ) ;
50+ const resourceTypeId = _get ( result , "ui.resource_type.id" , "" ) ;
51+ const resourceTypeFilter = resourceTypeId . includes ( "-" )
52+ ? `resource_type%3A${ resourceTypeId . split ( "-" ) [ 0 ] } %2Binner%3A${ resourceTypeId } `
53+ : `resource_type%3A${ resourceTypeId } ` ;
5054 const subjects = _get ( result , "ui.subjects" , [ ] ) ;
5155 const title = _get ( result , "metadata.title" , i18next . t ( "No title" ) ) ;
5256 const version = _get ( result , "ui.version" , null ) ;
@@ -90,7 +94,13 @@ class RecordsResultsListItem extends Component {
9094 < Label horizontal size = "small" className = "primary theme-primary" >
9195 { publicationDate } ({ version } )
9296 </ Label >
93- < Label horizontal size = "small" className = "neutral" >
97+ < Label
98+ horizontal
99+ size = "small"
100+ className = "neutral"
101+ as = "a"
102+ href = { `/search?q=&f=${ resourceTypeFilter } ` }
103+ >
94104 { resourceType }
95105 </ Label >
96106 < Label
You can’t perform that action at this time.
0 commit comments