From c3c748eebbe80d199f000da8f3d51a6692a2fd0b Mon Sep 17 00:00:00 2001 From: bkfox Date: Tue, 26 Mar 2024 00:36:51 +0100 Subject: [PATCH] delete sound in list --- aircox/static/aircox/js/chunk-common.js | 4 ++-- .../aircox/dashboard/soundlist_editor.html | 3 +++ aircox/templatetags/aircox_admin.py | 1 + aircox/views/episode.py | 3 --- assets/src/components/ASoundListEditor.vue | 20 ++++++++++++++++--- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/aircox/static/aircox/js/chunk-common.js b/aircox/static/aircox/js/chunk-common.js index 6c871b1..8d6276f 100644 --- a/aircox/static/aircox/js/chunk-common.js +++ b/aircox/static/aircox/js/chunk-common.js @@ -175,7 +175,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mod \**************************************************************************************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model */ \"./src/model.js\");\n/* harmony import */ var _ARows__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ARows */ \"./src/components/ARows.vue\");\n/* harmony import */ var _AModal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AModal */ \"./src/components/AModal.vue\");\n/* harmony import */ var _AFileUpload__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./AFileUpload */ \"./src/components/AFileUpload.vue\");\n\n// import {dropRightWhile, cloneDeep, isEqual} from 'lodash'\n\n\n\n// import AActionButton from './AActionButton'\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n components: {\n ARows: _ARows__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n AModal: _AModal__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n AFileUpload: _AFileUpload__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\n },\n props: {\n initData: Object,\n dataPrefix: String,\n labels: Object,\n settingsUrl: String,\n soundListUrl: String,\n soundUploadUrl: String,\n columns: {\n type: Array,\n default: () => ['name', \"type\", 'is_public', 'is_downloadable']\n }\n },\n data() {\n return {\n set: new _model__WEBPACK_IMPORTED_MODULE_2__.Set(_model__WEBPACK_IMPORTED_MODULE_2__[\"default\"])\n };\n },\n computed: {\n items() {\n return this.set.items;\n },\n rowsSlots() {\n return Object.keys(this.$slots).filter(x => x.startsWith('row-') || x.startsWith('rows-')).map(x => [x, x.startsWith('rows-') ? x.slice(5) : x]);\n }\n },\n methods: {\n listItemMove({\n from,\n to,\n set\n }) {\n set.move(from, to);\n },\n /**\n * Load initial data\n */\n loadData({\n items = [] /*, settings=null*/\n }, reset = false) {\n if (reset) {\n this.set.items = [];\n }\n for (var index in items) this.set.push((0,lodash__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(items[index]));\n // if(settings)\n // this.settingsSaved(settings)\n },\n\n uploadDone(event) {\n const req = event.target;\n if (req.status == 201) {\n const item = JSON.parse(req.response);\n this.set.push(item);\n this.$refs.modal.close();\n }\n }\n },\n watch: {\n initData(val) {\n this.loadData(val);\n }\n },\n mounted() {\n this.initData && this.loadData(this.initData);\n }\n});\n\n//# sourceURL=webpack://aircox-assets/./src/components/ASoundListEditor.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../model */ \"./src/model.js\");\n/* harmony import */ var _ARows__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ARows */ \"./src/components/ARows.vue\");\n/* harmony import */ var _AModal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AModal */ \"./src/components/AModal.vue\");\n/* harmony import */ var _AFileUpload__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./AFileUpload */ \"./src/components/AFileUpload.vue\");\n\n// import {dropRightWhile, cloneDeep, isEqual} from 'lodash'\n\n\n\n// import AActionButton from './AActionButton'\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n components: {\n ARows: _ARows__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n AModal: _AModal__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n AFileUpload: _AFileUpload__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\n },\n props: {\n initData: Object,\n dataPrefix: String,\n labels: Object,\n settingsUrl: String,\n soundListUrl: String,\n soundUploadUrl: String,\n player: Object,\n columns: {\n type: Array,\n default: () => ['name', \"type\", 'is_public', 'is_downloadable']\n }\n },\n data() {\n return {\n set: new _model__WEBPACK_IMPORTED_MODULE_2__.Set(_model__WEBPACK_IMPORTED_MODULE_2__[\"default\"])\n };\n },\n computed: {\n player_() {\n return this.player || window.aircox.player;\n },\n allColumns() {\n return [...this.columns, \"delete\"];\n },\n allColumnsLabels() {\n return {\n ...this.labels,\n ...this.initData.fields\n };\n },\n items() {\n return this.set.items;\n },\n rowsSlots() {\n return Object.keys(this.$slots).filter(x => x.startsWith('row-') || x.startsWith('rows-')).map(x => [x, x.startsWith('rows-') ? x.slice(5) : x]);\n }\n },\n methods: {\n listItemMove({\n from,\n to,\n set\n }) {\n set.move(from, to);\n },\n /**\n * Load initial data\n */\n loadData({\n items = [] /*, settings=null*/\n }, reset = false) {\n if (reset) {\n this.set.items = [];\n }\n for (var index in items) this.set.push((0,lodash__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(items[index]));\n // if(settings)\n // this.settingsSaved(settings)\n },\n\n uploadDone(event) {\n const req = event.target;\n if (req.status == 201) {\n const item = JSON.parse(req.response);\n this.set.push(item);\n this.$refs.modal.close();\n }\n }\n },\n watch: {\n initData(val) {\n this.loadData(val);\n }\n },\n mounted() {\n this.initData && this.loadData(this.initData);\n }\n});\n\n//# sourceURL=webpack://aircox-assets/./src/components/ASoundListEditor.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); /***/ }), @@ -385,7 +385,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \******************************************************************************************************************************************************************************************************************************************************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm-bundler.js\");\n\nconst _hoisted_1 = {\n class: \"a-playlist-editor\"\n};\nconst _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", {\n class: \"icon\"\n}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"i\", {\n class: \"fa fa-upload\"\n})], -1 /* HOISTED */);\nconst _hoisted_3 = {\n class: \"flex-row\"\n};\nconst _hoisted_4 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"flex-grow-1 flex-row\"\n}, null, -1 /* HOISTED */);\nconst _hoisted_5 = {\n class: \"flex-grow-1 align-right\"\n};\nconst _hoisted_6 = [\"title\", \"aria-label\"];\nconst _hoisted_7 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", {\n class: \"icon\"\n}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"i\", {\n class: \"fa fa-rotate\"\n})], -1 /* HOISTED */);\nconst _hoisted_8 = [_hoisted_7];\nconst _hoisted_9 = [\"title\", \"aria-label\"];\nconst _hoisted_10 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", {\n class: \"icon\"\n}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"i\", {\n class: \"fa fa-plus\"\n})], -1 /* HOISTED */);\nconst _hoisted_11 = [_hoisted_10];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_a_file_upload = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-file-upload\");\n const _component_a_modal = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-modal\");\n const _component_a_rows = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-rows\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_modal, {\n ref: \"modal\",\n title: $props.labels && $props.labels.add_sound\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_file_upload, {\n ref: \"file-upload\",\n url: $props.soundUploadUrl,\n label: $props.labels.select_file,\n submitLabel: \"\",\n onLoad: $options.uploadDone\n }, {\n preview: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(({\n upload\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"upload-preview\", {\n upload: upload\n })]),\n form: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"upload-form\")]),\n _: 3 /* FORWARDED */\n }, 8 /* PROPS */, [\"url\", \"label\", \"onLoad\"])]),\n footer: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"button\", {\n type: \"button\",\n class: \"button\",\n onClick: _cache[0] || (_cache[0] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => _ctx.$refs['file-upload'].submit(), [\"stop\"]))\n }, [_hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.labels.submit), 1 /* TEXT */)])]),\n\n _: 3 /* FORWARDED */\n }, 8 /* PROPS */, [\"title\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"top\", {\n set: $data.set,\n items: $data.set.items\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_rows, {\n set: $data.set,\n columns: $props.columns,\n labels: $props.initData.fields,\n \"allow-create\": true,\n orderable: true,\n onMove: $options.listItemMove\n }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($options.rowsSlots, ([name, slot]) => {\n return {\n name: slot,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(data => [name != 'row-tail' ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, name, (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeProps)((0,vue__WEBPACK_IMPORTED_MODULE_0__.mergeProps)({\n key: 0\n }, data))) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true)])\n };\n })]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"set\", \"columns\", \"labels\", \"onMove\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_3, [_hoisted_4, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"button\", {\n type: \"button\",\n class: \"button square is-warning p-2\",\n onClick: _cache[1] || (_cache[1] = $event => $options.loadData({\n items: this.initData.items\n }, true)),\n title: $props.labels.discard_changes,\n \"aria-label\": $props.labels.discard_changes\n }, _hoisted_8, 8 /* PROPS */, _hoisted_6), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"button\", {\n type: \"button\",\n class: \"button square is-primary p-2\",\n onClick: _cache[2] || (_cache[2] = $event => _ctx.$refs.modal.open()),\n title: $props.labels.add_sound,\n \"aria-label\": $props.labels.add_sound\n }, _hoisted_11, 8 /* PROPS */, _hoisted_9)])])]);\n}\n\n//# sourceURL=webpack://aircox-assets/./src/components/ASoundListEditor.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm-bundler.js\");\n\nconst _hoisted_1 = {\n class: \"a-playlist-editor\"\n};\nconst _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", {\n class: \"icon\"\n}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"i\", {\n class: \"fa fa-upload\"\n})], -1 /* HOISTED */);\nconst _hoisted_3 = {\n class: \"flex-row\"\n};\nconst _hoisted_4 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", {\n class: \"flex-grow-1 flex-row\"\n}, null, -1 /* HOISTED */);\nconst _hoisted_5 = {\n class: \"flex-grow-1 align-right\"\n};\nconst _hoisted_6 = [\"title\", \"aria-label\"];\nconst _hoisted_7 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", {\n class: \"icon\"\n}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"i\", {\n class: \"fa fa-rotate\"\n})], -1 /* HOISTED */);\nconst _hoisted_8 = [_hoisted_7];\nconst _hoisted_9 = [\"title\", \"aria-label\"];\nconst _hoisted_10 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", {\n class: \"icon\"\n}, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"i\", {\n class: \"fa fa-plus\"\n})], -1 /* HOISTED */);\nconst _hoisted_11 = [_hoisted_10];\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_a_file_upload = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-file-upload\");\n const _component_a_modal = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-modal\");\n const _component_a_rows = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-rows\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_modal, {\n ref: \"modal\",\n title: $props.labels && $props.labels.add_sound\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_file_upload, {\n ref: \"file-upload\",\n url: $props.soundUploadUrl,\n label: $props.labels.select_file,\n submitLabel: \"\",\n onLoad: $options.uploadDone\n }, {\n preview: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(({\n upload\n }) => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"upload-preview\", {\n upload: upload\n })]),\n form: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"upload-form\")]),\n _: 3 /* FORWARDED */\n }, 8 /* PROPS */, [\"url\", \"label\", \"onLoad\"])]),\n footer: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"button\", {\n type: \"button\",\n class: \"button\",\n onClick: _cache[0] || (_cache[0] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => _ctx.$refs['file-upload'].submit(), [\"stop\"]))\n }, [_hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"span\", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.labels.submit), 1 /* TEXT */)])]),\n\n _: 3 /* FORWARDED */\n }, 8 /* PROPS */, [\"title\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, \"top\", {\n set: $data.set,\n items: $data.set.items\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_rows, {\n set: $data.set,\n columns: $options.allColumns,\n labels: $options.allColumnsLabels,\n \"allow-create\": true,\n orderable: true,\n onMove: $options.listItemMove\n }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({\n _: 2 /* DYNAMIC */\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($options.rowsSlots, ([name, slot]) => {\n return {\n name: slot,\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(data => [name != 'row-tail' ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, name, (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeProps)((0,vue__WEBPACK_IMPORTED_MODULE_0__.mergeProps)({\n key: 0\n }, data))) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true)])\n };\n })]), 1032 /* PROPS, DYNAMIC_SLOTS */, [\"set\", \"columns\", \"labels\", \"onMove\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_3, [_hoisted_4, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"button\", {\n type: \"button\",\n class: \"button square is-warning p-2\",\n onClick: _cache[1] || (_cache[1] = $event => $options.loadData({\n items: this.initData.items\n }, true)),\n title: $props.labels.discard_changes,\n \"aria-label\": $props.labels.discard_changes\n }, _hoisted_8, 8 /* PROPS */, _hoisted_6), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"button\", {\n type: \"button\",\n class: \"button square is-primary p-2\",\n onClick: _cache[2] || (_cache[2] = $event => _ctx.$refs.modal.open()),\n title: $props.labels.add_sound,\n \"aria-label\": $props.labels.add_sound\n }, _hoisted_11, 8 /* PROPS */, _hoisted_9)])])]);\n}\n\n//# sourceURL=webpack://aircox-assets/./src/components/ASoundListEditor.vue?./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B3%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D"); /***/ }), diff --git a/aircox/templates/aircox/dashboard/soundlist_editor.html b/aircox/templates/aircox/dashboard/soundlist_editor.html index 050651c..b37beea 100644 --- a/aircox/templates/aircox/dashboard/soundlist_editor.html +++ b/aircox/templates/aircox/dashboard/soundlist_editor.html @@ -38,5 +38,8 @@ sound-upload-url="{% url "api:sound-list" %}" {% endwith %} {% endfor %} + {% endblock %} diff --git a/aircox/templatetags/aircox_admin.py b/aircox/templatetags/aircox_admin.py index ed8011c..951f0f5 100644 --- a/aircox/templatetags/aircox_admin.py +++ b/aircox/templatetags/aircox_admin.py @@ -66,6 +66,7 @@ inline_labels_ = { "discard_changes": _("Discard changes"), "select_file": _("Select a file"), "submit": _("Submit"), + "delete": _("Delete"), # track list "columns": _("Columns"), "timestamp": _("Timestamp"), diff --git a/aircox/views/episode.py b/aircox/views/episode.py index 5c16c31..c4d3fc8 100644 --- a/aircox/views/episode.py +++ b/aircox/views/episode.py @@ -55,9 +55,6 @@ class EpisodeUpdateView(UserPassesTestMixin, BaseProgramMixin, PageUpdateView): program = self.get_object().program return self.request.user.has_perm("aircox.%s" % program.change_permission_codename) - def get_success_url(self): - return reverse("episode-detail", kwargs={"slug": self.get_object().slug}) - def get_tracklist_queryset(self, episode): return Track.objects.filter(episode=episode).order_by("position") diff --git a/assets/src/components/ASoundListEditor.vue b/assets/src/components/ASoundListEditor.vue index 1ca43b7..f8b780a 100644 --- a/assets/src/components/ASoundListEditor.vue +++ b/assets/src/components/ASoundListEditor.vue @@ -24,8 +24,8 @@ -