2019-04-07 01:36:17 +08:00
|
|
|
<div id="image-manager" image-type="{{ $imageType }}" uploaded-to="{{ $uploaded_to ?? 0 }}">
|
2019-07-06 21:52:25 +08:00
|
|
|
|
|
|
|
@exposeTranslations([
|
|
|
|
'components.image_delete_success',
|
|
|
|
'components.image_upload_success',
|
|
|
|
'errors.server_upload_limit',
|
|
|
|
'components.image_upload_remove',
|
|
|
|
'components.file_upload_timeout',
|
|
|
|
])
|
|
|
|
|
2020-06-28 06:56:01 +08:00
|
|
|
<div component="popup" class="popup-background" v-cloak @click="hide">
|
2019-08-25 01:26:28 +08:00
|
|
|
<div class="popup-body" tabindex="-1" @click.stop>
|
2016-08-31 03:05:59 +08:00
|
|
|
|
|
|
|
<div class="popup-header primary-background">
|
2016-12-31 22:27:40 +08:00
|
|
|
<div class="popup-title">{{ trans('components.image_select') }}</div>
|
2019-04-07 18:34:40 +08:00
|
|
|
<button class="popup-header-close" @click="hide()">x</button>
|
2016-08-31 03:05:59 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="flex-fill image-manager-body">
|
|
|
|
|
|
|
|
<div class="image-manager-content">
|
2019-04-27 21:18:00 +08:00
|
|
|
<div v-if="imageType === 'gallery' || imageType === 'drawio'" class="image-manager-header primary-background-light nav-tabs grid third">
|
|
|
|
<div class="tab-item" title="{{ trans('components.image_all_title') }}" :class="{selected: !filter}" @click="setFilterType(null)">@icon('images') {{ trans('components.image_all') }}</div>
|
|
|
|
<div class="tab-item" title="{{ trans('components.image_book_title') }}" :class="{selected: (filter=='book')}" @click="setFilterType('book')">@icon('book', ['class' => 'text-book svg-icon']) {{ trans('entities.book') }}</div>
|
|
|
|
<div class="tab-item" title="{{ trans('components.image_page_title') }}" :class="{selected: (filter=='page')}" @click="setFilterType('page')">@icon('page', ['class' => 'text-page svg-icon']) {{ trans('entities.page') }}</div>
|
2016-04-03 21:59:54 +08:00
|
|
|
</div>
|
2019-04-27 21:18:00 +08:00
|
|
|
<div>
|
2018-02-05 01:18:55 +08:00
|
|
|
<form @submit.prevent="searchImages" class="contained-search-box">
|
2020-04-11 22:48:08 +08:00
|
|
|
<input placeholder="{{ trans('components.image_search_hint') }}" v-model="searchTerm" type="text">
|
2018-02-18 03:49:00 +08:00
|
|
|
<button :class="{active: searching}" title="{{ trans('common.search_clear') }}" type="button" @click="cancelSearch()" class="text-button cancel">@icon('close')</button>
|
2018-02-17 21:30:52 +08:00
|
|
|
<button title="{{ trans('common.search') }}" class="text-button">@icon('search')</button>
|
2016-08-31 03:05:59 +08:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="image-manager-list">
|
2017-08-10 04:33:00 +08:00
|
|
|
<div v-if="images.length > 0" v-for="(image, idx) in images">
|
|
|
|
<div class="image anim fadeIn" :style="{animationDelay: (idx > 26) ? '160ms' : ((idx * 25) + 'ms')}"
|
|
|
|
:class="{selected: (image==selectedImage)}" @click="imageSelect(image)">
|
|
|
|
<img :src="image.thumbs.gallery" :alt="image.title" :title="image.name">
|
2016-08-31 03:05:59 +08:00
|
|
|
<div class="image-meta">
|
2017-08-10 04:33:00 +08:00
|
|
|
<span class="name" v-text="image.name"></span>
|
2016-12-31 22:27:40 +08:00
|
|
|
<span class="date">{{ trans('components.image_uploaded', ['uploadedDate' => "{{ getDate(image.created_at) }" . "}"]) }}</span>
|
2016-08-31 03:05:59 +08:00
|
|
|
</div>
|
2016-02-07 18:14:11 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-08-10 04:33:00 +08:00
|
|
|
<div class="load-more" v-show="hasMore" @click="fetchData">{{ trans('components.image_load_more') }}</div>
|
2015-12-31 02:38:18 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2016-08-31 03:05:59 +08:00
|
|
|
<div class="image-manager-sidebar">
|
2018-05-13 19:07:38 +08:00
|
|
|
|
2018-05-20 23:40:30 +08:00
|
|
|
<dropzone v-if="imageType !== 'drawio'" ref="dropzone" placeholder="{{ trans('components.image_dropzone') }}" :upload-url="uploadUrl" :uploaded-to="uploadedTo" @success="uploadSuccess"></dropzone>
|
2018-05-13 19:07:38 +08:00
|
|
|
|
2016-08-31 03:05:59 +08:00
|
|
|
<div class="inner">
|
2015-12-31 02:38:18 +08:00
|
|
|
|
2017-08-10 04:33:00 +08:00
|
|
|
<div class="image-manager-details anim fadeIn" v-if="selectedImage">
|
2015-12-31 02:38:18 +08:00
|
|
|
|
2018-05-20 23:40:30 +08:00
|
|
|
<form @submit.prevent="saveImageDetails">
|
2018-05-20 01:44:40 +08:00
|
|
|
<div class="image-manager-viewer">
|
2017-08-10 04:33:00 +08:00
|
|
|
<a :href="selectedImage.url" target="_blank" style="display: block;">
|
2018-05-20 01:44:40 +08:00
|
|
|
<img :src="selectedImage.thumbs.display" :alt="selectedImage.name"
|
2017-08-10 04:33:00 +08:00
|
|
|
:title="selectedImage.name">
|
2016-08-31 03:05:59 +08:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2016-12-31 22:27:40 +08:00
|
|
|
<label for="name">{{ trans('components.image_image_name') }}</label>
|
2018-05-13 19:07:38 +08:00
|
|
|
<input id="name" class="input-base" name="name" v-model="selectedImage.name">
|
2016-08-31 03:05:59 +08:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
2018-05-20 23:40:30 +08:00
|
|
|
<div class="clearfix">
|
2018-05-13 19:07:38 +08:00
|
|
|
<div class="float left">
|
|
|
|
<button type="button" class="button icon outline" @click="deleteImage">@icon('delete')</button>
|
|
|
|
|
|
|
|
</div>
|
2019-08-25 19:40:04 +08:00
|
|
|
<button class="button anim fadeIn float right" v-show="selectedImage" @click="callbackAndHide(selectedImage)">
|
2018-02-18 03:49:00 +08:00
|
|
|
{{ trans('components.image_select_image') }}
|
2016-08-31 03:05:59 +08:00
|
|
|
</button>
|
2018-05-13 19:07:38 +08:00
|
|
|
<div class="clearfix"></div>
|
|
|
|
<div v-show="dependantPages">
|
|
|
|
<p class="text-neg text-small">
|
|
|
|
{{ trans('components.image_delete_used') }}
|
|
|
|
</p>
|
|
|
|
<ul class="text-neg">
|
|
|
|
<li v-for="page in dependantPages">
|
|
|
|
<a :href="page.url" target="_blank" class="text-neg" v-text="page.name"></a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div v-show="deleteConfirm" class="text-neg text-small">
|
|
|
|
{{ trans('components.image_delete_confirm') }}
|
|
|
|
</div>
|
2016-08-31 03:05:59 +08:00
|
|
|
</div>
|
2015-12-31 02:38:18 +08:00
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2018-05-13 19:07:38 +08:00
|
|
|
|
2016-08-31 03:05:59 +08:00
|
|
|
|
|
|
|
</div>
|
2015-12-31 02:38:18 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
2016-08-31 03:05:59 +08:00
|
|
|
|
2015-12-31 02:38:18 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|