2016-05-14 21:02:00 +02:00
|
|
|
|
|
|
|
<div toolbox class="floating-toolbox">
|
2016-05-15 21:12:53 +02:00
|
|
|
|
2016-05-13 22:20:21 +02:00
|
|
|
<div class="tabs primary-background-light">
|
2016-05-14 21:02:00 +02:00
|
|
|
<span toolbox-toggle><i class="zmdi zmdi-caret-left-circle"></i></span>
|
2016-12-03 19:35:40 +01:00
|
|
|
<span toolbox-tab-button="tags" title="{{ trans('entities.page_tags') }}" class="active"><i class="zmdi zmdi-tag"></i></span>
|
2016-11-12 15:12:26 +01:00
|
|
|
@if(userCan('attachment-create-all'))
|
2016-12-03 19:35:40 +01:00
|
|
|
<span toolbox-tab-button="files" title="{{ trans('entities.attachments') }}"><i class="zmdi zmdi-attachment"></i></span>
|
2016-10-11 21:39:11 +02:00
|
|
|
@endif
|
2016-05-13 22:20:21 +02:00
|
|
|
</div>
|
2016-05-15 21:12:53 +02:00
|
|
|
|
2017-08-10 21:11:25 +02:00
|
|
|
<div toolbox-tab-content="tags" id="tag-manager" page-id="{{ $page->id or 0 }}">
|
2016-12-03 19:35:40 +01:00
|
|
|
<h4>{{ trans('entities.page_tags') }}</h4>
|
2016-05-15 11:39:17 +02:00
|
|
|
<div class="padded tags">
|
2016-12-03 19:35:40 +01:00
|
|
|
<p class="muted small">{!! nl2br(e(trans('entities.tags_explain'))) !!}</p>
|
2017-08-10 21:11:25 +02:00
|
|
|
|
2017-08-19 14:55:56 +02:00
|
|
|
<draggable class="fake-table no-style tag-table" :options="{handle: '.handle'}" :list="tags" element="div">
|
|
|
|
<transition-group tag="div">
|
2017-08-10 21:11:25 +02:00
|
|
|
<div v-for="(tag, i) in tags" :key="tag.key">
|
|
|
|
<div width="20" class="handle" ><i class="zmdi zmdi-menu"></i></div>
|
2017-08-13 14:25:30 +02:00
|
|
|
<div>
|
|
|
|
<autosuggest url="/ajax/tags/suggest/names" type="name" class="outline" :name="getTagFieldName(i, 'name')"
|
|
|
|
v-model="tag.name" @input="tagChange(tag)" @blur="tagBlur(tag)" placeholder="{{ trans('entities.tag') }}"/>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<autosuggest url="/ajax/tags/suggest/values" type="value" class="outline" :name="getTagFieldName(i, 'value')"
|
|
|
|
v-model="tag.value" @change="tagChange(tag)" @blur="tagBlur(tag)" placeholder="{{ trans('entities.tag') }}"/>
|
|
|
|
</div>
|
2017-08-10 21:11:25 +02:00
|
|
|
<div width="10" v-show="tags.length !== 1" class="text-center text-neg" style="padding: 0;" @click="removeTag(tag)"><i class="zmdi zmdi-close"></i></div>
|
|
|
|
</div>
|
|
|
|
</transition-group>
|
|
|
|
</draggable>
|
|
|
|
|
2016-05-15 11:39:17 +02:00
|
|
|
<table class="no-style" style="width: 100%;">
|
|
|
|
<tbody>
|
|
|
|
<tr class="unsortable">
|
2017-08-10 21:11:25 +02:00
|
|
|
<td width="34"></td>
|
|
|
|
<td @click="addEmptyTag">
|
2016-12-03 19:35:40 +01:00
|
|
|
<button type="button" class="text-button">{{ trans('entities.tags_add') }}</button>
|
2016-05-15 11:39:17 +02:00
|
|
|
</td>
|
|
|
|
<td></td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2017-08-10 21:11:25 +02:00
|
|
|
|
2016-05-15 11:39:17 +02:00
|
|
|
</div>
|
2016-05-13 22:20:21 +02:00
|
|
|
</div>
|
2016-05-15 21:12:53 +02:00
|
|
|
|
2016-11-12 15:12:26 +01:00
|
|
|
@if(userCan('attachment-create-all'))
|
2017-08-19 14:55:56 +02:00
|
|
|
<div toolbox-tab-content="files" id="attachment-manager" page-id="{{ $page->id or 0 }}">
|
2016-12-03 19:35:40 +01:00
|
|
|
<h4>{{ trans('entities.attachments') }}</h4>
|
2016-10-11 21:39:11 +02:00
|
|
|
<div class="padded files">
|
2016-10-09 19:58:22 +02:00
|
|
|
|
2017-08-19 14:55:56 +02:00
|
|
|
<div id="file-list" v-show="!fileToEdit">
|
2016-12-03 19:35:40 +01:00
|
|
|
<p class="muted small">{{ trans('entities.attachments_explain') }} <span class="secondary">{{ trans('entities.attachments_explain_instant_save') }}</span></p>
|
2016-10-10 22:13:18 +02:00
|
|
|
|
2017-08-19 14:55:56 +02:00
|
|
|
<div class="tab-container">
|
2016-10-23 18:55:48 +02:00
|
|
|
<div class="nav-tabs">
|
2017-08-19 14:55:56 +02: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-23 18:55:48 +02:00
|
|
|
</div>
|
2017-08-19 14:55:56 +02:00
|
|
|
<div v-show="tab === 'list'">
|
|
|
|
<draggable class="fake-table no-style " style="width: 100%;" :options="{handle: '.handle'}" @change="fileSortUpdate" :list="files" element="div">
|
|
|
|
<transition-group tag="div">
|
|
|
|
<div v-for="(file, index) in files" :key="file.id">
|
|
|
|
<div width="20" ><i class="handle zmdi zmdi-menu"></i></div>
|
|
|
|
<div>
|
|
|
|
<a :href="getFileUrl(file)" target="_blank" v-text="file.name"></a>
|
|
|
|
<div v-if="file.deleting">
|
2016-12-03 19:35:40 +01:00
|
|
|
<span class="neg small">{{ trans('entities.attachments_delete_confirm') }}</span>
|
2016-10-23 18:55:48 +02:00
|
|
|
<br>
|
2017-08-19 14:55:56 +02:00
|
|
|
<span class="text-primary small" @click="file.deleting = false;">{{ trans('common.cancel') }}</span>
|
2016-10-23 18:55:48 +02:00
|
|
|
</div>
|
2017-08-19 14:55:56 +02:00
|
|
|
</div>
|
|
|
|
<div width="10" @click="startEdit(file)" class="text-center text-primary" style="padding: 0;"><i class="zmdi zmdi-edit"></i></div>
|
|
|
|
<div width="5"></div>
|
|
|
|
<div width="10" @click="deleteFile(file)" class="text-center text-neg" style="padding: 0;"><i class="zmdi zmdi-close"></i></div>
|
|
|
|
</div>
|
|
|
|
</transition-group>
|
|
|
|
</draggable>
|
|
|
|
<p class="small muted" v-if="files.length === 0">
|
2016-12-03 19:35:40 +01:00
|
|
|
{{ trans('entities.attachments_no_files') }}
|
2016-10-23 18:55:48 +02:00
|
|
|
</p>
|
|
|
|
</div>
|
2017-08-19 14:55:56 +02:00
|
|
|
<div v-show="tab === 'file'">
|
|
|
|
<dropzone placeholder="{{ trans('entities.attachments_dropzone') }}" :upload-url="getUploadUrl()" :uploaded-to="pageId" @success="uploadSuccess"></dropzone>
|
2016-10-23 18:55:48 +02:00
|
|
|
</div>
|
2017-08-19 14:55:56 +02:00
|
|
|
<div v-show="tab === 'link'" @keypress.enter.prevent="attachNewLink(file)">
|
2016-12-03 19:35:40 +01:00
|
|
|
<p class="muted small">{{ trans('entities.attachments_explain_link') }}</p>
|
2016-10-23 18:55:48 +02:00
|
|
|
<div class="form-group">
|
2016-12-03 19:35:40 +01:00
|
|
|
<label for="attachment-via-link">{{ trans('entities.attachments_link_name') }}</label>
|
2017-08-19 14:55:56 +02:00
|
|
|
<input type="text" placeholder="{{ trans('entities.attachments_link_name') }}" v-model="file.name">
|
|
|
|
<p class="small neg" v-for="error in errors.link.name" v-text="error"></p>
|
2016-10-23 18:55:48 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2016-12-03 19:35:40 +01:00
|
|
|
<label for="attachment-via-link">{{ trans('entities.attachments_link_url') }}</label>
|
2017-08-19 14:55:56 +02:00
|
|
|
<input type="text" placeholder="{{ trans('entities.attachments_link_url_hint') }}" v-model="file.link">
|
|
|
|
<p class="small neg" v-for="error in errors.link.link" v-text="error"></p>
|
2016-10-23 18:55:48 +02:00
|
|
|
</div>
|
2017-08-19 14:55:56 +02:00
|
|
|
<button @click.prevent="attachNewLink(file)" class="button pos">{{ trans('entities.attach') }}</button>
|
2016-10-10 22:13:18 +02:00
|
|
|
|
2016-10-23 18:55:48 +02:00
|
|
|
</div>
|
2016-10-11 21:39:11 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2017-08-19 14:55:56 +02:00
|
|
|
<div id="file-edit" v-if="fileToEdit" @keypress.enter.prevent="updateFile(fileToEdit)">
|
2016-12-03 19:35:40 +01:00
|
|
|
<h5>{{ trans('entities.attachments_edit_file') }}</h5>
|
2016-10-23 18:55:48 +02:00
|
|
|
|
2016-10-11 21:39:11 +02:00
|
|
|
<div class="form-group">
|
2016-12-03 19:35:40 +01:00
|
|
|
<label for="attachment-name-edit">{{ trans('entities.attachments_edit_file_name') }}</label>
|
2017-08-19 14:55:56 +02:00
|
|
|
<input type="text" id="attachment-name-edit" placeholder="{{ trans('entities.attachments_edit_file_name') }}" v-model="fileToEdit.name">
|
|
|
|
<p class="small neg" v-for="error in errors.edit.name" v-text="error"></p>
|
2016-10-11 21:39:11 +02:00
|
|
|
</div>
|
2016-10-23 18:55:48 +02:00
|
|
|
|
2017-08-19 14:55:56 +02:00
|
|
|
<div class="tab-container">
|
2016-10-23 18:55:48 +02:00
|
|
|
<div class="nav-tabs">
|
2017-08-19 14:55:56 +02: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-23 18:55:48 +02:00
|
|
|
</div>
|
2017-08-19 14:55:56 +02: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-23 18:55:48 +02:00
|
|
|
<br>
|
|
|
|
</div>
|
2017-08-19 14:55:56 +02:00
|
|
|
<div v-if="editTab === 'link'">
|
2016-10-23 18:55:48 +02:00
|
|
|
<div class="form-group">
|
2016-12-03 19:35:40 +01:00
|
|
|
<label for="attachment-link-edit">{{ trans('entities.attachments_link_url') }}</label>
|
2017-08-19 14:55:56 +02:00
|
|
|
<input type="text" id="attachment-link-edit" placeholder="{{ trans('entities.attachment_link') }}" v-model="fileToEdit.link">
|
|
|
|
<p class="small neg" v-for="error in errors.edit.link" v-text="error"></p>
|
2016-10-23 18:55:48 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-10-11 21:39:11 +02:00
|
|
|
</div>
|
|
|
|
|
2017-08-19 14:55:56 +02:00
|
|
|
<button type="button" class="button" @click="cancelEdit">{{ trans('common.back') }}</button>
|
|
|
|
<button @click.enter.prevent="updateFile(fileToEdit)" class="button pos">{{ trans('common.save') }}</button>
|
2016-10-11 21:39:11 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
2016-10-09 19:58:22 +02:00
|
|
|
</div>
|
2016-10-11 21:39:11 +02:00
|
|
|
@endif
|
2016-10-09 19:58:22 +02:00
|
|
|
|
2016-05-13 22:20:21 +02:00
|
|
|
</div>
|