This commit is contained in:
jitendra 2022-03-11 17:01:44 +05:30
parent de4b723b45
commit 1671fefc4b
5 changed files with 47 additions and 2 deletions

View File

@ -93,6 +93,18 @@
<input type="hidden" name="type" value="{{ $attribute->type }}"/>
</div>
@if ($attribute->type == 'textarea')
<div class="control-group">
<label for="enable_wysiwyg">{{ __('admin::app.catalog.attributes.enable-wysiwyg') }}</label>
<label class="switch">
<input type="checkbox" id="enable_wysiwyg" name="enable_wysiwyg" value="1" {{ (old('enable_wysiwyg') ?: $attribute->enable_wysiwyg) ? 'checked' : '' }}>
<span class="slider round"></span>
</label>
</div>
@endif
{!! view_render_event('bagisto.admin.catalog.attribute.edit_form_accordian.general.controls.after', ['attribute' => $attribute]) !!}
</div>
</accordian>

View File

@ -236,7 +236,7 @@
});
tinyMCEHelper.initTinyMCE({
selector: 'textarea#description, textarea#short_description',
selector: 'textarea.enable-wysiwyg, textarea.enable-wysiwyg',
height: 200,
width: "100%",
plugins: 'image imagetools media wordcount save fullscreen code table lists link hr',

View File

@ -1 +1 @@
<textarea v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" data-vv-as="&quot;{{ $attribute->admin_name }}&quot;">{{ old($attribute->code) ?: $product[$attribute->code]}}</textarea>
<textarea v-validate="'{{$validations}}'" class="control {{ $attribute->enable_wysiwyg ? 'enable-wysiwyg' : '' }}" id="{{ $attribute->code }}" name="{{ $attribute->code }}" data-vv-as="&quot;{{ $attribute->admin_name }}&quot;">{{ old($attribute->code) ?: $product[$attribute->code]}}</textarea>

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddEnableWysiwygColumnInAttributesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('attributes', function (Blueprint $table) {
$table->boolean('enable_wysiwyg')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('attributes', function (Blueprint $table) {
$table->dropColumn('enable_wysiwyg');
});
}
}

View File

@ -20,6 +20,7 @@ class Attribute extends TranslatableModel implements AttributeContract
'code',
'admin_name',
'type',
'enable_wysiwyg',
'position',
'is_required',
'is_unique',