@mapomodule/uikit 1.0.0-alpha.23 → 1.0.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/components/ConfirmDialog.vue +10 -14
- package/components/Detail/Detail.vue +12 -12
- package/components/DropArea.vue +17 -33
- package/components/Form/FormGroup.vue +15 -1
- package/components/Form/FormTabs.vue +13 -1
- package/components/Form/fields/DateField.vue +3 -3
- package/components/Form/fields/FksField.vue +2 -2
- package/components/Form/fields/MediaField.vue +10 -5
- package/components/Form/fields/MediaM2mField.vue +3 -3
- package/components/Form/fields/Repeater.vue +7 -7
- package/components/Form/fields/SeoPreview.vue +5 -9
- package/components/LangSwitcher.vue +44 -0
- package/components/List/List.vue +14 -15
- package/components/List/ListActions.vue +5 -5
- package/components/List/ListFilters.vue +9 -2
- package/components/List/ListHead.vue +1 -1
- package/components/List/ListQuickEdit.vue +4 -4
- package/components/List/ListTable.vue +11 -12
- package/components/Login.vue +5 -4
- package/components/LogoutButton.vue +43 -28
- package/components/MediaManager/MediaEditor.vue +20 -18
- package/components/MediaManager/MediaFolders.vue +14 -19
- package/components/MediaManager/MediaGallery.vue +1 -1
- package/components/MediaManager/MediaManager.vue +22 -15
- package/components/MediaManager/MediaManagerDialog.vue +2 -1
- package/components/MediaManager/MediaUploader.vue +6 -7
- package/components/SnackBar.vue +2 -3
- package/components/layout/Sidebar/SidebarFooter.vue +6 -25
- package/components/layout/Sidebar/SidebarListItem.vue +2 -2
- package/components/layout/Sidebar/SidebarProfile.vue +2 -2
- package/defaults/i18n.js +37 -0
- package/{defaults.js → defaults/vuetify.js} +16 -12
- package/module.js +6 -4
- package/package.json +3 -2
- package/pages/index.vue +1 -1
- package/translations/en-US.js +129 -0
- package/translations/it-IT.js +131 -0
package/components/List/List.vue
CHANGED
|
@@ -30,18 +30,18 @@
|
|
|
30
30
|
<!-- Overrides counter for selected items. -->
|
|
31
31
|
<slot name="item-counter" v-bind="{ selection, canSelectAll, allSelected, toggleSelectAll }">
|
|
32
32
|
<div v-if="selection" class="caption mr-1 mb-1">
|
|
33
|
-
<b v-if="allSelected">
|
|
33
|
+
<b v-if="allSelected">{{ $t("mapo.list.allSelected") }}</b>
|
|
34
34
|
<span v-else-if="selection.length">
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
{{ $t("mapo.list.NSelected", {numberItems: selection.length}) }}
|
|
36
|
+
<v-btn
|
|
37
|
+
v-if="selection != 'all' && canSelectAll"
|
|
38
|
+
@click="toggleSelectAll"
|
|
39
|
+
outlined
|
|
40
|
+
tile
|
|
41
|
+
x-small
|
|
42
|
+
class="ml-1 d-inline-flex"
|
|
43
|
+
>{{ $t("mapo.list.selectAll") }}</v-btn
|
|
44
|
+
>
|
|
45
45
|
</span>
|
|
46
46
|
</div>
|
|
47
47
|
</slot>
|
|
@@ -84,7 +84,8 @@ export default {
|
|
|
84
84
|
selection: [],
|
|
85
85
|
allSelected: false,
|
|
86
86
|
filters: [],
|
|
87
|
-
dragOrderingActive: false
|
|
87
|
+
dragOrderingActive: false,
|
|
88
|
+
selectionQuery: null,
|
|
88
89
|
};
|
|
89
90
|
},
|
|
90
91
|
props: {
|
|
@@ -99,13 +100,11 @@ export default {
|
|
|
99
100
|
crud() {
|
|
100
101
|
return this.$mapo.$api.crud(this.endpoint);
|
|
101
102
|
},
|
|
102
|
-
selectionQuery() {
|
|
103
|
-
return this.$refs?.dtable?.getHttpParams();
|
|
104
|
-
}
|
|
105
103
|
},
|
|
106
104
|
watch: {
|
|
107
105
|
selection(val) {
|
|
108
106
|
this.allSelected = val == 'all';
|
|
107
|
+
this.selectionQuery = this.$refs.dtable.getHttpParams();
|
|
109
108
|
// Fires when you select some row of the table.
|
|
110
109
|
// @arg Emit "all" if all items are selected, else the list of the selected rows.
|
|
111
110
|
this.$emit("selectionChange", val);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="isActive" class="d-flex flex-row align-center fill-height">
|
|
3
3
|
<v-select
|
|
4
|
-
label="
|
|
4
|
+
:label="$t('mapo.listActions.groupActions')"
|
|
5
5
|
v-bind="$attrs"
|
|
6
6
|
v-model="action"
|
|
7
7
|
:items="filteredActions"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
color="primary"
|
|
22
22
|
:disabled="!action"
|
|
23
23
|
@click="handleAction"
|
|
24
|
-
>
|
|
24
|
+
>{{ $t("mapo.apply") }}</v-btn
|
|
25
25
|
>
|
|
26
26
|
</div>
|
|
27
27
|
</template>
|
|
@@ -51,7 +51,7 @@ export default {
|
|
|
51
51
|
default() {
|
|
52
52
|
return [
|
|
53
53
|
{
|
|
54
|
-
label: "
|
|
54
|
+
label: this.$t("mapo.listActions.permanentDelete"),
|
|
55
55
|
handler: function ({ selection, lookup, crud }) {
|
|
56
56
|
return Promise.all(selection.map((i) => crud && crud.delete(i[lookup])));
|
|
57
57
|
},
|
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
methods: {
|
|
95
|
-
isDisabled(action){
|
|
95
|
+
isDisabled(action){
|
|
96
96
|
const p = typeof action.permissions == "string" ? [action.permissions] : action.permissions || []
|
|
97
97
|
if (p.length){
|
|
98
98
|
return !p.every(a => this.userCan(a))
|
|
@@ -108,7 +108,7 @@ export default {
|
|
|
108
108
|
handleAction() {
|
|
109
109
|
if (!this.selectAll && !this.selection.length) {
|
|
110
110
|
return this.$mapo.$snack.open({
|
|
111
|
-
message: "
|
|
111
|
+
message: this.$t("mapo.listActions.selectionRequired"),
|
|
112
112
|
color: "error",
|
|
113
113
|
});
|
|
114
114
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<v-menu offset-y min-width="250px" max-width="400px" nudge-top="-5px" tile :close-on-content-click="false" v-bind="{ ...$attrs, value: null }" >
|
|
6
6
|
<template v-slot:activator="{ on }">
|
|
7
7
|
<v-btn v-bind="$attrs" v-on="on" text>
|
|
8
|
-
filter <v-icon>mdi-filter-variant</v-icon>
|
|
8
|
+
{{ $t("mapo.listFilters.filter") }} <v-icon>mdi-filter-variant</v-icon>
|
|
9
9
|
</v-btn>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
@click="removeFilter(filter)"
|
|
66
66
|
small
|
|
67
67
|
tile
|
|
68
|
-
>clear</v-btn
|
|
68
|
+
>{{ $t("mapo.clear") }}</v-btn
|
|
69
69
|
>
|
|
70
70
|
</div>
|
|
71
71
|
<v-list v-else class="overflow-y-auto pa-0" max-height="200" dense>
|
|
@@ -310,6 +310,13 @@ export default {
|
|
|
310
310
|
this.cleanActiveFilters()
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
|
+
},
|
|
314
|
+
filters: {
|
|
315
|
+
deep: true,
|
|
316
|
+
handler(val) {
|
|
317
|
+
this.loadFilters();
|
|
318
|
+
this.restoreFromQparams();
|
|
319
|
+
}
|
|
313
320
|
}
|
|
314
321
|
},
|
|
315
322
|
created() {
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
<v-messages v-if="nonFieldErrors.length" v-model="nonFieldErrors" color="error"></v-messages>
|
|
58
58
|
<slot name="actions" v-bind="slotBindings">
|
|
59
59
|
<v-spacer></v-spacer>
|
|
60
|
-
<v-btn text @click="close()">
|
|
61
|
-
<v-btn text @click="save">
|
|
60
|
+
<v-btn text @click="close()">{{ $t("mapo.cancel") }}</v-btn>
|
|
61
|
+
<v-btn text @click="save">{{ $t("mapo.save") }}</v-btn>
|
|
62
62
|
</slot>
|
|
63
63
|
</v-card-actions>
|
|
64
64
|
</v-card>
|
|
@@ -218,8 +218,8 @@ export default {
|
|
|
218
218
|
this.errors = (badRequest && error.response.data) || null;
|
|
219
219
|
this.$mapo.$snack.open({
|
|
220
220
|
message: badRequest
|
|
221
|
-
? "
|
|
222
|
-
: error.response?.data?.detail || "
|
|
221
|
+
? this.$t("mapo.listQuickEdit.badInput")
|
|
222
|
+
: error.response?.data?.detail || this.$t("mapo.genericError"),
|
|
223
223
|
color: "error",
|
|
224
224
|
});
|
|
225
225
|
},
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
search();
|
|
27
27
|
"
|
|
28
28
|
prepend-inner-icon="mdi-magnify"
|
|
29
|
-
label="
|
|
29
|
+
:label="$t('mapo.search')"
|
|
30
30
|
single-line
|
|
31
31
|
hide-details
|
|
32
32
|
outlined
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
<v-spacer></v-spacer>
|
|
41
41
|
<v-btn text v-if="quickModeEnabled && userCan('add')" class="ml-2" @click="quickAction()">
|
|
42
42
|
<v-icon small left class="d-none d-sm-block mr-2"> mdi-plus </v-icon>
|
|
43
|
-
<span class="d-none d-sm-block">
|
|
43
|
+
<span class="d-none d-sm-block">{{ $t("mapo.listTable.quickAdd") }}</span>
|
|
44
44
|
</v-btn>
|
|
45
45
|
<v-btn v-if="serverPaginationEnabled" class=" mx-sm-2 ma-2 mx-0" @click="getDataFromApi(false)" icon>
|
|
46
46
|
<v-icon>mdi-update</v-icon>
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
<v-btn v-bind="attrs" v-on="on" style="margin-left: 2px;" :class="{'primary--text': dragOrderingActive}" @click="dragOrderingActive = !dragOrderingActive" icon>
|
|
55
55
|
<v-icon>mdi-order-bool-ascending</v-icon></v-btn>
|
|
56
56
|
</template>
|
|
57
|
-
<span>
|
|
57
|
+
<span>{{ $t("mapo.listTable.toggleOrder") }}</span>
|
|
58
58
|
</v-tooltip>
|
|
59
59
|
</template>
|
|
60
60
|
<template v-if="navigable" v-slot:[`item.${firstColName}`]="{ item }">
|
|
@@ -274,21 +274,20 @@ export default {
|
|
|
274
274
|
});
|
|
275
275
|
}, 500),
|
|
276
276
|
changeOrder(event){
|
|
277
|
-
if (this.offlineMode) {
|
|
278
|
-
const element = this.items[event.oldIndex]
|
|
279
|
-
this.items.splice(event.oldIndex, 1, )
|
|
280
|
-
this.items.splice(event.newIndex, 0, element);
|
|
281
|
-
} else {
|
|
277
|
+
if (!this.offlineMode) {
|
|
282
278
|
this.crud.update_order(this.items[event.oldIndex][this.lookup], this.items[event.newIndex][this.lookup]).then(
|
|
283
279
|
res => res.reordered && this.getDataFromApi()
|
|
284
280
|
).catch(error => {
|
|
285
281
|
this.getDataFromApi()
|
|
286
282
|
this.$mapo.$snack.open({
|
|
287
|
-
message: error.response?.data?.detail || "
|
|
283
|
+
message: error.response?.data?.detail || this.$t("mapo.listTable.errorOrder"),
|
|
288
284
|
color: "error",
|
|
289
285
|
})
|
|
290
286
|
});
|
|
291
287
|
}
|
|
288
|
+
const element = this.items[event.oldIndex]
|
|
289
|
+
this.items.splice(event.oldIndex, 1, )
|
|
290
|
+
this.items.splice(event.newIndex, 0, element);
|
|
292
291
|
},
|
|
293
292
|
setQparams(options) {
|
|
294
293
|
this.$router.push({
|
|
@@ -380,9 +379,9 @@ export default {
|
|
|
380
379
|
|
|
381
380
|
this.$mapo.$confirm
|
|
382
381
|
.open({
|
|
383
|
-
title: "
|
|
384
|
-
question:
|
|
385
|
-
approveButton: { text: "
|
|
382
|
+
title: this.$t("mapo.delete"),
|
|
383
|
+
question: this.$t("mapo.confirmDelete"),
|
|
384
|
+
approveButton: { text: this.$t("mapo.delete"), attrs: { color: "red", text: true } },
|
|
386
385
|
})
|
|
387
386
|
.then((res) => (res ? callback(item) : null));
|
|
388
387
|
},
|
package/components/Login.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="login__wrapper">
|
|
3
3
|
<div class="login__inner">
|
|
4
|
-
<h2 class="login__inner__title">
|
|
4
|
+
<h2 class="login__inner__title">{{ $t("mapo.login") }}</h2>
|
|
5
5
|
|
|
6
6
|
<div class="login__form__outer">
|
|
7
7
|
<v-form
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
></v-text-field>
|
|
36
36
|
<div class="text-center">
|
|
37
37
|
<v-btn type="submit" class="rounded-0" elevation="0" dark>
|
|
38
|
-
|
|
38
|
+
{{ $t("mapo.login") }}
|
|
39
39
|
</v-btn>
|
|
40
40
|
<v-messages
|
|
41
41
|
v-model="errors.non_field_errors"
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
class="mt-4 text-center"
|
|
44
44
|
/>
|
|
45
45
|
</div>
|
|
46
|
-
|
|
47
46
|
</v-form>
|
|
48
47
|
</div>
|
|
49
48
|
</div>
|
|
50
49
|
</div>
|
|
51
50
|
</template>
|
|
51
|
+
|
|
52
52
|
<script>
|
|
53
53
|
export default {
|
|
54
54
|
data() {
|
|
@@ -89,13 +89,14 @@ export default {
|
|
|
89
89
|
.catch((error) => {
|
|
90
90
|
this.errors = error.response?.data || {}
|
|
91
91
|
if (!Object.keys(this.errors).length){
|
|
92
|
-
this.$mapo.$snack.open({message: "
|
|
92
|
+
this.$mapo.$snack.open({message: this.$t("mapo.loginError"), color: "error"})
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
},
|
|
96
96
|
},
|
|
97
97
|
};
|
|
98
98
|
</script>
|
|
99
|
+
|
|
99
100
|
<style lang="scss">
|
|
100
101
|
@import "@mapomodule/uikit/assets/variables.scss";
|
|
101
102
|
.login {
|
|
@@ -1,39 +1,54 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
<v-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<div class="d-flex">
|
|
3
|
+
<v-list-item dense class="darker__item" link @click.native="login">
|
|
4
|
+
<v-list-item-icon>
|
|
5
|
+
<v-icon v-if="$mapo.$auth.user.isLoggedIn">mdi-logout</v-icon>
|
|
6
|
+
<v-icon v-else>mdi-login</v-icon>
|
|
7
|
+
</v-list-item-icon>
|
|
8
|
+
<v-list-item-title>{{
|
|
9
|
+
$mapo.$auth.user.isLoggedIn ? $t("mapo.logout") : $t("mapo.login")
|
|
10
|
+
}}</v-list-item-title>
|
|
11
|
+
</v-list-item>
|
|
12
|
+
<v-list-item
|
|
13
|
+
dense
|
|
14
|
+
link
|
|
15
|
+
v-if="$i18n.locales.length > 1"
|
|
16
|
+
class="lang__selector darker__item"
|
|
17
|
+
>
|
|
18
|
+
<LangSwitcher></LangSwitcher>
|
|
19
|
+
</v-list-item>
|
|
20
|
+
</div>
|
|
6
21
|
</template>
|
|
7
22
|
|
|
23
|
+
<style lang="scss" scoped>
|
|
24
|
+
.darker__item {
|
|
25
|
+
&.theme--light {
|
|
26
|
+
background: #ffffffd6;
|
|
27
|
+
filter: invert(1);
|
|
28
|
+
}
|
|
29
|
+
&.theme--dark {
|
|
30
|
+
background: #121212;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
.lang__selector {
|
|
34
|
+
max-width: 70px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
padding: 0;
|
|
37
|
+
v-select {
|
|
38
|
+
border-radius: 0px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
42
|
+
|
|
8
43
|
<script>
|
|
9
44
|
export default {
|
|
10
45
|
name: "LogoutButton",
|
|
11
46
|
methods: {
|
|
12
|
-
|
|
13
|
-
this.$
|
|
47
|
+
login() {
|
|
48
|
+
this.$mapo.$auth.user.isLoggedIn
|
|
49
|
+
? this.$store.dispatch("mapo/user/logout")
|
|
50
|
+
: this.$router.push("/login");
|
|
14
51
|
},
|
|
15
52
|
},
|
|
16
53
|
};
|
|
17
54
|
</script>
|
|
18
|
-
|
|
19
|
-
<style lang="scss" scoped>
|
|
20
|
-
.logout {
|
|
21
|
-
&__btn {
|
|
22
|
-
padding: 0.5rem 1rem!important;
|
|
23
|
-
height: auto!important;
|
|
24
|
-
}
|
|
25
|
-
&__icon {
|
|
26
|
-
margin-right: 0.5rem;
|
|
27
|
-
font-size: 1rem;
|
|
28
|
-
}
|
|
29
|
-
&__text {
|
|
30
|
-
text-align: left;
|
|
31
|
-
display: block;
|
|
32
|
-
width: 100%;
|
|
33
|
-
font-size: 1rem;
|
|
34
|
-
text-transform: capitalize;
|
|
35
|
-
font-weight: 400;
|
|
36
|
-
letter-spacing: initial;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
</style>
|
|
@@ -33,29 +33,29 @@
|
|
|
33
33
|
<v-col md="6" cols="12" class="info-media">
|
|
34
34
|
<table class="text-caption fill-height pb-md-10">
|
|
35
35
|
<tr>
|
|
36
|
-
<td class="pr-3"><b>
|
|
36
|
+
<td class="pr-3"><b>{{ $t("mapo.fileName") }}:</b></td>
|
|
37
37
|
<td>{{ fileName }}</td>
|
|
38
38
|
</tr>
|
|
39
39
|
<tr>
|
|
40
|
-
<td class="pr-3"><b>
|
|
40
|
+
<td class="pr-3"><b>{{ $t("mapo.mime") }}:</b></td>
|
|
41
41
|
<td>{{ media.mime_type }}</td>
|
|
42
42
|
</tr>
|
|
43
43
|
<tr>
|
|
44
|
-
<td class="pr-3"><b>
|
|
44
|
+
<td class="pr-3"><b>{{ $t("mapo.created") }}:</b></td>
|
|
45
45
|
<td>{{ dateCreated }}</td>
|
|
46
46
|
</tr>
|
|
47
47
|
<tr>
|
|
48
|
-
<td class="pr-3"><b>
|
|
48
|
+
<td class="pr-3"><b>{{ $t("mapo.size") }}:</b></td>
|
|
49
49
|
<td>{{ fileSize }}</td>
|
|
50
50
|
</tr>
|
|
51
51
|
<tr>
|
|
52
|
-
<td class="pr-3"><b>
|
|
52
|
+
<td class="pr-3"><b>URL:</b></td>
|
|
53
53
|
<td>
|
|
54
54
|
<a :href="media.file" target="_blank">{{ media.file }}</a>
|
|
55
55
|
</td>
|
|
56
56
|
</tr>
|
|
57
57
|
<tr>
|
|
58
|
-
<td class="pr-3"><b>
|
|
58
|
+
<td class="pr-3"><b>{{ $t("mapo.linkedModels") }}:</b></td>
|
|
59
59
|
<td>
|
|
60
60
|
<ul>
|
|
61
61
|
<li v-for="link in media.links" :key="link.id">
|
|
@@ -72,28 +72,28 @@
|
|
|
72
72
|
<v-text-field
|
|
73
73
|
dense
|
|
74
74
|
v-model="media.name"
|
|
75
|
-
label="
|
|
75
|
+
:label="$t('mapo.name')"
|
|
76
76
|
></v-text-field>
|
|
77
77
|
</v-col>
|
|
78
78
|
<v-col sm="6" md="12" cols="12">
|
|
79
79
|
<v-text-field
|
|
80
80
|
dense
|
|
81
81
|
v-model="media.title"
|
|
82
|
-
label="
|
|
82
|
+
:label="$t('mapo.titleTag')"
|
|
83
83
|
></v-text-field>
|
|
84
84
|
</v-col>
|
|
85
85
|
<v-col sm="6" md="12" cols="12">
|
|
86
86
|
<v-text-field
|
|
87
87
|
dense
|
|
88
88
|
v-model="media.description"
|
|
89
|
-
label="
|
|
89
|
+
:label="$t('mapo.description')"
|
|
90
90
|
></v-text-field>
|
|
91
91
|
</v-col>
|
|
92
92
|
<v-col sm="6" md="12" cols="12">
|
|
93
93
|
<v-text-field
|
|
94
94
|
dense
|
|
95
95
|
v-model="media.alt_text"
|
|
96
|
-
label="
|
|
96
|
+
:label="$t('mapo.altTag')"
|
|
97
97
|
></v-text-field>
|
|
98
98
|
</v-col>
|
|
99
99
|
<v-col sm="6" md="12" cols="12" class="d-flex align-center">
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
<v-file-input
|
|
102
102
|
v-model="newFile"
|
|
103
103
|
:accept="accept"
|
|
104
|
-
label="
|
|
104
|
+
:label="$t('mapo.mediaEditor.changeFile')"
|
|
105
105
|
show-size
|
|
106
106
|
dense
|
|
107
107
|
prepend-icon
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
<v-checkbox
|
|
110
110
|
v-if="newFile"
|
|
111
111
|
v-model="sameUrl"
|
|
112
|
-
label="
|
|
112
|
+
:label="$t('mapo.mediaEditor.maintainOldUrl')"
|
|
113
113
|
class="ma-0"
|
|
114
114
|
hide-details
|
|
115
115
|
dense
|
|
@@ -149,11 +149,11 @@
|
|
|
149
149
|
:class="{ 'pr-0': editing }"
|
|
150
150
|
@click="editing = !editing"
|
|
151
151
|
>
|
|
152
|
-
<span>
|
|
152
|
+
<span>{{ $t("mapo.edit") }}</span>
|
|
153
153
|
<v-icon :style="rotate">mdi-chevron-up</v-icon>
|
|
154
154
|
<div class="edit_spacer" :class="{ 'flex-grow-1': editing }"></div>
|
|
155
155
|
<v-btn v-if="editing" text tile color="primary" @click="saveMedia">
|
|
156
|
-
save
|
|
156
|
+
{{ $t("mapo.save") }}
|
|
157
157
|
</v-btn>
|
|
158
158
|
<v-btn
|
|
159
159
|
v-if="editing"
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
color="error"
|
|
163
163
|
@click.stop="deleteMedia"
|
|
164
164
|
>
|
|
165
|
-
delete
|
|
165
|
+
{{ $t("mapo.delete") }}
|
|
166
166
|
</v-btn>
|
|
167
167
|
</v-btn>
|
|
168
168
|
</div>
|
|
@@ -170,6 +170,7 @@
|
|
|
170
170
|
</v-container>
|
|
171
171
|
</div>
|
|
172
172
|
</template>
|
|
173
|
+
|
|
173
174
|
<style lang="scss" scoped>
|
|
174
175
|
table tr td:nth-child(2) {
|
|
175
176
|
overflow-wrap: anywhere;
|
|
@@ -287,6 +288,7 @@ export default {
|
|
|
287
288
|
alt_text: this.media.alt_text,
|
|
288
289
|
file: this.newFile || undefined,
|
|
289
290
|
same_url: (this.newFile && this.sameUrl) || undefined,
|
|
291
|
+
language_code: this.$i18n.locale
|
|
290
292
|
};
|
|
291
293
|
this.newFile = null;
|
|
292
294
|
this.sameUrl = false;
|
|
@@ -295,9 +297,9 @@ export default {
|
|
|
295
297
|
deleteMedia() {
|
|
296
298
|
this.$mapo.$confirm
|
|
297
299
|
.open({
|
|
298
|
-
title: "
|
|
299
|
-
question:
|
|
300
|
-
approveButton: { text: "
|
|
300
|
+
title: this.$t("mapo.delete"),
|
|
301
|
+
question: this.$t("mapo.mediaEditor.confirmDelete"),
|
|
302
|
+
approveButton: { text: this.$t("mapo.delete"), attrs: { color: "red", text: true } },
|
|
301
303
|
})
|
|
302
304
|
.then((res) => res && this.$emit("deleteMedia", this.media));
|
|
303
305
|
},
|
|
@@ -58,18 +58,18 @@
|
|
|
58
58
|
</div>
|
|
59
59
|
</div>
|
|
60
60
|
<div class="flex-grow-1 text-center" v-if="!folders.length">
|
|
61
|
-
|
|
61
|
+
{{ $t("mapo.mediaFolders.noFolders") }}
|
|
62
62
|
</div>
|
|
63
63
|
<div class="ma-auto mr-2 mb-2">
|
|
64
|
-
<v-tooltip
|
|
64
|
+
<v-tooltip left>
|
|
65
65
|
<template v-slot:activator="{ on, attrs }">
|
|
66
66
|
<v-icon v-bind="attrs" v-on="on" @click.stop="createFolder">
|
|
67
67
|
mdi-plus
|
|
68
68
|
</v-icon>
|
|
69
69
|
</template>
|
|
70
|
-
<span>
|
|
70
|
+
<span>{{ $t("mapo.mediaFolders.newFolder") }}</span>
|
|
71
71
|
</v-tooltip>
|
|
72
|
-
<v-tooltip v-if="folders.length"
|
|
72
|
+
<v-tooltip v-if="folders.length" bottom>
|
|
73
73
|
<template v-slot:activator="{ on, attrs }">
|
|
74
74
|
<v-icon
|
|
75
75
|
v-bind="attrs"
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
mdi-chevron-down
|
|
81
81
|
</v-icon>
|
|
82
82
|
</template>
|
|
83
|
-
<span>{{ expanded ? "
|
|
83
|
+
<span>{{ expanded ? $t("mapo.collapse") : $t("mapo.expand") }}</span>
|
|
84
84
|
</v-tooltip>
|
|
85
85
|
</div>
|
|
86
86
|
</v-card-actions>
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
<v-dialog v-model="dialog" max-width="300px">
|
|
95
95
|
<v-card>
|
|
96
96
|
<v-card-title>
|
|
97
|
-
{{ folderEdit.id ? "
|
|
97
|
+
{{ folderEdit.id ? $t("mapo.mediaFolders.editFolder") : $t("mapo.mediaFolders.newFolder") }}
|
|
98
98
|
</v-card-title>
|
|
99
99
|
|
|
100
100
|
<v-card-text>
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
<v-col cols="12">
|
|
104
104
|
<v-text-field
|
|
105
105
|
v-model="folderEdit.title"
|
|
106
|
-
label="
|
|
106
|
+
:label="$t('mapo.mediaFolders.folderName')"
|
|
107
107
|
></v-text-field>
|
|
108
108
|
</v-col>
|
|
109
109
|
</v-row>
|
|
@@ -112,13 +112,14 @@
|
|
|
112
112
|
|
|
113
113
|
<v-card-actions>
|
|
114
114
|
<v-spacer></v-spacer>
|
|
115
|
-
<v-btn color="primary" text @click="closeEdit">
|
|
116
|
-
<v-btn color="primary" text @click="saveFolder">
|
|
115
|
+
<v-btn color="primary" text @click="closeEdit">{{ $t('mapo.cancel') }}</v-btn>
|
|
116
|
+
<v-btn color="primary" text @click="saveFolder">{{ $t('mapo.create') }}</v-btn>
|
|
117
117
|
</v-card-actions>
|
|
118
118
|
</v-card>
|
|
119
119
|
</v-dialog>
|
|
120
120
|
</div>
|
|
121
121
|
</template>
|
|
122
|
+
|
|
122
123
|
<style lang="scss" scoped>
|
|
123
124
|
.media-folders-wrapper{
|
|
124
125
|
width: 100%;
|
|
@@ -173,13 +174,7 @@ export default {
|
|
|
173
174
|
return {
|
|
174
175
|
expanded: false,
|
|
175
176
|
dialog: false,
|
|
176
|
-
folderEdit: {}
|
|
177
|
-
actions: [
|
|
178
|
-
{
|
|
179
|
-
label: "Create folder",
|
|
180
|
-
action: this.createFolder
|
|
181
|
-
}
|
|
182
|
-
]
|
|
177
|
+
folderEdit: {}
|
|
183
178
|
};
|
|
184
179
|
},
|
|
185
180
|
props: {
|
|
@@ -207,9 +202,9 @@ export default {
|
|
|
207
202
|
deleteFolder(folder) {
|
|
208
203
|
this.$mapo.$confirm
|
|
209
204
|
.open({
|
|
210
|
-
title: "
|
|
211
|
-
question:
|
|
212
|
-
approveButton: { text: "
|
|
205
|
+
title: this.$t("mapo.delete"),
|
|
206
|
+
question: this.$t("mapo.mediaFolders.confirmDelete"),
|
|
207
|
+
approveButton: { text: this.$t("mapo.delete"), attrs: { color: "red", text: true } }
|
|
213
208
|
})
|
|
214
209
|
.then(res => res && this.$emit("deleteFolder", folder));
|
|
215
210
|
},
|