Skip to content

Commit

Permalink
wysiwyg for json types
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardDominik committed Apr 29, 2020
1 parent 9109471 commit 7ed6c08
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion resources/views/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<div class="form-group row align-items-center" :class="{'has-danger': errors.has('{{ $col['name'] }}_@{{ $locale }}'), 'has-success': fields.{{ $col['name'] }}_@{{ $locale }} && fields.{{ $col['name'] }}_@{{ $locale }}.valid }">
<label for="{{ $col['name'] }}_@{{ $locale }}" class="col-md-2 col-form-label text-md-right">{{'{{'}} trans('admin.{{ $modelLangFormat }}.columns.{{ $col['name'] }}') }}</label>
<div class="col-md-9" :class="{'col-xl-8': !isFormLocalized }">
@if(in_array($col['name'], $translatableTextarea))<div>
@if(in_array($col['name'], $wysiwygTextColumnNames))<div>
<wysiwyg v-model="form.{{ $col['name'] }}.@{{ $locale }}" v-validate="'{!! implode('|', $col['frontendRules']) !!}'" id="{{ $col['name'] }}_@{{ $locale }}" name="{{ $col['name'] }}_@{{ $locale }}" :config="mediaWysiwygConfig"></wysiwyg>
</div>
@else<input type="text" v-model="form.{{ $col['name'] }}.@{{ $locale }}" v-validate="'{!! implode('|', $col['frontendRules']) !!}'" @input="validate($event)" class="form-control" :class="{'form-control-danger': errors.has('{{ $col['name'] }}_@{{ $locale }}'), 'form-control-success': fields.{{ $col['name'] }}_@{{ $locale }} && fields.{{ $col['name'] }}_@{{ $locale }}.valid }" id="{{ $col['name'] }}_@{{ $locale }}" name="{{ $col['name'] }}_@{{ $locale }}" placeholder="{{'{{'}} trans('admin.{{ $modelLangFormat }}.columns.{{ $col['name'] }}') }}">
Expand Down
1 change: 0 additions & 1 deletion src/Generate/ViewForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ protected function buildForm() {
'hasTranslatable' => $this->readColumnsFromTable($this->tableName)->filter(function($column) {
return $column['type'] == "json";
})->count() > 0,
'translatableTextarea' => ['perex', 'text', 'body'],
'wysiwygTextColumnNames' => ['text', 'body', 'description'],
'relations' => $this->relations,
])->render();
Expand Down

0 comments on commit 7ed6c08

Please sign in to comment.