]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5822 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 Mar 2023 07:20:35 +0000 (09:20 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 Mar 2023 07:20:35 +0000 (09:20 +0200)
app/Jobs/DownloadBase.php
app/Mail/FluidbookQuoteAssign.php
public/packages/fluidbook/toolbox/css/context-menu.less
public/packages/fluidbook/toolbox/js/contextdownload.js
resources/views/vendor/backpack/crud/buttons/fluidbook_publication/download.blade.php

index dc1581868e81c73a6b0a512f6765c0d0e17ae829..17b7cc8d95d251dfe56e10c8e2fc080a3cf680a0 100644 (file)
@@ -78,7 +78,7 @@ class DownloadBase extends Base
         $converter = new CommonMarkConverter();
 
         $mail = new DeferredDownload();
-        //$mail->setUser($this->user);
+        $mail->to($this->user->email);
         $mail->subject($subject);
         $mail->html($converter->convertToHtml($body));
         Mail::send($mail);
index 99218c2958f515dafa9478db4df980cc45829c25..e763714f5c59ab8b481d7a51e16e3cc58f800f12 100644 (file)
@@ -17,7 +17,6 @@ class FluidbookQuoteAssign extends Base
         $reseller = User::where('id', $quote->reseller)->first();
         $resselerLocale = $reseller->locale;
         $user = User::where('id', $quote->user)->first();
-        //$this->to($reseller->email);
         $this->to($reseller->email);
         $this->bcc('tech@fluidbook.com');
         $this->subject('[Fluidbook Workshop] ' . __('Demande de devis', [], $resselerLocale));
index 0edd223555835970f7dfd29656e695b3190e81fb..5ac842d20e2d74044869438ab995b1d8857c8ef2 100644 (file)
@@ -7,3 +7,13 @@
         }
     }
 }
+
+.btn-swal-context {
+    margin: 0 15px;
+    box-shadow: none !important;
+}
+
+.swal2-icon.swal2-info {
+    border-color: #9ec400 !important;
+    color: #9ec400 !important;
+}
index e6f05e192b08363749b9a3ee0d4ad579becf2177..91688a571118ebcba9e70de7807bd4916cb1b369 100644 (file)
@@ -22,7 +22,7 @@ $(function () {
                     if (action.target === undefined) {
                         action.target = '_self';
                     }
-                    action.disabled =(key == disabledOption);
+                    action.disabled = (key == disabledOption);
                     action.isHtmlName = true;
                 }
                 actions[key] = action;
@@ -55,28 +55,26 @@ $(function () {
                     if (confirm === null || confirm === undefined) {
                         return ok();
                     }
-                    swal({
+                    const swalWithBootstrapButtons = Swal.mixin({
+                        customClass: {
+                            confirmButton: 'btn btn-swal-context bg-success',
+                            cancelButton: 'btn btn-swal-context bg-secondary'
+                        },
+                        buttonsStyling: false
+                    })
+                    swalWithBootstrapButtons.fire({
                         title: confirm.title,
                         text: replaceVariables(confirm.text, actions[key].label),
                         icon: "info",
-                        buttons: {
-                            cancel: {
-                                text: confirm.cancel,
-                                value: null,
-                                visible: true,
-                                className: "bg-secondary",
-                                closeModal: true,
-                            },
-                            delete: {
-                                text: confirm.confirm,
-                                value: true,
-                                visible: true,
-                                className: "bg-success",
-                            }
-                        },
-                    }).then((value) => {
-                        if (value) {
+                        showCancelButton: true,
+                        confirmButtonText: confirm.confirm,
+                        cancelButtonText: confirm.cancel,
+                        reverseButtons: true,
+                    }).then((result) => {
+                        if (result.isConfirmed) {
                             ok();
+                        } else {
+
                         }
                     });
 
index 02da15523787f1124ec1cb624401466d27d389a3..aa876be0d29732028a7ec1e6194d7b81d97d127d 100644 (file)
         }
     }
 
+    $confirm=[
+        'title'=>'',
+        'text'=>__('En téléchargeant la publication, vous confirmez que vous l\'avez testé et validé. Elle vous sera donc facturée selon les conditions stipulées dans votre contrat.'),
+        'confirm'=>__('Confirmer'),
+        'cancel'=>__('Annuler')
+    ];
+
 @endphp
 
 @if($entry->allowsDownload())
+
     <a class="btn btn-sm btn-link" href="#"
        data-toggle="tooltip"
+       @if($entry->status==1 && !can('fluidbook-publication:admin'))
+           data-context-confirm="{{json_encode($confirm)}}"
+       @endif
        title="{{__('Télécharger la publication')}}"
        data-context-actions="{{json_encode($actions)}}"
        data-context-route="{{$crud->route}}/$id/download/$action"