Prepend error message before the dropzone area

parent 409ffc75
...@@ -24,7 +24,7 @@ $( document ).ready(function() { ...@@ -24,7 +24,7 @@ $( document ).ready(function() {
} else { } else {
html = '<div class="alert alert-danger" role="alert">' + errorMessage + '</div>'; html = '<div class="alert alert-danger" role="alert">' + errorMessage + '</div>';
} }
$('.col-md-12').first().prepend(html); $('.dropzone').first().parent().prepend(html);
setTimeout(function() { setTimeout(function() {
myDropzone.removeFile(file); myDropzone.removeFile(file);
}, 2000); }, 2000);
......
<style>
.el-select{
display: block;
}
</style>
<template> <template>
<div> <div>
<div class="content-header"> <div class="content-header">
...@@ -163,3 +158,8 @@ ...@@ -163,3 +158,8 @@
} }
} }
</script> </script>
<style>
.el-select{
display: block;
}
</style>
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
<div class="actions el-col el-col-14"> <div class="actions el-col el-col-14">
<new-folder :parent-id="folderId"></new-folder> <new-folder :parent-id="folderId"></new-folder>
<upload-button :parent-id="folderId"></upload-button> <upload-button :parent-id="folderId"></upload-button>
<el-button-group> <el-button-group v-if="false">
<el-button type="primary" :disabled="selectedMedia.length === 0">Move</el-button> <el-button type="primary" :disabled="selectedMedia.length === 0">Move</el-button>
<el-button type="danger" :disabled="selectedMedia.length === 0"
@click.preent="batchDelete" :loading="filesAreDeleting">
Delete
</el-button>
</el-button-group> </el-button-group>
<el-button type="danger" :disabled="selectedMedia.length === 0"
@click.preent="batchDelete" :loading="filesAreDeleting">
Delete
</el-button>
</div> </div>
<div class="search el-col el-col-5"> <div class="search el-col el-col-5">
<el-input icon="search" @change="performSearch" v-model="searchQuery"> <el-input icon="search" @change="performSearch" v-model="searchQuery">
...@@ -72,7 +72,10 @@ ...@@ -72,7 +72,10 @@
<strong v-if="scope.row.is_folder" style="cursor: pointer;" @click="enterFolder(scope)"> <strong v-if="scope.row.is_folder" style="cursor: pointer;" @click="enterFolder(scope)">
{{ scope.row.filename }} {{ scope.row.filename }}
</strong> </strong>
<span v-else>{{ scope.row.filename }}</span> <span v-else>
<a href="#"
@click.prevent="goToEdit(scope)">{{ scope.row.filename }}</a>
</span>
</template> </template>
</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"
...@@ -80,20 +83,27 @@ ...@@ -80,20 +83,27 @@
</el-table-column> </el-table-column>
<el-table-column prop="actions" label="" 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)" <div class="pull-right">
v-if="singleModal && ! scope.row.is_folder"> <el-button
{{ trans('media.insert') }} type="primary"
</a> size="small"
<div v-if="! singleModal"> @click.prevent="insertMedia(scope)"
<a class="btn btn-default btn-flat" @click.prevent="loadEditForm(scope)" v-if="singleModal && ! scope.row.is_folder">
v-if="! scope.row.is_folder"><i class="fa fa-pencil"></i></a> {{ trans('media.insert') }}
</el-button>
<a @click.prevent="showEditFolder(scope.row)" class="btn btn-default btn-flat" <div v-if="! singleModal">
v-if="scope.row.is_folder"> <el-button-group>
<i class="fa fa-pencil"></i> <edit-button :to="{name: 'admin.media.media.edit', params: {mediaId: scope.row.id}}"
</a> v-if="! scope.row.is_folder"></edit-button>
<el-button
<delete-button :scope="scope" :rows="data"></delete-button> size="small"
@click.prevent="showEditFolder(scope.row)"
v-if="scope.row.is_folder && canEditFolders">
<i class="fa fa-pencil"></i>
</el-button>
<delete-button :scope="scope" :rows="data"></delete-button>
</el-button-group>
</div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -153,6 +163,7 @@ ...@@ -153,6 +163,7 @@
{id: 0, name: 'Home'}, {id: 0, name: 'Home'},
], ],
filesAreDeleting: false, filesAreDeleting: false,
canEditFolders: true,
} }
}, },
methods: { methods: {
...@@ -231,10 +242,6 @@ ...@@ -231,10 +242,6 @@
handleSelectionChange(selectedMedia) { handleSelectionChange(selectedMedia) {
this.selectedMedia = selectedMedia; this.selectedMedia = selectedMedia;
}, },
loadEditForm(scope) {
console.log('clicked edit to' + scope.row.id);
this.$router.push({name: 'admin.media.media.edit', params: {mediaId: scope.row.id}})
},
showEditFolder(scope) { showEditFolder(scope) {
this.$events.emit('editFolderWasClicked', scope); this.$events.emit('editFolderWasClicked', scope);
}, },
...@@ -278,8 +285,14 @@ ...@@ -278,8 +285,14 @@
}); });
}); });
}, },
goToEdit(scope) {
this.$router.push({name: 'admin.media.media.edit', params: {mediaId: scope.row.id}})
},
}, },
mounted() { mounted() {
if (window.AsgardCMS.filesystem === 's3') {
this.canEditFolders = false;
}
this.selectedMedia.length = 0; this.selectedMedia.length = 0;
this.fetchMediaData(); this.fetchMediaData();
this.$events.listen('fileWasUploaded', eventData => { this.$events.listen('fileWasUploaded', eventData => {
......
<style>
.new-folder {
float: left;
margin-right: 10px;
}
</style>
<template> <template>
<div> <div>
<el-button type="success" class="new-folder" @click="dialogFormVisible = true"> <el-button type="success" class="new-folder" @click="dialogFormVisible = true">
...@@ -77,3 +71,9 @@ ...@@ -77,3 +71,9 @@
} }
} }
</script> </script>
<style>
.new-folder {
float: left;
margin-right: 10px;
}
</style>
<style>
.el-upload__input {
display: none !important;
}
.el-upload--text {
display: block;
}
.el-upload-dragger {
width: 100%;
}
.media-upload {
margin-bottom: 10px;
}
</style>
<template> <template>
<el-upload <el-upload
class="upload-demo" class="upload-demo"
...@@ -79,3 +64,17 @@ ...@@ -79,3 +64,17 @@
} }
} }
</script> </script>
<style>
.el-upload__input {
display: none !important;
}
.el-upload--text {
display: block;
}
.el-upload-dragger {
width: 100%;
}
.media-upload {
margin-bottom: 10px;
}
</style>
<style>
.el-upload__input {
display: none !important;
}
.el-upload--text {
display: block;
}
.el-upload-dragger {
width: 100%;
}
.media-upload {
margin-bottom: 10px;
}
</style>
<template> <template>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
...@@ -61,3 +47,17 @@ ...@@ -61,3 +47,17 @@
mounted() {} mounted() {}
} }
</script> </script>
<style>
.el-upload__input {
display: none !important;
}
.el-upload--text {
display: block;
}
.el-upload-dragger {
width: 100%;
}
.media-upload {
margin-bottom: 10px;
}
</style>
...@@ -24,7 +24,7 @@ $( document ).ready(function() { ...@@ -24,7 +24,7 @@ $( document ).ready(function() {
} else { } else {
html = '<div class="alert alert-danger" role="alert">' + errorMessage + '</div>'; html = '<div class="alert alert-danger" role="alert">' + errorMessage + '</div>';
} }
$('.col-md-12').first().prepend(html); $('.dropzone').first().parent().prepend(html);
setTimeout(function() { setTimeout(function() {
myDropzone.removeFile(file); myDropzone.removeFile(file);
}, 2000); }, 2000);
......
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