@@ -185,6 +185,13 @@ const getTableActions = (item, path) => {
185185 title : 'Datenblatt anzeigen' ,
186186 target : '_blank'
187187 } ,
188+ {
189+ link : path + 'add-and-activate-for-all-schools/' + item . id ,
190+ class : 'btn-add-and-activate-tool-for-all-schools' ,
191+ icon : 'plus-square-o' ,
192+ title : 'für alle Schulen hinzufügen und aktivieren' ,
193+ isSimpleButton : true
194+ } ,
188195 {
189196 link : path + item . id ,
190197 class : 'btn-delete' ,
@@ -377,6 +384,14 @@ const getMediumMedataHandler = (req, res) => {
377384 } ) ;
378385}
379386
387+ const addAndActivateToolForAllSchools = ( req , res , next ) => {
388+ const toolId = req . params . id ;
389+
390+ api ( req , { version : 'v3' } ) . patch ( `/tools/add-and-activate-for-all-schools/${ toolId } ` )
391+ . then ( ( ) => { res . redirect ( '/ctltools' ) } )
392+ . catch ( err => { next ( err ) ; } ) ;
393+ }
394+
380395router . use ( authHelper . authChecker ) ;
381396
382397router . get ( '/search' , showTools ) ;
@@ -386,6 +401,7 @@ router.get('/:id', getDetailHandler);
386401router . delete ( '/:id' , getDeleteHandler ) ;
387402router . post ( '/' , getCreateHandler ) ;
388403router . get ( '/:id/datasheet' , getDatasheet ) ;
404+ router . patch ( '/add-and-activate-for-all-schools/:id' , addAndActivateToolForAllSchools ) ;
389405
390406router . all ( '/' , showTools ) ;
391407
0 commit comments