@mapomodule/uikit 1.0.0-alpha.21 → 1.0.0-alpha.24

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/components/ConfirmDialog.vue +10 -14
  3. package/components/Detail/Detail.vue +246 -365
  4. package/components/DropArea.vue +17 -33
  5. package/components/Form/Form.vue +228 -0
  6. package/components/{Detail/DetailField.vue → Form/FormField.vue} +35 -15
  7. package/components/Form/FormGroup.vue +108 -0
  8. package/components/Form/FormTabs.vue +151 -0
  9. package/components/{Detail → Form}/defaults.js +0 -0
  10. package/components/{fields → Form/fields}/DateField.vue +3 -3
  11. package/components/{fields → Form/fields}/FileField.vue +0 -0
  12. package/components/{fields → Form/fields}/FksField.vue +2 -2
  13. package/components/{fields → Form/fields}/MediaField.vue +4 -5
  14. package/components/{fields → Form/fields}/MediaM2mField.vue +3 -3
  15. package/components/Form/fields/Repeater.vue +575 -0
  16. package/components/{fields → Form/fields}/SeoPreview.vue +10 -10
  17. package/components/{fields → Form/fields}/wygEditor/defaults.js +0 -0
  18. package/components/{fields → Form/fields}/wygEditor/utils/events.js +0 -0
  19. package/components/{fields → Form/fields}/wygEditor/utils/mapomedia.plugin.js +0 -0
  20. package/components/{fields → Form/fields}/wygEditor/utils/script.injector.js +0 -0
  21. package/components/{fields → Form/fields}/wygEditor/wygEditor.vue +0 -0
  22. package/components/LangSwitcher.vue +44 -0
  23. package/components/List/List.vue +14 -15
  24. package/components/List/ListActions.vue +5 -5
  25. package/components/List/ListFilters.vue +9 -2
  26. package/components/List/ListHead.vue +1 -1
  27. package/components/List/ListQuickEdit.vue +21 -104
  28. package/components/List/ListTable.vue +15 -18
  29. package/components/Login.vue +5 -4
  30. package/components/LogoutButton.vue +43 -28
  31. package/components/MediaManager/MediaEditor.vue +20 -18
  32. package/components/MediaManager/MediaFolders.vue +14 -19
  33. package/components/MediaManager/MediaGallery.vue +1 -1
  34. package/components/MediaManager/MediaManager.vue +22 -15
  35. package/components/MediaManager/MediaManagerDialog.vue +2 -1
  36. package/components/MediaManager/MediaUploader.vue +6 -7
  37. package/components/SnackBar.vue +2 -3
  38. package/components/layout/Sidebar/SidebarFooter.vue +6 -25
  39. package/components/layout/Sidebar/SidebarListItem.vue +2 -2
  40. package/components/layout/Sidebar/SidebarProfile.vue +2 -2
  41. package/defaults.js +70 -24
  42. package/module.js +12 -4
  43. package/package.json +4 -3
  44. package/pages/index.vue +1 -1
  45. package/translations/en-US.js +129 -0
  46. package/translations/it-IT.js +131 -0
  47. package/components/fields/Repeater.vue +0 -338
@@ -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">All items selected</b>
33
+ <b v-if="allSelected">{{ $t("mapo.list.allSelected") }}</b>
34
34
  <span v-else-if="selection.length">
35
- {{ selection.length }} items selected
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
- >Select all</v-btn
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="Group Actions"
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
- >Apply</v-btn
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: "Permanent delete",
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: "You need to select at least one item.",
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() {
@@ -7,7 +7,7 @@
7
7
  class="rounded-0 elevation-0"
8
8
  color="primary"
9
9
  :to="{ path: `${$route.path}/new` }"
10
- >Add new &emsp; <v-icon>mdi-plus</v-icon></v-btn
10
+ >{{ $t("mapo.listHead.addNew") }} &emsp; <v-icon>mdi-plus</v-icon></v-btn
11
11
  >
12
12
  </div>
13
13
  </div>
@@ -30,65 +30,23 @@
30
30
  <slot name="body.top" v-bind="slotBindings"></slot>
31
31
 
32
32
  <slot name="body" v-bind="slotBindings">
33
- <v-row>
34
- <div
35
- class="col-12"
36
- :class="field.class"
37
- v-for="(field, index) in computedFields"
38
- :key="index"
39
- >
40
- <v-card v-if="field.group" class="my-2">
41
- <v-card-title>
42
- <v-icon left> {{ field.group.icon }} </v-icon>
43
- <span>{{ field.group.name }}</span>
44
- </v-card-title>
45
- <div class="container">
46
- <div class="row">
47
- <div
48
- v-for="(fields, fieldsI) in field.fields"
49
- :key="fieldsI"
50
- class="col-12"
51
- :class="fields.class"
52
- >
53
- <!-- This is a dynamic slot. You can use it to override a field component. For example use `qedit.fields.title` to override the component of the field with value `title`. -->
54
- <slot
55
- :name="fields.slotName"
56
- v-bind="{
57
- conf: fields,
58
- ...slotBindings,
59
- }"
60
- >
61
- <!-- A [`DetailField`](/components/detail/DetailField/) configured by a [`FieldConfiguration`](#fieldconfiguration). -->
62
- <DetailField
63
- v-model="model"
64
- :langs="langs"
65
- :currentLang="currentLang"
66
- :conf="fields"
67
- :errors="errors"
68
- />
69
- </slot>
70
- </div>
71
- </div>
72
- </div>
73
- </v-card>
74
- <slot
75
- v-else
76
- :name="field.slotName"
77
- v-bind="{
78
- conf: field,
79
- ...slotBindings,
80
- }"
81
- >
82
- <DetailField
83
- v-model="model"
84
- :langs="langs"
85
- :currentLang="currentLang"
86
- :conf="field"
87
- :errors="errors"
88
- />
89
- </slot>
90
- </div>
91
- </v-row>
33
+ <Form
34
+ v-model="model"
35
+ :currentLang="currentLang"
36
+ :languages="langs"
37
+ :errors="errors"
38
+ :fields="editFields"
39
+ :modeSlotBindings="slotBindings"
40
+ >
41
+ <template v-for="(_, slot) in $slots" :slot="slot">
42
+ <!-- @vuese-ignore -->
43
+ <slot :name="slot"></slot>
44
+ </template>
45
+ <template v-for="(_, slot) in $scopedSlots" v-slot:[slot]="props">
46
+ <!-- @vuese-ignore -->
47
+ <slot :name="slot" v-bind="props" />
48
+ </template>
49
+ </Form>
92
50
  </slot>
93
51
  <!-- Use this to add content under the main body. -->
94
52
  <slot name="body.bottom" v-bind="slotBindings"></slot>
@@ -99,8 +57,8 @@
99
57
  <v-messages v-if="nonFieldErrors.length" v-model="nonFieldErrors" color="error"></v-messages>
100
58
  <slot name="actions" v-bind="slotBindings">
101
59
  <v-spacer></v-spacer>
102
- <v-btn text @click="close()"> Cancel </v-btn>
103
- <v-btn text @click="save"> Save </v-btn>
60
+ <v-btn text @click="close()">{{ $t("mapo.cancel") }}</v-btn>
61
+ <v-btn text @click="save">{{ $t("mapo.save") }}</v-btn>
104
62
  </slot>
105
63
  </v-card-actions>
106
64
  </v-card>
@@ -175,14 +133,8 @@ export default {
175
133
  this.close();
176
134
  }
177
135
  },
178
- currentLang() {
179
- this.initLang();
180
- },
181
136
  },
182
137
  computed: {
183
- computedFields() {
184
- return this.mapConf(this.editFields || []);
185
- },
186
138
  langs() {
187
139
  return this.model?.lang_info?.site_languages.map((l) => l.id) || this.languages || [];
188
140
  },
@@ -211,7 +163,6 @@ export default {
211
163
  this.isNew = !item;
212
164
  this.modelBkp = await this.fetchItem(item);
213
165
  this.model = deepClone(this.modelBkp);
214
- this.initLang();
215
166
  this.dialog = true;
216
167
  this.$refs.form?.resetValidation();
217
168
  return new Promise((resolve, reject) => {
@@ -231,40 +182,6 @@ export default {
231
182
  this.resolve && this.resolve(res);
232
183
  this.dialog = false;
233
184
  },
234
- parseConf(field, i) {
235
- const conf = typeof field === "string" ? { value: field } : field;
236
- conf.value = conf.value || "";
237
- conf.value = conf.value.replace(
238
- new RegExp(`^translations\.(${this.langs.join("|")})\.?`),
239
- ""
240
- );
241
- conf.slotName = `fields.${conf.value || i}`;
242
- if (this.currentLang && !field.synci18n) {
243
- const base = `translations.${this.currentLang}`;
244
- conf.value = (conf.value && `${base}.${conf.value}`) || base;
245
- }
246
- return conf;
247
- },
248
- mapConf(fields) {
249
- const icon = "mdi-cube-outline";
250
- const parseGroup = (group) =>
251
- typeof group === "string"
252
- ? { name: group, icon }
253
- : { ...group, icon: group.icon !== undefined ? group.icon : icon };
254
- return fields.map((f, i) =>
255
- f.group
256
- ? { group: parseGroup(f.group), fields: this.mapConf(f.fields) }
257
- : this.parseConf(f, i)
258
- );
259
- },
260
- initLang(lang = this.currentLang) {
261
- if (lang && !this.model.translations) {
262
- this.model.translations = {};
263
- }
264
- if (lang && !this.model.translations[lang]) {
265
- this.model.translations[lang] = {};
266
- }
267
- },
268
185
  async fetchItem(item) {
269
186
  if (!this.offline && item && item[this.lookup]) {
270
187
  return await this.crud.detail(item[this.lookup]);
@@ -301,8 +218,8 @@ export default {
301
218
  this.errors = (badRequest && error.response.data) || null;
302
219
  this.$mapo.$snack.open({
303
220
  message: badRequest
304
- ? "Bad input, correct wrong fields."
305
- : error.response?.data?.detail || "Something whent bad, please try again later...",
221
+ ? this.$t("mapo.listQuickEdit.badInput")
222
+ : error.response?.data?.detail || this.$t("mapo.genericError"),
306
223
  color: "error",
307
224
  });
308
225
  },
@@ -26,7 +26,7 @@
26
26
  search();
27
27
  "
28
28
  prepend-inner-icon="mdi-magnify"
29
- label="Search"
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">Quick</span> add
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>Toggle reordering</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 }">
@@ -131,6 +131,8 @@
131
131
  <script>
132
132
  import { getPointed } from "@mapomodule/utils/helpers/objHelpers";
133
133
  import { debounce } from "@mapomodule/utils/helpers/debounce";
134
+ import { nameSpacedSlots } from "@mapomodule/utils/helpers/slots";
135
+
134
136
  import Sortable from "sortablejs"
135
137
 
136
138
  export default {
@@ -234,7 +236,8 @@ export default {
234
236
  }
235
237
  },
236
238
  methods: {
237
- getPointed: getPointed,
239
+ nameSpacedSlots,
240
+ getPointed,
238
241
  getDataFromApi(clearSelection = true) {
239
242
  if (clearSelection) {
240
243
  this.selection = [];
@@ -271,21 +274,20 @@ export default {
271
274
  });
272
275
  }, 500),
273
276
  changeOrder(event){
274
- if (this.offlineMode) {
275
- const element = this.items[event.oldIndex]
276
- this.items.splice(event.oldIndex, 1, )
277
- this.items.splice(event.newIndex, 0, element);
278
- } else {
277
+ if (!this.offlineMode) {
279
278
  this.crud.update_order(this.items[event.oldIndex][this.lookup], this.items[event.newIndex][this.lookup]).then(
280
279
  res => res.reordered && this.getDataFromApi()
281
280
  ).catch(error => {
282
281
  this.getDataFromApi()
283
282
  this.$mapo.$snack.open({
284
- message: error.response?.data?.detail || "Reorder failed",
283
+ message: error.response?.data?.detail || this.$t("mapo.listTable.errorOrder"),
285
284
  color: "error",
286
285
  })
287
286
  });
288
287
  }
288
+ const element = this.items[event.oldIndex]
289
+ this.items.splice(event.oldIndex, 1, )
290
+ this.items.splice(event.newIndex, 0, element);
289
291
  },
290
292
  setQparams(options) {
291
293
  this.$router.push({
@@ -377,17 +379,12 @@ export default {
377
379
 
378
380
  this.$mapo.$confirm
379
381
  .open({
380
- title: "Delete",
381
- question: "Are you sure you want to delete this item?",
382
- approveButton: { text: "Delete", attrs: { color: "red", text: true } },
382
+ title: this.$t("mapo.delete"),
383
+ question: this.$t("mapo.confirmDelete"),
384
+ approveButton: { text: this.$t("mapo.delete"), attrs: { color: "red", text: true } },
383
385
  })
384
386
  .then((res) => (res ? callback(item) : null));
385
387
  },
386
- nameSpacedSlots(slots, scope) {
387
- return Object.keys(slots)
388
- .filter((name) => name.startsWith(scope))
389
- .map((name) => name.replace(scope, ""));
390
- },
391
388
  toggleSelectAll() {
392
389
  this.selectAll = !this.selectAll;
393
390
  },
@@ -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">Login</h2>
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
- Log In
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: "Cannot login right now. Try again later.", color: "error"})
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
- <v-btn @click.native="logout" class="logout__btn">
3
- <v-icon class="logout__icon">mdi-logout</v-icon>
4
- <span class="logout__text">Logout</span>
5
- </v-btn>
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
- logout() {
13
- this.$store.dispatch("mapo/user/logout");
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>Filename:</b></td>
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>Mime type:</b></td>
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>Created:</b></td>
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>Size:</b></td>
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>Url:</b></td>
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>Linked models:</b></td>
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="Name"
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="Title"
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="Description"
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="Alt name"
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="New file"
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="Maintain old url"
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>Edit</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: "Delete",
299
- question: "Are you sure you want to delete this media?",
300
- approveButton: { text: "Delete", attrs: { color: "red", text: true } },
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
  },