]> _ Git - fluidbook-toolbox.git/commitdiff
wip #4210 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 Jun 2022 08:01:30 +0000 (10:01 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 Jun 2022 08:01:30 +0000 (10:01 +0200)
app/Models/Base/ToolboxModel.php
resources/views/fields/fluidbook_theme_selector.blade.php
resources/views/fluidbook_theme/preview.blade.php

index 726575fa6303bd65324a3c94ce50081cd4579dc9..f4f3a6a85950c8ece37fb87a2bb0271bc826b72c 100644 (file)
@@ -36,6 +36,7 @@ class ToolboxModel extends CubistMagicAbstractModel
             'column' => true,
             'can' => static::$_permissionBase . ':admin',
             'column_attribute' => 'companyWithNameOnTwoLines',
+            'column_escape' => false,
             'attribute' => 'companyWithName',
             'default' => Auth::id()
         ];
index a8943759b45b365cdb682e4b68f1565e40de9850..9f798707c828880a39fe1550beb1270781b1f231 100644 (file)
                 $(".themeSelector .actions a").each(function () {
                     $(this).attr('href', $(this).data('url').replace(/\$id/, themeID));
                 });
+                var url = '{{backpack_url('/fluidbook-theme/$id/infos')}}'.replace(/\$id/, themeID);
+                $.ajax({
+                    url: url,
+                    dataType: 'json',
+                    success: function (data) {
+                        $(".themeSelector .actions .name").text(data.name);
+                        $(".themeSelector .actions .id").text(data.id);
+                        $(".themeSelector .actions .owner").html(htmlDecode(data.columns.owner));
+                        $(".themeSelector .actions .created_at").html(data.columns.created_at);
+                        $(".themeSelector .actions .updated_at").html(data.columns.updated_at);
+                    }
+                });
+            }
+
+            function htmlDecode(input) {
+                var doc = new DOMParser().parseFromString(input, "text/html");
+                return doc.documentElement.textContent;
             }
 
         </script>
             id="themePreviewIframe" src="" frameborder="0" allowfullscreen></iframe>
     </div>
     <div class="actions">
-        <a data-url="{{backpack_url('fluidbook-theme/$id/clone-edit')}}" class="btn btn-sm btn-secondary"><i
+        <h4><span class="name"></span> <span style="font-weight: normal;font-style: italic;font-size: 80%">#<span
+                    class="id"></span></span></h4>
+        <p class="owner"></p>
+        <p>{{__('Crée le')}} <span style="font-weight: bold" class="created_at"></span><br>
+            {{__('Mise à jour le')}} <span style="font-weight: bold" class="updated_at"></span></p>
+        <a data-featherlight="iframe" data-featherlight-iframe-style="display:block;width:85vw;height:85vh;" data-url="{{backpack_url('fluidbook-theme/$id/clone-edit')}}?embeded=1" class="btn btn-sm btn-secondary"><i
                 class="la la-clone"></i> {{__('Dupliquer et éditer')}}</a>
-        <a data-url="{{backpack_url('fluidbook-theme/$id/edit')}}" class="btn btn-sm btn-success"><i
+        <a data-featherlight="iframe" data-featherlight-iframe-style="display:block;width:85vw;height:85vh;" data-url="{{backpack_url('fluidbook-theme/$id/edit')}}?embeded=1" class="btn btn-sm btn-success"><i
                 class="la la-edit"></i> {{__('Éditer')}}
         </a>
     </div>
index d2f7da535dea2e06147f08cf061dc2f4c06584c9..dcdf5f1a75c2813a0d5a431a8fc5766d83cec1ca 100644 (file)
@@ -49,7 +49,7 @@
     <style type="text/css">
         #themePreview {
             position: relative;
-            padding-bottom: 75%;
+            padding-bottom: 60%;
         }
 
         #themePreview iframe {