2016-05-15 03:02:00 +08:00
|
|
|
|
2017-09-25 01:30:21 +08:00
|
|
|
<div editor-toolbox class="floating-toolbox">
|
2016-05-16 03:12:53 +08:00
|
|
|
|
2016-05-14 04:20:21 +08:00
|
|
|
<div class="tabs primary-background-light">
|
2018-02-18 03:49:00 +08:00
|
|
|
<span toolbox-toggle>@icon('caret-left-circle')</span>
|
|
|
|
<span toolbox-tab-button="tags" title="{{ trans('entities.page_tags') }}" class="active">@icon('tag')</span>
|
2016-11-12 22:12:26 +08:00
|
|
|
@if(userCan('attachment-create-all'))
|
2018-02-18 03:49:00 +08:00
|
|
|
<span toolbox-tab-button="files" title="{{ trans('entities.attachments') }}">@icon('attach')</span>
|
2016-10-12 03:39:11 +08:00
|
|
|
@endif
|
2016-05-14 04:20:21 +08:00
|
|
|
</div>
|
2016-05-16 03:12:53 +08:00
|
|
|
|
2018-03-30 21:09:51 +08:00
|
|
|
<div toolbox-tab-content="tags">
|
2016-12-04 02:35:40 +08:00
|
|
|
<h4>{{ trans('entities.page_tags') }}</h4>
|
2019-04-07 16:57:48 +08:00
|
|
|
<div class="px-l">
|
2018-03-30 21:09:51 +08:00
|
|
|
@include('components.tag-manager', ['entity' => $page, 'entityType' => 'page'])
|
2016-05-15 17:39:17 +08:00
|
|
|
</div>
|
2016-05-14 04:20:21 +08:00
|
|
|
</div>
|
2016-05-16 03:12:53 +08:00
|
|
|
|
2016-11-12 22:12:26 +08:00
|
|
|
@if(userCan('attachment-create-all'))
|
2019-04-07 01:36:17 +08:00
|
|
|
<div toolbox-tab-content="files" id="attachment-manager" page-id="{{ $page->id ?? 0 }}">
|
2016-12-04 02:35:40 +08:00
|
|
|
<h4>{{ trans('entities.attachments') }}</h4>
|
2019-04-07 16:57:48 +08:00
|
|
|
<div class="px-l files">
|
2016-10-10 01:58:22 +08:00
|
|
|
|
2017-08-19 20:55:56 +08:00
|
|
|
<div id="file-list" v-show="!fileToEdit">
|
2019-04-07 18:34:40 +08:00
|
|
|
<p class="text-muted small">{{ trans('entities.attachments_explain') }} <span class="text-warn">{{ trans('entities.attachments_explain_instant_save') }}</span></p>
|
2016-10-11 04:13:18 +08:00
|
|
|
|
2017-08-19 20:55:56 +08:00
|
|
|
<div class="tab-container">
|
2016-10-24 00:55:48 +08:00
|
|
|
<div class="nav-tabs">
|
2017-08-19 20:55:56 +08:00
|
|
|
<div @click="tab = 'list'" :class="{selected: tab === 'list'}" class="tab-item">{{ trans('entities.attachments_items') }}</div>
|
|
|
|
<div @click="tab = 'file'" :class="{selected: tab === 'file'}" class="tab-item">{{ trans('entities.attachments_upload') }}</div>
|
|
|
|
<div @click="tab = 'link'" :class="{selected: tab === 'link'}" class="tab-item">{{ trans('entities.attachments_link') }}</div>
|
2016-10-24 00:55:48 +08:00
|
|
|
</div>
|
2017-08-19 20:55:56 +08:00
|
|
|
<div v-show="tab === 'list'">
|
2017-09-02 22:06:52 +08:00
|
|
|
<draggable style="width: 100%;" :options="{handle: '.handle'}" @change="fileSortUpdate" :list="files" element="div">
|
|
|
|
<div v-for="(file, index) in files" :key="file.id" class="card drag-card">
|
2018-02-18 03:49:00 +08:00
|
|
|
<div class="handle">@icon('grip')</div>
|
2019-04-07 16:57:48 +08:00
|
|
|
<div class="py-s">
|
2017-08-19 20:55:56 +08:00
|
|
|
<a :href="getFileUrl(file)" target="_blank" v-text="file.name"></a>
|
|
|
|
<div v-if="file.deleting">
|
2019-04-07 18:34:40 +08:00
|
|
|
<span class="text-neg small">{{ trans('entities.attachments_delete_confirm') }}</span>
|
2016-10-24 00:55:48 +08:00
|
|
|
<br>
|
2017-08-19 20:55:56 +08:00
|
|
|
<span class="text-primary small" @click="file.deleting = false;">{{ trans('common.cancel') }}</span>
|
2016-10-24 00:55:48 +08:00
|
|
|
</div>
|
2017-08-19 20:55:56 +08:00
|
|
|
</div>
|
2018-06-17 16:51:31 +08:00
|
|
|
<div @click="startEdit(file)" class="drag-card-action text-center text-primary">@icon('edit')</div>
|
|
|
|
<div @click="deleteFile(file)" class="drag-card-action text-center text-neg">@icon('close')</div>
|
2017-08-19 20:55:56 +08:00
|
|
|
</div>
|
|
|
|
</draggable>
|
2019-04-07 18:34:40 +08:00
|
|
|
<p class="small text-muted" v-if="files.length === 0">
|
2016-12-04 02:35:40 +08:00
|
|
|
{{ trans('entities.attachments_no_files') }}
|
2016-10-24 00:55:48 +08:00
|
|
|
</p>
|
|
|
|
</div>
|
2017-08-19 20:55:56 +08:00
|
|
|
<div v-show="tab === 'file'">
|
|
|
|
<dropzone placeholder="{{ trans('entities.attachments_dropzone') }}" :upload-url="getUploadUrl()" :uploaded-to="pageId" @success="uploadSuccess"></dropzone>
|
2016-10-24 00:55:48 +08:00
|
|
|
</div>
|
2017-08-19 20:55:56 +08:00
|
|
|
<div v-show="tab === 'link'" @keypress.enter.prevent="attachNewLink(file)">
|
2019-04-07 18:34:40 +08:00
|
|
|
<p class="text-muted small">{{ trans('entities.attachments_explain_link') }}</p>
|
2016-10-24 00:55:48 +08:00
|
|
|
<div class="form-group">
|
2016-12-04 02:35:40 +08:00
|
|
|
<label for="attachment-via-link">{{ trans('entities.attachments_link_name') }}</label>
|
2017-08-19 20:55:56 +08:00
|
|
|
<input type="text" placeholder="{{ trans('entities.attachments_link_name') }}" v-model="file.name">
|
2019-04-07 18:34:40 +08:00
|
|
|
<p class="small text-neg" v-for="error in errors.link.name" v-text="error"></p>
|
2016-10-24 00:55:48 +08:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2016-12-04 02:35:40 +08:00
|
|
|
<label for="attachment-via-link">{{ trans('entities.attachments_link_url') }}</label>
|
2017-08-19 20:55:56 +08:00
|
|
|
<input type="text" placeholder="{{ trans('entities.attachments_link_url_hint') }}" v-model="file.link">
|
2019-04-07 18:34:40 +08:00
|
|
|
<p class="small text-neg" v-for="error in errors.link.link" v-text="error"></p>
|
2016-10-24 00:55:48 +08:00
|
|
|
</div>
|
2019-03-30 23:49:14 +08:00
|
|
|
<button @click.prevent="attachNewLink(file)" class="button primary">{{ trans('entities.attach') }}</button>
|
2016-10-11 04:13:18 +08:00
|
|
|
|
2016-10-24 00:55:48 +08:00
|
|
|
</div>
|
2016-10-12 03:39:11 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2017-08-19 20:55:56 +08:00
|
|
|
<div id="file-edit" v-if="fileToEdit" @keypress.enter.prevent="updateFile(fileToEdit)">
|
2016-12-04 02:35:40 +08:00
|
|
|
<h5>{{ trans('entities.attachments_edit_file') }}</h5>
|
2016-10-24 00:55:48 +08:00
|
|
|
|
2016-10-12 03:39:11 +08:00
|
|
|
<div class="form-group">
|
2016-12-04 02:35:40 +08:00
|
|
|
<label for="attachment-name-edit">{{ trans('entities.attachments_edit_file_name') }}</label>
|
2017-08-19 20:55:56 +08:00
|
|
|
<input type="text" id="attachment-name-edit" placeholder="{{ trans('entities.attachments_edit_file_name') }}" v-model="fileToEdit.name">
|
2019-04-07 18:34:40 +08:00
|
|
|
<p class="small text-neg" v-for="error in errors.edit.name" v-text="error"></p>
|
2016-10-12 03:39:11 +08:00
|
|
|
</div>
|
2016-10-24 00:55:48 +08:00
|
|
|
|
2017-08-19 20:55:56 +08:00
|
|
|
<div class="tab-container">
|
2016-10-24 00:55:48 +08:00
|
|
|
<div class="nav-tabs">
|
2017-08-19 20:55:56 +08:00
|
|
|
<div @click="editTab = 'file'" :class="{selected: editTab === 'file'}" class="tab-item">{{ trans('entities.attachments_upload') }}</div>
|
|
|
|
<div @click="editTab = 'link'" :class="{selected: editTab === 'link'}" class="tab-item">{{ trans('entities.attachments_set_link') }}</div>
|
2016-10-24 00:55:48 +08:00
|
|
|
</div>
|
2017-08-19 20:55:56 +08:00
|
|
|
<div v-if="editTab === 'file'">
|
|
|
|
<dropzone :upload-url="getUploadUrl(fileToEdit)" :uploaded-to="pageId" placeholder="{{ trans('entities.attachments_edit_drop_upload') }}" @success="uploadSuccessUpdate"></dropzone>
|
2016-10-24 00:55:48 +08:00
|
|
|
<br>
|
|
|
|
</div>
|
2017-08-19 20:55:56 +08:00
|
|
|
<div v-if="editTab === 'link'">
|
2016-10-24 00:55:48 +08:00
|
|
|
<div class="form-group">
|
2016-12-04 02:35:40 +08:00
|
|
|
<label for="attachment-link-edit">{{ trans('entities.attachments_link_url') }}</label>
|
2017-08-19 20:55:56 +08:00
|
|
|
<input type="text" id="attachment-link-edit" placeholder="{{ trans('entities.attachment_link') }}" v-model="fileToEdit.link">
|
2019-04-07 18:34:40 +08:00
|
|
|
<p class="small text-neg" v-for="error in errors.edit.link" v-text="error"></p>
|
2016-10-24 00:55:48 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-10-12 03:39:11 +08:00
|
|
|
</div>
|
|
|
|
|
2017-09-02 22:06:52 +08:00
|
|
|
<button type="button" class="button outline" @click="cancelEdit">{{ trans('common.back') }}</button>
|
2019-03-30 23:49:14 +08:00
|
|
|
<button @click.enter.prevent="updateFile(fileToEdit)" class="button primary">{{ trans('common.save') }}</button>
|
2016-10-12 03:39:11 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
2016-10-10 01:58:22 +08:00
|
|
|
</div>
|
2016-10-12 03:39:11 +08:00
|
|
|
@endif
|
2016-10-10 01:58:22 +08:00
|
|
|
|
2017-10-17 06:24:47 +08:00
|
|
|
</div>
|