{"version":3,"sources":["webpack:///./src/views/admin/courses/Index.vue?bf26","webpack:///./src/views/admin/courses/AddRemoveCategory.vue?6114","webpack:///./src/views/admin/courses/AddRemoveCategory.vue","webpack:///./src/views/admin/courses/AddRemoveCategory.vue?6c5f","webpack:///./src/views/admin/courses/AddRemoveCategory.vue?860e","webpack:///./src/views/admin/courses/Index.vue","webpack:///./src/views/admin/courses/Index.vue?48f0","webpack:///./src/views/admin/courses/Index.vue?cbf1"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","model","value","callback","$$v","search","expression","name","_v","on","getItems","headers","items","loading","scopedSlots","_u","key","fn","ref","item","_s","price","toLocaleString","minimumFractionDigits","maximumFractionDigits","disabled","_g","params","id","$event","addRemoveCategory","courseId","deleteCourse","dialog","dialogContent","tag","selectedItem","staticRenderFns","close","course","categories","selectedCategories","addCategories","savedCategories","length","staticStyle","_l","cat","i","removeCategory","proxy","_e","$emit","$notify","type","title","text","$confirm","color","confirmation","categoryId","getAllCategories","getSavedCategories","watch","component","VAlert","VAutocomplete","VBtn","VCard","VCardText","VCardTitle","VDivider","VIcon","VSimpleTable","VSpacer","align","filterable","width","sortable","a","get","$store","getters","res","data","authHeader","delete","metaInfo","components","AddRemoveCategory","VBadge","VCol","VContainer","VDataTable","VDialog","VList","VListItem","VListItemIcon","VListItemTitle","VMenu","VRow","VTextField"],"mappings":"uHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACA,EAAG,cAAc,CAACE,YAAY,QAAQ,CAACF,EAAG,QAAQ,CAACA,EAAG,QAAQ,CAACG,MAAM,CAAC,KAAO,OAAO,CAACH,EAAG,SAAS,CAACA,EAAG,eAAe,CAACA,EAAG,eAAe,CAACG,MAAM,CAAC,cAAc,cAAc,MAAQ,MAAM,cAAc,GAAG,eAAe,GAAG,UAAY,IAAIC,MAAM,CAACC,MA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,QAAA,KAAMuB,QAAA,KAAMC,YAAA,KAAUC,gBAAA,KAAcC,eAAA,OAAeC,QAAA,KAAMC,OAAA,KAAK1B,UAAA,KAAQ2B,aAAA","file":"js/chunk-2d237ec7.6f08fb7a.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('v-container',{staticClass:\"my-4\"},[_c('v-row',[_c('v-col',{attrs:{\"cols\":\"12\"}},[_c('v-card',[_c('v-card-title',[_c('v-text-field',{attrs:{\"append-icon\":\"mdi-magnify\",\"label\":\"Ara\",\"single-line\":\"\",\"hide-details\":\"\",\"clearable\":\"\"},model:{value:(_vm.search),callback:function ($$v) {_vm.search=$$v},expression:\"search\"}}),_c('v-spacer'),_c('v-btn',{attrs:{\"color\":\"primary\",\"text\":\"\",\"to\":{ name: 'AdminCourseCreate' }}},[_c('v-icon',{staticClass:\"mr-2\"},[_vm._v(\"mdi-plus-circle\")]),_c('span',[_vm._v(\"EĞİTİM OLUŞTUR\")])],1),_c('v-btn',{attrs:{\"icon\":\"\"},on:{\"click\":_vm.getItems}},[_c('v-icon',{staticClass:\"mr-2\"},[_vm._v(\"mdi-refresh\")])],1)],1),_c('v-data-table',{attrs:{\"headers\":_vm.headers,\"items\":_vm.items,\"search\":_vm.search,\"loading\":_vm.loading,\"loading-text\":\"Yükleniyor...\"},scopedSlots:_vm._u([{key:\"item.price\",fn:function(ref){\nvar item = ref.item;\nreturn [_vm._v(\" \"+_vm._s(item.price.toLocaleString(\"tr-TR\", { minimumFractionDigits: 2, maximumFractionDigits: 2 }))+\" \")]}},{key:\"item.disabled\",fn:function(ref){\nvar item = ref.item;\nreturn [_c('div',{staticClass:\"pl-4\"},[_c('v-badge',{attrs:{\"dot\":\"\",\"color\":item.disabled ? 'error' : 'success'}})],1)]}},{key:\"item.actions\",fn:function(ref){\nvar item = ref.item;\nreturn [_c('v-menu',{attrs:{\"close-on-content-click\":\"\"},scopedSlots:_vm._u([{key:\"activator\",fn:function(ref){\nvar on = ref.on;\nreturn [_c('v-btn',_vm._g({attrs:{\"icon\":\"\"}},on),[_c('v-icon',[_vm._v(\"mdi-dots-vertical\")])],1)]}}],null,true)},[_c('v-list',{attrs:{\"dense\":\"\"}},[_c('v-list-item',{attrs:{\"to\":{\n name: 'AdminCourseSessions',\n params: { id: item.id }\n }}},[_c('v-list-item-icon',[_c('v-icon',[_vm._v(\"mdi-video\")])],1),_c('v-list-item-title',[_vm._v(\"Dersleri Yönet\")])],1),_c('v-list-item',{attrs:{\"to\":{\n name: 'AdminCourseOrders',\n params: { id: item.id }\n }}},[_c('v-list-item-icon',[_c('v-icon',[_vm._v(\"mdi-shopping\")])],1),_c('v-list-item-title',[_vm._v(\"Sipariş Dökümü\")])],1),_c('v-list-item',{on:{\"click\":function($event){return _vm.addRemoveCategory(item)}}},[_c('v-list-item-icon',[_c('v-icon',[_vm._v(\"mdi-folder-plus\")])],1),_c('v-list-item-title',[_vm._v(\"Kategori Ekle/Sil\")])],1),_c('v-divider'),_c('v-list-item',{attrs:{\"to\":{\n name: 'AdminCourseEdit',\n params: { courseId: item.id }\n }}},[_c('v-list-item-icon',[_c('v-icon',[_vm._v(\"mdi-file-edit\")])],1),_c('v-list-item-title',[_vm._v(\"Düzenle\")])],1),_c('v-list-item',{on:{\"click\":function($event){return _vm.deleteCourse(item)}}},[_c('v-list-item-icon',[_c('v-icon',[_vm._v(\"mdi-delete\")])],1),_c('v-list-item-title',[_vm._v(\"Sil\")])],1)],1)],1)]}}],null,true)})],1)],1)],1)],1),_c('v-dialog',{attrs:{\"max-width\":\"600\",\"persistent\":\"\"},model:{value:(_vm.dialog),callback:function ($$v) {_vm.dialog=$$v},expression:\"dialog\"}},[_c(_vm.dialogContent,{tag:\"component\",attrs:{\"course\":_vm.selectedItem},on:{\"close\":function($event){_vm.dialog = false},\"refresh\":_vm.getItems}})],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('v-card',[_c('v-card-title',{staticClass:\"pr-3\"},[_vm._v(\"Kategori Ekle/Sil \"),_c('v-spacer'),_c('v-btn',{attrs:{\"icon\":\"\"},on:{\"click\":_vm.close}},[_c('v-icon',[_vm._v(\"close\")])],1)],1),_c('v-divider'),_c('v-card-text',[_c('h1',{staticClass:\"my-6\"},[_vm._v(_vm._s(_vm.course.name))]),_c('v-autocomplete',{attrs:{\"items\":_vm.categories,\"disabled\":_vm.disabled,\"item-text\":\"name\",\"item-value\":\"id\",\"label\":\"Kategori seç\",\"multiple\":\"\",\"chips\":\"\"},model:{value:(_vm.selectedCategories),callback:function ($$v) {_vm.selectedCategories=$$v},expression:\"selectedCategories\"}}),_c('v-btn',{attrs:{\"block\":\"\",\"color\":\"primary\",\"elevation\":\"0\"},on:{\"click\":function($event){return _vm.addCategories()}}},[_vm._v(\" SEÇİLİ KATEGORİLERİ EKLE \")]),(_vm.savedCategories.length > 0)?_c('v-simple-table',{staticClass:\"mt-8\",scopedSlots:_vm._u([{key:\"default\",fn:function(){return [_c('thead',[_c('tr',[_c('th',[_vm._v(\"Kayıtlı Kategoriler\")]),_c('th',{staticClass:\"text-center\",staticStyle:{\"width\":\"4%\"}})])]),_c('tbody',_vm._l((_vm.savedCategories),function(cat,i){return _c('tr',{key:i},[_c('td',[_vm._v(_vm._s(cat.name))]),_c('td',[_c('v-btn',{attrs:{\"icon\":\"\",\"color\":\"primary\"},on:{\"click\":function($event){return _vm.removeCategory(cat.id)}}},[_c('v-icon',[_vm._v(\"mdi-close\")])],1)],1)])}),0)]},proxy:true}],null,false,1816597345)}):_vm._e(),(_vm.selectedCategories.length == 0)?_c('v-alert',{staticClass:\"mt-8\",attrs:{\"color\":\"grey lighten-3\",\"elevation\":\"0\"}},[_vm._v(\" Bu eğitim herhangi bir kategoriye eklenmedi. \")]):_vm._e()],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Vue, Component, Prop } from \"vue-property-decorator\";\r\n\r\ninterface Category {\r\n id: string;\r\n name: string;\r\n}\r\n\r\ninterface Course {\r\n id: string;\r\n name: string;\r\n}\r\n\r\n@Component({\r\n watch: {\r\n async course() {\r\n await this.getAllCategories();\r\n await this.getSavedCategories();\r\n }\r\n }\r\n})\r\nexport default class AddRemoveCategory extends Vue {\r\n @Prop() course!: Course;\r\n\r\n disabled = false;\r\n\r\n categories = [] as Category[];\r\n\r\n savedCategories = [] as Category[];\r\n\r\n selectedCategories = [] as string[];\r\n\r\n close() {\r\n this.selectedCategories = [];\r\n this.$emit(\"close\");\r\n }\r\n\r\n async getAllCategories() {\r\n this.categories = [];\r\n\r\n try {\r\n // const categoryQs = await firebase\r\n // .firestore()\r\n // .collection(\"/apps/kahev-akademi/categories\")\r\n // .orderBy(\"name\")\r\n // .get();\r\n // categoryQs.forEach(catDoc => {\r\n // this.categories.push({\r\n // id: catDoc.id,\r\n // name: catDoc.data().name\r\n // });\r\n // });\r\n } catch (e) {\r\n this.$notify({\r\n type: \"error\",\r\n title: \"Hata!\",\r\n text: \"Kategoriler alınamadı.\"\r\n });\r\n\r\n throw e;\r\n }\r\n }\r\n\r\n async getSavedCategories() {\r\n this.savedCategories = [];\r\n this.selectedCategories = [];\r\n\r\n try {\r\n // const courseDoc = await firebase\r\n // .firestore()\r\n // .doc(`/apps/kahev-akademi/courses/${this.course.id}`)\r\n // .get();\r\n // if (courseDoc.exists) {\r\n // const catIds = courseDoc.data()?.categories as string[];\r\n // catIds.forEach(id => {\r\n // const i = this.categories.findIndex(c => c.id == id);\r\n // const category = this.categories[i];\r\n // this.savedCategories.push(category);\r\n // this.selectedCategories.push(id);\r\n // });\r\n // }\r\n } catch (e) {\r\n this.$notify({\r\n type: \"error\",\r\n title: \"Hata!\",\r\n text: \"Kayıtlı kategoriler alınamadı.\"\r\n });\r\n\r\n throw e;\r\n }\r\n }\r\n\r\n async addCategories() {\r\n const confirmation = await this.$confirm(\"Seçili kategorileri eklemek istediğinizden emin misiniz?\", { title: \"Emin misini?\", color: \"warning\" });\r\n\r\n if (!confirmation) return;\r\n\r\n try {\r\n // // Kategorileri kaydet\r\n // await firebase\r\n // .firestore()\r\n // .doc(`/apps/kahev-akademi/courses/${this.course.id}`)\r\n // .update({\r\n // categories: this.selectedCategories\r\n // });\r\n // await this.getSavedCategories();\r\n // // Arka planda kategorilerin eğitim sayılarını güncelle\r\n // this.selectedCategories.forEach(cat => {\r\n // firebase\r\n // .firestore()\r\n // .doc(`/apps/kahev-akademi/categories/${cat}`)\r\n // .update({\r\n // count: firebase.firestore.FieldValue.increment(1)\r\n // });\r\n // });\r\n } catch (e) {\r\n this.$notify({\r\n type: \"error\",\r\n title: \"Hata!\",\r\n text: \"Kategoriler eklenemedi.\"\r\n });\r\n\r\n throw e;\r\n }\r\n }\r\n\r\n async removeCategory(categoryId: string) {\r\n const confirmation = await this.$confirm(\"Bu işlem geri alınamaz. Seçili kategoriyi silmek istediğinizden emin misiniz?\", { title: \"Emin misini?\", color: \"warning\" });\r\n\r\n if (!confirmation) return;\r\n\r\n try {\r\n // // Kategoriyi hafızadan sil\r\n // const i = this.selectedCategories.findIndex(c => c == categoryId);\r\n // this.selectedCategories.splice(i, 1);\r\n // // Kategorileri kaydet\r\n // await firebase\r\n // .firestore()\r\n // .doc(`/apps/kahev-akademi/courses/${this.course.id}`)\r\n // .update({\r\n // categories: this.selectedCategories\r\n // });\r\n // await this.getSavedCategories();\r\n // // Arka planda kategorilerin eğitim sayılarını güncelle\r\n // firebase\r\n // .firestore()\r\n // .doc(`/apps/kahev-akademi/categories/${categoryId}`)\r\n // .update({\r\n // count: firebase.firestore.FieldValue.increment(-1)\r\n // });\r\n } catch (e) {\r\n this.$notify({\r\n type: \"error\",\r\n title: \"Hata!\",\r\n text: \"Kategori silinemedi.\"\r\n });\r\n\r\n throw e;\r\n }\r\n }\r\n\r\n async mounted() {\r\n await this.getAllCategories();\r\n await this.getSavedCategories();\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AddRemoveCategory.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AddRemoveCategory.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./AddRemoveCategory.vue?vue&type=template&id=3964912c&\"\nimport script from \"./AddRemoveCategory.vue?vue&type=script&lang=ts&\"\nexport * from \"./AddRemoveCategory.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VAlert } from 'vuetify/lib/components/VAlert';\nimport { VAutocomplete } from 'vuetify/lib/components/VAutocomplete';\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VCard } from 'vuetify/lib/components/VCard';\nimport { VCardText } from 'vuetify/lib/components/VCard';\nimport { VCardTitle } from 'vuetify/lib/components/VCard';\nimport { VDivider } from 'vuetify/lib/components/VDivider';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VSimpleTable } from 'vuetify/lib/components/VDataTable';\nimport { VSpacer } from 'vuetify/lib/components/VGrid';\ninstallComponents(component, {VAlert,VAutocomplete,VBtn,VCard,VCardText,VCardTitle,VDivider,VIcon,VSimpleTable,VSpacer})\n","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Vue, Component } from \"vue-property-decorator\";\r\nimport axios from \"axios\";\r\nimport { Course } from \"@/types\";\r\nimport AddRemoveCategory from \"./AddRemoveCategory.vue\";\r\n\r\n@Component({\r\n metaInfo() {\r\n return {\r\n title: \"Eğitimler / Admin\"\r\n };\r\n },\r\n components: {\r\n AddRemoveCategory\r\n }\r\n})\r\nexport default class AdminCoursesView extends Vue {\r\n search = \"\";\r\n loading = false;\r\n headers = [\r\n {\r\n text: \"Ders Adı\",\r\n align: \"start\",\r\n filterable: true,\r\n value: \"name\"\r\n },\r\n { text: \"Eğitmen\", value: \"instructors\" },\r\n { text: \"Ücret\", value: \"price\" },\r\n { text: \"Durum\", value: \"disabled\", width: \"90px\" },\r\n { text: \"\", value: \"actions\", sortable: false, width: \"50px\" }\r\n ];\r\n items = [] as Course[];\r\n selectedItem = {};\r\n dialog = false;\r\n dialogContent = \"\";\r\n\r\n async getItems() {\r\n try {\r\n this.loading = true;\r\n\r\n var res = await axios.get(\"/api/course/get-all\", {\r\n headers: this.$store.getters[\"auth/requestAuthHeader\"]\r\n });\r\n\r\n this.items = res.data;\r\n } catch (e: unknown) {\r\n this.$notify({\r\n type: \"error\",\r\n title: \"Hata!\",\r\n text: `Ders listesi alınamadı.`\r\n });\r\n } finally {\r\n this.loading = false;\r\n }\r\n }\r\n\r\n async deleteCourse(course: Course) {\r\n const confirmation = await this.$confirm(\"Bu işlem geri alınamaz. Eğitimi silmek istediğinizden emin misiniz?\", { title: \"Emin misini?\", color: \"warning\" });\r\n\r\n if (!confirmation) return;\r\n\r\n try {\r\n // Eğitimi sil\r\n const authHeader = this.$store.getters[\"auth/requestAuthHeader\"];\r\n var res = await axios.delete(`/api/course/${course.id}`, {\r\n headers: authHeader\r\n });\r\n\r\n this.$notify({\r\n type: \"success\",\r\n title: \"İşlem Tamam\",\r\n text: \"Eğitim başarıyla silindi.\"\r\n });\r\n\r\n await this.getItems();\r\n } catch (e) {\r\n this.$notify({\r\n type: \"eror\",\r\n title: \"Hata!\",\r\n text: \"Eğitim silinemedi.\"\r\n });\r\n\r\n throw e;\r\n }\r\n }\r\n\r\n async mounted() {\r\n await this.getItems();\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Index.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Index.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Index.vue?vue&type=template&id=b9963ac4&\"\nimport script from \"./Index.vue?vue&type=script&lang=ts&\"\nexport * from \"./Index.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports\n\n/* vuetify-loader */\nimport installComponents from \"!../../../../node_modules/vuetify-loader/lib/runtime/installComponents.js\"\nimport { VBadge } from 'vuetify/lib/components/VBadge';\nimport { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VCard } from 'vuetify/lib/components/VCard';\nimport { VCardTitle } from 'vuetify/lib/components/VCard';\nimport { VCol } from 'vuetify/lib/components/VGrid';\nimport { VContainer } from 'vuetify/lib/components/VGrid';\nimport { VDataTable } from 'vuetify/lib/components/VDataTable';\nimport { VDialog } from 'vuetify/lib/components/VDialog';\nimport { VDivider } from 'vuetify/lib/components/VDivider';\nimport { VIcon } from 'vuetify/lib/components/VIcon';\nimport { VList } from 'vuetify/lib/components/VList';\nimport { VListItem } from 'vuetify/lib/components/VList';\nimport { VListItemIcon } from 'vuetify/lib/components/VList';\nimport { VListItemTitle } from 'vuetify/lib/components/VList';\nimport { VMenu } from 'vuetify/lib/components/VMenu';\nimport { VRow } from 'vuetify/lib/components/VGrid';\nimport { VSpacer } from 'vuetify/lib/components/VGrid';\nimport { VTextField } from 'vuetify/lib/components/VTextField';\ninstallComponents(component, {VBadge,VBtn,VCard,VCardTitle,VCol,VContainer,VDataTable,VDialog,VDivider,VIcon,VList,VListItem,VListItemIcon,VListItemTitle,VMenu,VRow,VSpacer,VTextField})\n"],"sourceRoot":""}