@@ -21,25 +21,41 @@ export default (el) => {
2121 ? html `< div class ="mb-3 ">
2222 < label class ="form-label "> ${ __ ( 'Available PubSub services:' ) } </ label >
2323 < div class ="list-group ">
24- ${ el . _entities . map ( /** @param {import('@converse/headless').DiscoEntity } entity */ ( entity ) => {
25- const jid = entity . get ( 'jid' ) ;
26- const features = entity . features
27- . map ( ( f ) => f . get ( 'var' ) )
28- . filter ( ( f ) => f . includes ( 'pubsub' ) ) ;
29- return html `< div class ="form-check ">
30- < input
31- class ="form-check-input "
32- type ="radio "
33- name ="pubsub_service "
34- id ="${ jid } "
35- value ="${ jid } "
36- />
37- < label class ="form-check-label fw-bold " for ="${ jid } "> ${ jid } </ label >
38- < ul class ="list-unstyled mt-2 text-muted small ">
39- ${ features . map ( ( feature ) => html `< li > ${ feature } </ li > ` ) }
40- </ ul >
41- </ div > ` ;
42- } ) }
24+ ${ el . _entities . map (
25+ /** @param {import('@converse/headless').DiscoEntity } entity */ ( entity ) => {
26+ const jid = entity . get ( 'jid' ) ;
27+ const features = entity . features
28+ . map ( ( f ) => f . get ( 'var' ) )
29+ . filter ( ( f ) => f . includes ( 'pubsub' ) ) ;
30+ return html `< div class ="form-check ">
31+ < input
32+ class ="form-check-input "
33+ type ="radio "
34+ name ="jid "
35+ id ="${ jid } "
36+ value ="${ jid } "
37+ />
38+ < label class ="form-check-label fw-bold " for ="${ jid } "> ${ jid } </ label >
39+ < button
40+ class ="btn btn-link p-0 "
41+ type ="button "
42+ data-bs-toggle ="collapse "
43+ data-bs-target ="#collapse- ${ jid } "
44+ aria-expanded ="false "
45+ aria-controls ="collapse- ${ jid } "
46+ >
47+ ${ __ ( 'Show Features' ) }
48+ </ button >
49+ < div class ="collapse " id ="collapse- ${ jid } ">
50+ < div class ="card card-body ">
51+ < ul class ="list-unstyled mt-2 text-muted small ">
52+ ${ features . map ( ( feature ) => html `< li > ${ feature } </ li > ` ) }
53+ </ ul >
54+ </ div >
55+ </ div >
56+ </ div > ` ;
57+ }
58+ ) }
4359 </ div >
4460 </ div > `
4561 : html `< div class ="mb-3 ">
0 commit comments