Hide edit folder button for s3 filesystem.

Allign buttons to the right
parent eed6baf4
...@@ -80,20 +80,22 @@ ...@@ -80,20 +80,22 @@
</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"> <a class="btn btn-primary btn-flat" @click.prevent="insertMedia(scope)"
{{ trans('media.insert') }} v-if="singleModal && ! scope.row.is_folder">
</a> {{ trans('media.insert') }}
<div v-if="! singleModal">
<a class="btn btn-default btn-flat" @click.prevent="loadEditForm(scope)"
v-if="! scope.row.is_folder"><i class="fa fa-pencil"></i></a>
<a @click.prevent="showEditFolder(scope.row)" class="btn btn-default btn-flat"
v-if="scope.row.is_folder">
<i class="fa fa-pencil"></i>
</a> </a>
<div v-if="! singleModal">
<a class="btn btn-default btn-flat" @click.prevent="loadEditForm(scope)"
v-if="! scope.row.is_folder"><i class="fa fa-pencil"></i></a>
<a @click.prevent="showEditFolder(scope.row)" class="btn btn-default btn-flat"
v-if="scope.row.is_folder && canEditFolders">
<i class="fa fa-pencil"></i>
</a>
<delete-button :scope="scope" :rows="data"></delete-button> <delete-button :scope="scope" :rows="data"></delete-button>
</div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -153,6 +155,7 @@ ...@@ -153,6 +155,7 @@
{id: 0, name: 'Home'}, {id: 0, name: 'Home'},
], ],
filesAreDeleting: false, filesAreDeleting: false,
canEditFolders: true,
} }
}, },
methods: { methods: {
...@@ -280,6 +283,9 @@ ...@@ -280,6 +283,9 @@
}, },
}, },
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 => {
......
...@@ -82,7 +82,8 @@ ...@@ -82,7 +82,8 @@
currentLocale: '{{ locale() }}', currentLocale: '{{ locale() }}',
editor: '{{ $activeEditor }}', editor: '{{ $activeEditor }}',
adminPrefix: '{{ config('asgard.core.core.admin-prefix') }}', adminPrefix: '{{ config('asgard.core.core.admin-prefix') }}',
hideDefaultLocaleInURL: '{{ config('laravellocalization.hideDefaultLocaleInURL') }}' hideDefaultLocaleInURL: '{{ config('laravellocalization.hideDefaultLocaleInURL') }}',
filesystem: '{{ config('asgard.media.config.filesystem') }}'
}; };
</script> </script>
......
...@@ -93997,6 +93997,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de ...@@ -93997,6 +93997,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
// //
// //
// //
//
//
exports.default = { exports.default = {
components: { components: {
...@@ -94025,7 +94027,8 @@ exports.default = { ...@@ -94025,7 +94027,8 @@ exports.default = {
folderId: 0, folderId: 0,
selectedMedia: {}, selectedMedia: {},
folderBreadcrumb: [{ id: 0, name: 'Home' }], folderBreadcrumb: [{ id: 0, name: 'Home' }],
filesAreDeleting: false filesAreDeleting: false,
canEditFolders: true
}; };
}, },
...@@ -94155,6 +94158,9 @@ exports.default = { ...@@ -94155,6 +94158,9 @@ exports.default = {
mounted: function mounted() { mounted: function mounted() {
var _this4 = this; var _this4 = this;
if (window.AsgardCMS.filesystem === 's3') {
this.canEditFolders = false;
}
this.selectedMedia.length = 0; this.selectedMedia.length = 0;
this.fetchMediaData(); this.fetchMediaData();
this.$events.listen('fileWasUploaded', function (eventData) { this.$events.listen('fileWasUploaded', function (eventData) {
...@@ -95316,81 +95322,89 @@ var render = function() { ...@@ -95316,81 +95322,89 @@ var render = function() {
key: "default", key: "default",
fn: function(scope) { fn: function(scope) {
return [ return [
_vm.singleModal && !scope.row.is_folder _c("div", { staticClass: "pull-right" }, [
? _c( _vm.singleModal && !scope.row.is_folder
"a", ? _c(
{ "a",
staticClass: "btn btn-primary btn-flat", {
on: { staticClass: "btn btn-primary btn-flat",
click: function($event) { on: {
$event.preventDefault() click: function($event) {
_vm.insertMedia(scope) $event.preventDefault()
_vm.insertMedia(scope)
}
} }
} },
}, [
[ _vm._v(
_vm._v( "\n " +
"\n " + _vm._s(_vm.trans("media.insert")) +
_vm._s(_vm.trans("media.insert")) + "\n "
"\n " )
) ]
] )
) : _vm._e(),
: _vm._e(), _vm._v(" "),
_vm._v(" "), !_vm.singleModal
!_vm.singleModal ? _c(
? _c( "div",
"div", [
[ !scope.row.is_folder
!scope.row.is_folder ? _c(
? _c( "a",
"a", {
{ staticClass:
staticClass: "btn btn-default btn-flat",
"btn btn-default btn-flat", on: {
on: { click: function($event) {
click: function($event) { $event.preventDefault()
$event.preventDefault() _vm.loadEditForm(scope)
_vm.loadEditForm(scope) }
} }
} },
}, [
[ _c("i", {
_c("i", { staticClass: "fa fa-pencil"
staticClass: "fa fa-pencil" })
}) ]
] )
) : _vm._e(),
: _vm._e(), _vm._v(" "),
_vm._v(" "), scope.row.is_folder &&
scope.row.is_folder _vm.canEditFolders
? _c( ? _c(
"a", "a",
{ {
staticClass: staticClass:
"btn btn-default btn-flat", "btn btn-default btn-flat",
on: { on: {
click: function($event) { click: function($event) {
$event.preventDefault() $event.preventDefault()
_vm.showEditFolder(scope.row) _vm.showEditFolder(
scope.row
)
}
} }
} },
}, [
[ _c("i", {
_c("i", { staticClass: "fa fa-pencil"
staticClass: "fa fa-pencil" })
}) ]
] )
) : _vm._e(),
: _vm._e(), _vm._v(" "),
_vm._v(" "), _c("delete-button", {
_c("delete-button", { attrs: {
attrs: { scope: scope, rows: _vm.data } scope: scope,
}) rows: _vm.data
], }
1 })
) ],
: _vm._e() 1
)
: _vm._e()
])
] ]
} }
} }
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