]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5397 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 25 Jan 2023 12:23:51 +0000 (13:23 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 25 Jan 2023 12:23:51 +0000 (13:23 +0100)
public/packages/fluidbook/toolbox/css/context-menu.less [new file with mode: 0644]
public/packages/fluidbook/toolbox/css/style.less
public/packages/fluidbook/toolbox/js/contextdownload.js
resources/views/vendor/backpack/crud/buttons/fluidbook_publication/download.blade.php

diff --git a/public/packages/fluidbook/toolbox/css/context-menu.less b/public/packages/fluidbook/toolbox/css/context-menu.less
new file mode 100644 (file)
index 0000000..0edd223
--- /dev/null
@@ -0,0 +1,9 @@
+.context-menu-item {
+    span.small {
+        display: block;
+
+        span.grey {
+            opacity: 0.6;
+        }
+    }
+}
index d4392b6896f5f039921ea826614f233ab75def4f..ef6e29e101ee91a5c4404225b9034870beac672c 100644 (file)
@@ -441,4 +441,5 @@ body.embeded {
     left: 0px;
     right: 80%;
 }
+@import "context-menu";
 
index e030de7090dde88bd6fd36fce04802a9f8c56193..f4500d44206ca03546e3060b44132469da873676 100644 (file)
@@ -20,15 +20,16 @@ $(function () {
                     if (action.target === undefined) {
                         action.target = '_self';
                     }
+                    action.isHtmlName = true;
                 }
                 actions[key] = action;
             });
 
             $.each(actions, function (key, action) {
-                if(action!=='---------') {
-                    items[key] = {name: action.label};
-                }else{
-                    items[key]=action;
+                if (action !== '---------') {
+                    items[key] = {name: action.label, isHtmlName: true};
+                } else {
+                    items[key] = action;
                 }
             });
 
index 6a831304374d15cb5fc1abd0bfa4918fd8883afb..fd133dc5ac91303e559764c6ac53adf0524dc4de 100644 (file)
         ];
     foreach (\App\Models\FluidbookPublication::getDownloadVersions() as $k=>$v) {
         $actions['sep_download']='---------';
-        if($allVersions || $entry->{'download_'.$k}){
+        if($entry->{'download_'.$k}){
             $actions['download_'.$k]=[
                 'label'=>$v['label'],
                 'url'=>$basePackage.'/download/'.$k
                 ];
         }
     }
-    if(can('fluibook-publication:download:install-hosting')){
+    if(can('fluibook-publication:download:install-hosting') && ($entry->install_online_hosting || $entry->install_online_ftp || $entry->scorm_enable)){
         $actions['sep_install']='---------';
-        $actions['install_hosting']=[
-            'label'=>__('Installer sur le serveur d\'hébergement'),
-            'url'=> $basePackage.'/install_hosting/online',
-            ];
+        if($entry->install_online_hosting){
+            $actions['install_online_hosting']=[
+                'label'=>__('Installer sur le serveur d\'hébergement').' <span class="small"><span class="grey">https://hosting.fluidbook.com/</span>'.$entry->install_online_hosting.'</span>',
+                'url'=> $basePackage.'/install_hosting/online',
+                ];
+        }
 
-        $actions['install_ftp']=[
-            'label'=>__('Installer sur un serveur FTP'),
-            'url'=> $basePackage.'/install_ftp/online',
-            ];
+        if($entry->install_online_ftp){
+            $actions['install_online_ftp']=[
+                'label'=>__('Installer sur un serveur FTP').' <span class="small"><span class="grey">ftp://</span>'.$entry->install_online_ftp.'</span>',
+                'url'=> $basePackage.'/install_ftp/online',
+                ];
+        }
 
         if($entry->scorm_enable){
             $actions['scormcloud']=['label'=>__('Tester sur SCORM Cloud'),