File tree Expand file tree Collapse file tree 2 files changed +27
-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 +27
-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,15 @@ 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+
52+ const [ mainType ] = resourceTypeId . split ( "-" ) ;
53+ const filterValue = resourceTypeId . includes ( "-" )
54+ ? `resource_type:${ mainType } +inner:${ resourceTypeId } `
55+ : `resource_type:${ resourceTypeId } ` ;
56+
57+ const resourceTypeFilter = encodeURIComponent ( filterValue ) ;
58+
5059 const subjects = _get ( result , "ui.subjects" , [ ] ) ;
5160 const title = _get ( result , "metadata.title" , i18next . t ( "No title" ) ) ;
5261 const version = _get ( result , "ui.version" , null ) ;
@@ -90,7 +99,13 @@ class RecordsResultsListItem extends Component {
9099 < Label horizontal size = "small" className = "primary theme-primary" >
91100 { publicationDate } ({ version } )
92101 </ Label >
93- < Label horizontal size = "small" className = "neutral" >
102+ < Label
103+ horizontal
104+ size = "small"
105+ className = "neutral"
106+ as = "a"
107+ href = { `/search?q=&f=${ resourceTypeFilter } ` }
108+ >
94109 { resourceType }
95110 </ Label >
96111 < Label
You can’t perform that action at this time.
0 commit comments