Making media list more flexible for re-use

parent dfe8ec23
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
ref="mediaTable" ref="mediaTable"
v-loading.body="tableIsLoading" v-loading.body="tableIsLoading"
@sort-change="handleSortChange"> @sort-change="handleSortChange">
<el-table-column :label="trans('core.table.thumbnail')" width="150"> <el-table-column label="" width="150">
<template scope="scope"> <template scope="scope">
<img :src="scope.row.small_thumb" alt="" v-if="scope.row.is_image"/> <img :src="scope.row.small_thumb" alt="" v-if="scope.row.is_image"/>
<i :class="`fa ${scope.row.fa_icon}`" style="font-size: 20px;" v-if="! scope.row.is_image"></i> <i :class="`fa ${scope.row.fa_icon}`" style="font-size: 20px;" v-if="! scope.row.is_image"></i>
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
</el-table-column> </el-table-column>
<el-table-column prop="created_at" :label="trans('core.table.created at')" sortable="custom"> <el-table-column prop="created_at" :label="trans('core.table.created at')" sortable="custom">
</el-table-column> </el-table-column>
<el-table-column prop="actions" :label="trans('core.table.actions')" width="150"> <el-table-column prop="actions" label="" width="150">
<template scope="scope"> <template scope="scope">
<a class="btn btn-primary btn-flat" @click.prevent="insertMedia(scope)"> <a class="btn btn-primary btn-flat" @click.prevent="insertMedia(scope)" v-if="singleModal">
{{ trans('media.insert') }} {{ trans('media.insert') }}
</a> </a>
</template> </template>
...@@ -54,6 +54,9 @@ ...@@ -54,6 +54,9 @@
<script> <script>
export default { export default {
props: {
singleModal: {type: Boolean},
},
data() { data() {
return { return {
data: [], data: [],
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
:before-close="handleClose"> :before-close="handleClose">
<upload-zone></upload-zone> <upload-zone></upload-zone>
<media-list></media-list> <media-list single-modal></media-list>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">{{ trans('core.button.cancel') }}</el-button> <el-button @click="dialogVisible = false">{{ trans('core.button.cancel') }}</el-button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment