%PDF- %PDF-
Direktori : /home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/server/components/ |
Current File : //home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/server/components/qualifications.js |
exports.ids = [28,10]; exports.modules = { /***/ 131: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/slots/Block.vue?vue&type=template&id=0e972406& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{staticClass:"bg-gray py-8 md:py-20 px-4 md:px-8 mb-8"},[_vm._ssrNode("<div class=\"max-w-xl mx-auto w-full\"><header class=\"text-center mb-10\"><h2"+(_vm._ssrClass("text-2xl sm:text-3xl font-bold",_vm.description ? 'mb-8' : ''))+">"+_vm._ssrEscape(_vm._s(_vm.title))+"</h2> "+((_vm.description)?("<p class=\"text-sm sm:text-base\">"+_vm._ssrEscape(_vm._s(_vm.description))+"</p>"):"<!---->")+"</header></div> "),_vm._ssrNode("<div"+(_vm._ssrClass("mx-auto w-full",_vm.width ? _vm.width : 'max-w-xl'))+">","</div>",[_vm._t("default")],2)],2)} var staticRenderFns = [] // CONCATENATED MODULE: ./components/slots/Block.vue?vue&type=template&id=0e972406& // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/slots/Block.vue?vue&type=script&lang=js& // // // // // // // // // // // // // // // // // /* harmony default export */ var Blockvue_type_script_lang_js_ = ({ props: { title: { type: String, required: true }, description: { type: String, required: false }, width: { type: String, required: false } } }); // CONCATENATED MODULE: ./components/slots/Block.vue?vue&type=script&lang=js& /* harmony default export */ var slots_Blockvue_type_script_lang_js_ = (Blockvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(1); // CONCATENATED MODULE: ./components/slots/Block.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( slots_Blockvue_type_script_lang_js_, render, staticRenderFns, false, null, null, "127f880a" ) /* harmony default export */ var Block = __webpack_exports__["default"] = (component.exports); /* nuxt-component-imports */ installComponents(component, {Header: __webpack_require__(12).default}) /***/ }), /***/ 144: /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__.p + "img/pdf-icon.c2fee35.svg"; /***/ }), /***/ 158: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(URL) {// // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // /* harmony default export */ __webpack_exports__["a"] = ({ data() { return { working: false, qualifications: [{ file_preview: { name: null, type: null, url: null }, file: null, name: '', result: '', year: '' }] }; }, async mounted() { this.$axios.$post('/account/verification/qualifications').then(response => { if (response.data.length) { this.qualifications = response.data; } }); }, methods: { async handleFileInput(key) { let fileInputRef = 'qualification-file-' + key; let fileData = this.$refs[fileInputRef][0].files[0]; this.qualifications[key].file_preview.name = fileData.name; this.qualifications[key].file_preview.type = fileData.type; this.qualifications[key].file_preview.url = URL.createObjectURL(fileData); this.qualifications[key].file = fileData; }, add() { this.qualifications.push({ file_preview: { name: null, type: null, url: null }, file: null, name: '', result: '', year: '' }); }, remove(key) { this.qualifications.splice(key, 1); }, async submit() { this.$refs.form.validate().then(success => { if (!success) { return; } this.working = true; let formData = new FormData(); this.qualifications.forEach((value, index) => { formData.append('qualifications[' + index + '][file]', value.file); formData.append('qualifications[' + index + '][existing_file]', JSON.stringify(value.file_preview)); formData.append('qualifications[' + index + '][name]', value.name); formData.append('qualifications[' + index + '][result]', value.result); formData.append('qualifications[' + index + '][year]', value.year); }); this.$axios.$post('/account/verification/qualifications/create', formData, { headers: { 'Content-Type': 'multipart/form-data' } }).then(response => { this.qualifications = response.data; this.$toast.success('Successfully saved your qualifications').goAway(1500); this.working = false; }).catch(error => { this.working = false; this.$refs.form.setErrors(error.response.data.errors); }); }); } } }); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(130)["URL"])) /***/ }), /***/ 200: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/blocks/Account/verification/Qualifications.vue?vue&type=template&id=339bac8b& var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Block',{attrs:{"title":"Qualifications","description":"Please select your highest qualification from the drop down and upload by using the 'choose file button' or dragging the file into the box. You have the option to upload multiple qualifications.","width":"max-w-3xl"}},[_c('ValidationObserver',{ref:"form"},[_c('form',{attrs:{"role":"form","method":"POST"},on:{"submit":function($event){$event.preventDefault();return _vm.submit($event)}}},[_vm._l((_vm.qualifications),function(qualification,key){return _c('div',{key:key,staticClass:"mb-4 relative",class:key !== 0 ? 'border-t-2 border-black border-opacity-10 pt-10' : ''},[_c('ValidationProvider',{attrs:{"rules":"","vid":'file_url-'+(key+1)},scopedSlots:_vm._u([{key:"default",fn:function(x){return [_c('input',{directives:[{name:"model",rawName:"v-model",value:(qualification.file_preview.name),expression:"qualification.file_preview.name"}],attrs:{"type":"hidden","name":"file_url"},domProps:{"value":(qualification.file_preview.name)},on:{"input":function($event){if($event.target.composing){ return; }_vm.$set(qualification.file_preview, "name", $event.target.value)}}})]}}],null,true)}),_vm._v(" "),_c('ValidationProvider',{ref:'provider-'+key,refInFor:true,attrs:{"rules":'required_if:file_url-'+(key+1)+',null|size:10000',"name":'file-'+(key+1)},scopedSlots:_vm._u([{key:"default",fn:function(ref){ var validate = ref.validate; var errors = ref.errors; return [_c('div',{staticClass:"mb-6"},[(qualification.file_preview.name)?_c('div',{staticClass:"flex items-center"},[(qualification.file_preview.type == 'application/pdf' || qualification.file_preview.type == 'pdf')?_c('img',{staticClass:"w-12 mr-5",attrs:{"src":__webpack_require__(144),"alt":"PDF"}}):_c('img',{staticClass:"w-12 mr-5",attrs:{"src":__webpack_require__(144),"alt":"Other"}}),_vm._v(" "),_c('div',{staticClass:"relative"},[_c('span',{staticClass:"block text-md font-medium"},[_vm._v(_vm._s(qualification.file_preview.name))]),_vm._v(" "),_c('label',{staticClass:"uppercase text-blue-light text-sm cursor-pointer",attrs:{"for":'file-'+key}},[_vm._v("\n Replace\n "),_c('input',{ref:'qualification-file-'+key,refInFor:true,staticClass:"hidden",attrs:{"type":"file","id":'file-'+key,"accept":"image/jpeg,image/gif,image/png,application/pdf,image/x-eps"},on:{"change":function($event){return _vm.handleFileInput(key)}}})])])]):_c('div',[_c('label',{staticClass:"block w-full p-4 border border-dashed border-black border-opacity-20 rounded-md hover:bg-black hover:bg-opacity-10 hover:text-black transition cursor-pointer text-center",attrs:{"for":'file-'+key}},[_c('input',{ref:'qualification-file-'+key,refInFor:true,staticClass:"hidden",attrs:{"type":"file","id":'file-'+key},on:{"change":function($event){return _vm.handleFileInput(key)}}}),_vm._v(" "),_c('span',{staticClass:"text-sm text-black"},[_vm._v("Click here to choose file")])])]),_vm._v(" "),(errors[0])?_c('span',{staticClass:"field-invalid"},[_vm._v(_vm._s(errors[0]))]):_vm._e()])]}}],null,true)}),_vm._v(" "),_c('div',{staticClass:"relative"},[_c('div',{staticClass:"absolute right-full pr-5 font-bold"},[_vm._v(_vm._s((key + 1)))]),_vm._v(" "),(key !== 0)?_c('button',{staticClass:"absolute top-0 right-0 z-30 uppercase text-red text-xs focus:outline-none",attrs:{"type":"button"},on:{"click":function($event){return _vm.remove(key)}}},[_vm._v("Remove")]):_vm._e(),_vm._v(" "),_c('t-input-group',{attrs:{"label":"Qualification"}},[_c('ValidationProvider',{attrs:{"rules":"required"},scopedSlots:_vm._u([{key:"default",fn:function(ref){ var errors = ref.errors; return [_c('t-select',{attrs:{"placeholder":"Select...","options":['PHD', 'Masters', 'Post Grad', 'BA/BSC', 'Diploma', 'Foundation Degree']},model:{value:(qualification.name),callback:function ($$v) {_vm.$set(qualification, "name", $$v)},expression:"qualification.name"}}),_vm._v(" "),(errors[0])?_c('span',{staticClass:"field-invalid"},[_vm._v(_vm._s(errors[0]))]):_vm._e()]}}],null,true)})],1)],1),_vm._v(" "),_c('div',{staticClass:"grid grid-cols-1 md:grid-cols-2 gap-x-8"},[_c('t-input-group',{attrs:{"label":"Result"}},[_c('ValidationProvider',{attrs:{"rules":"required"},scopedSlots:_vm._u([{key:"default",fn:function(ref){ var errors = ref.errors; return [_c('t-input',{attrs:{"name":'result-'+key,"id":'result-'+key,"placeholder":"Qualification Result"},model:{value:(qualification.result),callback:function ($$v) {_vm.$set(qualification, "result", $$v)},expression:"qualification.result"}}),_vm._v(" "),(errors[0])?_c('span',{staticClass:"field-invalid"},[_vm._v(_vm._s(errors[0]))]):_vm._e()]}}],null,true)})],1),_vm._v(" "),_c('t-input-group',{attrs:{"label":"Year"}},[_c('ValidationProvider',{attrs:{"rules":"required|numeric","name":"year"},scopedSlots:_vm._u([{key:"default",fn:function(ref){ var errors = ref.errors; return [_c('t-input',{attrs:{"name":'year-'+key,"id":'year-'+key,"placeholder":"Qualification Year"},model:{value:(qualification.year),callback:function ($$v) {_vm.$set(qualification, "year", $$v)},expression:"qualification.year"}}),_vm._v(" "),(errors[0])?_c('span',{staticClass:"field-invalid"},[_vm._v(_vm._s(errors[0]))]):_vm._e()]}}],null,true)})],1)],1)],1)}),_vm._v(" "),_c('div',{staticClass:"flex items-center justify-center mb-10"},[_c('button',{staticClass:"btn btn-small btn-primary rounded-full",attrs:{"disabled":_vm.working == true,"type":"submit"}},[(_vm.working == false)?_c('span',[_vm._v("Save Details")]):_c('span',{staticClass:"flex items-center justify-center"},[_c('svg',{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{"xmlns":"http://www.w3.org/2000/svg","fill":"none","viewBox":"0 0 24 24"}},[_c('circle',{staticClass:"opacity-25",attrs:{"cx":"12","cy":"12","r":"10","stroke":"currentColor","stroke-width":"4"}}),_vm._v(" "),_c('path',{staticClass:"opacity-75",attrs:{"fill":"currentColor","d":"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),_vm._v(" "),_c('span',[_vm._v("Processing")])])])])],2)]),_vm._v(" "),_c('div',{staticClass:"flex items-center justify-center"},[_c('button',{staticClass:"w-full flex items-center justify-center p-4 border border-dashed border-black border-opacity-20 rounded-md uppercase text-blue-light focus:outline-none hover:bg-black hover:bg-opacity-10 hover:text-black transition",attrs:{"type":"button"},on:{"click":_vm.add}},[_c('svg',{staticClass:"w-4 h-4 mr-1",attrs:{"xmlns":"http://www.w3.org/2000/svg","fill":"none","viewBox":"0 0 24 24","stroke":"currentColor"}},[_c('path',{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2","d":"M12 6v6m0 0v6m0-6h6m-6 0H6"}})]),_vm._v(" "),_c('span',[_vm._v("Add Qualification")])])])],1)} var staticRenderFns = [] // CONCATENATED MODULE: ./components/blocks/Account/verification/Qualifications.vue?vue&type=template&id=339bac8b& // EXTERNAL MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/blocks/Account/verification/Qualifications.vue?vue&type=script&lang=js& var Qualificationsvue_type_script_lang_js_ = __webpack_require__(158); // CONCATENATED MODULE: ./components/blocks/Account/verification/Qualifications.vue?vue&type=script&lang=js& /* harmony default export */ var verification_Qualificationsvue_type_script_lang_js_ = (Qualificationsvue_type_script_lang_js_["a" /* default */]); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js var componentNormalizer = __webpack_require__(1); // CONCATENATED MODULE: ./components/blocks/Account/verification/Qualifications.vue /* normalize component */ var component = Object(componentNormalizer["a" /* default */])( verification_Qualificationsvue_type_script_lang_js_, render, staticRenderFns, false, null, null, "e1449596" ) /* harmony default export */ var Qualifications = __webpack_exports__["default"] = (component.exports); /* nuxt-component-imports */ installComponents(component, {Block: __webpack_require__(131).default}) /***/ }) };; //# sourceMappingURL=qualifications.js.map