@@ -21,7 +21,7 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
2121 construct : function ( ) {
2222 this . base ( arguments ) ;
2323
24- const layout = new qx . ui . layout . VBox ( 15 ) ;
24+ const layout = new qx . ui . layout . VBox ( 10 ) ;
2525 this . _setLayout ( layout ) ;
2626
2727 this . __populateLayout ( ) ;
@@ -56,6 +56,7 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
5656 if ( anatomicalModelsData && anatomicalModelsData [ "licensedResources" ] . length ) {
5757 this . __addModelsInfo ( anatomicalModelsData ) ;
5858 this . __addPricingUnits ( anatomicalModelsData ) ;
59+ this . __addSeatsSection ( anatomicalModelsData ) ;
5960 } else {
6061 const selectModelLabel = new qx . ui . basic . Label ( ) . set ( {
6162 value : this . tr ( "Select a model for more details" ) ,
@@ -301,15 +302,6 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
301302 alignX : "center"
302303 } ) ) ;
303304
304- anatomicalModelsData [ "purchases" ] . forEach ( purchase => {
305- const seatsText = "seat" + ( purchase [ "numberOfSeats" ] > 1 ? "s" : "" ) ;
306- const entry = new qx . ui . basic . Label ( ) . set ( {
307- value : `${ purchase [ "numberOfSeats" ] } ${ seatsText } available until ${ osparc . utils . Utils . formatDate ( purchase [ "expiresAt" ] ) } ` ,
308- font : "text-14" ,
309- } ) ;
310- importSection . add ( entry ) ;
311- } ) ;
312-
313305 const importButton = new qx . ui . form . Button ( ) . set ( {
314306 label : this . tr ( "Import" ) ,
315307 appearance : "strong-button" ,
@@ -330,5 +322,22 @@ qx.Class.define("osparc.vipMarket.AnatomicalModelDetails", {
330322 }
331323 return importSection ;
332324 } ,
325+
326+ __addSeatsSection : function ( anatomicalModelsData ) {
327+ const seatsSection = new qx . ui . container . Composite ( new qx . ui . layout . VBox ( 5 ) . set ( {
328+ alignX : "center" ,
329+ } ) ) ;
330+
331+ anatomicalModelsData [ "purchases" ] . forEach ( purchase => {
332+ const seatsText = "seat" + ( purchase [ "numberOfSeats" ] > 1 ? "s" : "" ) ;
333+ const entry = new qx . ui . basic . Label ( ) . set ( {
334+ value : `${ purchase [ "numberOfSeats" ] } ${ seatsText } available until ${ osparc . utils . Utils . formatDate ( purchase [ "expiresAt" ] ) } ` ,
335+ font : "text-14" ,
336+ } ) ;
337+ seatsSection . add ( entry ) ;
338+ } ) ;
339+
340+ this . _add ( seatsSection ) ;
341+ } ,
333342 }
334343} ) ;
0 commit comments