]> _ Git - cubist_cms-back.git/commitdiff
wip #6775 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 14 Mar 2024 08:46:52 +0000 (09:46 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 14 Mar 2024 08:46:52 +0000 (09:46 +0100)
src/app/Magic/Fields/LinkButton.php [new file with mode: 0644]
src/resources/views/fields/link_button.blade.php [new file with mode: 0644]

diff --git a/src/app/Magic/Fields/LinkButton.php b/src/app/Magic/Fields/LinkButton.php
new file mode 100644 (file)
index 0000000..d4ae454
--- /dev/null
@@ -0,0 +1,11 @@
+<?php
+
+namespace Cubist\Backpack\Magic\Fields;
+
+use Cubist\Backpack\CubistBackpackServiceProvider;
+
+class LinkButton extends UnstoredField
+{
+    protected $_adminType = 'link_button';
+    protected $_viewNamespace = CubistBackpackServiceProvider::NAMESPACE . '::fields';
+}
diff --git a/src/resources/views/fields/link_button.blade.php b/src/resources/views/fields/link_button.blade.php
new file mode 100644 (file)
index 0000000..16bf835
--- /dev/null
@@ -0,0 +1,12 @@
+<!-- text input -->
+@include('crud::fields.inc.wrapper_start')
+<label></label>
+@include('crud::fields.inc.translatable_icon')
+<div><a class="btn btn-success"
+        href="{{ str_replace('$id',$entry->id,old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? '') }}">{!! $field['label'] !!}</a>
+</div>
+{{-- HINT --}}
+@if (isset($field['hint']))
+    <p class="help-block">{!! $field['hint'] !!}</p>
+    @endif
+    </div>