]> BookStack Code Mirror - bookstack/blob - resources/views/pages/form.blade.php
Updated existing image tests to reflect changes
[bookstack] / resources / views / pages / form.blade.php
1
2 <div class="page-editor flex-fill flex" id="page-editor"
3      drafts-enabled="{{ $draftsEnabled ? 'true' : 'false' }}"
4      drawio-enabled="{{ config('services.drawio') ? 'true' : 'false' }}"
5      editor-type="{{ setting('app-editor') }}"
6      page-id="{{ $model->id ?? 0 }}"
7      text-direction="{{ config('app.rtl') ? 'rtl' : 'ltr' }}"
8      page-new-draft="{{ $model->draft ?? 0 }}"
9      page-update-draft="{{ $model->isDraft ?? 0 }}">
10
11     {{ csrf_field() }}
12
13     {{--Header Bar--}}
14     <div class="primary-background-light toolbar page-edit-toolbar">
15         <div class="grid third v-center">
16
17             <div class="action-buttons text-left px-m py-xs">
18                 <a href="{{ back()->getTargetUrl() }}" class="text-button text-primary">@icon('back')<span class="hide-under-l">{{ trans('common.back') }}</span></a>
19                 <a onclick="$('body>header').slideToggle();" class="text-button text-primary">@icon('swap-vertical')<span class="hide-under-l">{{ trans('entities.pages_edit_toggle_header') }}</span></a>
20             </div>
21
22             <div class="text-center px-m py-xs">
23                 <div v-show="draftsEnabled" dropdown class="dropdown-container draft-display text">
24                     <a dropdown-toggle class="text-primary text-button"><span class="faded-text" v-text="draftText"></span>&nbsp; @icon('more')</a>
25                     @icon('check-circle', ['class' => 'text-pos draft-notification svg-icon', ':class' => '{visible: draftUpdated}'])
26                     <ul>
27                         <li>
28                             <a @click="saveDraft()" class="text-pos">@icon('save'){{ trans('entities.pages_edit_save_draft') }}</a>
29                         </li>
30                         <li v-if="isNewDraft">
31                             <a href="{{ $model->getUrl('/delete') }}" class="text-neg">@icon('delete'){{ trans('entities.pages_edit_delete_draft') }}</a>
32                         </li>
33                         <li v-if="isUpdateDraft">
34                             <a type="button" @click="discardDraft" class="text-neg">@icon('cancel'){{ trans('entities.pages_edit_discard_draft') }}</a>
35                         </li>
36                     </ul>
37                 </div>
38             </div>
39
40             <div class="action-buttons px-m py-xs" v-cloak>
41                 <div dropdown class="dropdown-container">
42                     <a dropdown-toggle class="text-primary text-button">@icon('edit') <span v-text="changeSummaryShort"></span></a>
43                     <ul class="wide">
44                         <li class="px-l py-m">
45                             <p class="text-muted pb-s">{{ trans('entities.pages_edit_enter_changelog_desc') }}</p>
46                             <input name="summary" id="summary-input" type="text" placeholder="{{ trans('entities.pages_edit_enter_changelog') }}" v-model="changeSummary" />
47                         </li>
48                     </ul>
49                 </div>
50
51                 <button type="submit" id="save-button" class="float-left text-primary text-button text-pos-hover">@icon('save')<span>{{ trans('entities.pages_save') }}</span></button>
52             </div>
53         </div>
54     </div>
55
56     {{--Title input--}}
57     <div class="title-input page-title clearfix" v-pre>
58         <div class="input">
59             @include('form.text', ['name' => 'name', 'placeholder' => trans('entities.pages_title')])
60         </div>
61     </div>
62
63     {{--Editors--}}
64     <div class="edit-area flex-fill flex">
65
66         {{--WYSIWYG Editor--}}
67         @if(setting('app-editor') === 'wysiwyg')
68             <div wysiwyg-editor class="flex-fill flex">
69                 <textarea id="html-editor"  name="html" rows="5" v-pre
70                     @if($errors->has('html')) class="text-neg" @endif>@if(isset($model) || old('html')){{htmlspecialchars( old('html') ? old('html') : $model->html)}}@endif</textarea>
71             </div>
72
73             @if($errors->has('html'))
74                 <div class="text-neg text-small">{{ $errors->first('html') }}</div>
75             @endif
76         @endif
77
78         {{--Markdown Editor--}}
79         @if(setting('app-editor') === 'markdown')
80             <div v-pre id="markdown-editor" markdown-editor class="flex-fill flex code-fill">
81
82                 <div class="markdown-editor-wrap active">
83                     <div class="editor-toolbar">
84                         <span class="float left editor-toolbar-label">{{ trans('entities.pages_md_editor') }}</span>
85                         <div class="float right buttons">
86                             @if(config('services.drawio'))
87                                 <button class="text-button" type="button" data-action="insertDrawing">@icon('drawing'){{ trans('entities.pages_md_insert_drawing') }}</button>
88                                 &nbsp;|&nbsp
89                             @endif
90                             <button class="text-button" type="button" data-action="insertImage">@icon('image'){{ trans('entities.pages_md_insert_image') }}</button>
91                             &nbsp;|&nbsp;
92                             <button class="text-button" type="button" data-action="insertLink">@icon('link'){{ trans('entities.pages_md_insert_link') }}</button>
93                         </div>
94                     </div>
95
96                     <div markdown-input class="flex flex-fill">
97                         <textarea  id="markdown-editor-input"  name="markdown" rows="5"
98                             @if($errors->has('markdown')) class="text-neg" @endif>@if(isset($model) || old('markdown')){{htmlspecialchars( old('markdown') ? old('markdown') : ($model->markdown === '' ? $model->html : $model->markdown))}}@endif</textarea>
99                     </div>
100
101                 </div>
102
103                 <div class="markdown-editor-wrap">
104                     <div class="editor-toolbar">
105                         <div class="editor-toolbar-label">{{ trans('entities.pages_md_preview') }}</div>
106                     </div>
107                     <div class="markdown-display page-content">
108                     </div>
109                 </div>
110                 <input type="hidden" name="html"/>
111
112             </div>
113
114
115
116             @if($errors->has('markdown'))
117                 <div class="text-neg text-small">{{ $errors->first('markdown') }}</div>
118             @endif
119         @endif
120
121     </div>
122 </div>