'isDraft' => true,
'draftsEnabled' => $draftsEnabled,
'templates' => $templates,
+ 'editor' => setting('app-editor') === 'wysiwyg' ? 'wysiwyg' : 'markdown',
]);
}
'current' => $page,
'draftsEnabled' => $draftsEnabled,
'templates' => $templates,
+ 'editor' => setting('app-editor') === 'wysiwyg' ? 'wysiwyg' : 'markdown',
]);
}
--- /dev/null
+<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.99 16H14v-2H6.99v-3L3 15l3.99 4ZM21 9l-3.99-4v3H10v2h7.01v3z"/></svg>
\ No newline at end of file
'pages_edit_draft_save_at' => 'Draft saved at ',
'pages_edit_delete_draft' => 'Delete Draft',
'pages_edit_discard_draft' => 'Discard Draft',
+ 'pages_edit_switch_to_markdown' => 'Switch to Markdown editor',
+ 'pages_edit_switch_to_wysiwyg' => 'Switch to WYSIWYG editor',
'pages_edit_set_changelog' => 'Set Changelog',
'pages_edit_enter_changelog_desc' => 'Enter a brief description of the changes you\'ve made',
'pages_edit_enter_changelog' => 'Enter Changelog',
<li refs="page-editor@discardDraftWrap" class="{{ ($model->isDraft ?? false) ? '' : 'hidden' }}">
<button refs="page-editor@discardDraft" type="button" class="text-neg">@icon('cancel'){{ trans('entities.pages_edit_discard_draft') }}</button>
</li>
+ @if(userCan('editor-change'))
+ <li>
+ <button refs="page-editor@swapEditor" type="button">
+ @icon('swap-horizontal')
+ {{ $editor === 'wysiwyg' ? trans('entities.pages_edit_switch_to_markdown') : trans('entities.pages_edit_switch_to_wysiwyg') }}
+ </button>
+ </li>
+ @endif
</ul>
</div>
</div>
<div class="edit-area flex-fill flex">
{{--WYSIWYG Editor--}}
- @if(setting('app-editor') === 'wysiwyg')
+ @if($editor === 'wysiwyg')
@include('pages.parts.wysiwyg-editor', ['model' => $model])
@endif
{{--Markdown Editor--}}
- @if(setting('app-editor') === 'markdown')
+ @if($editor === 'markdown')
@include('pages.parts.markdown-editor', ['model' => $model])
@endif