Hide edit folder button for s3 filesystem.

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