Skip to content

Commit

Permalink
Revert "debut ajout pdf"
Browse files Browse the repository at this point in the history
This reverts commit 57ea880.
  • Loading branch information
ThomasCast3 committed Jun 16, 2023
1 parent 57ea880 commit 8f7dd4f
Showing 1 changed file with 11 additions and 39 deletions.
50 changes: 11 additions & 39 deletions front-end/src/components/RessourcesComponents/AddCourse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,16 @@
</h3>
<div class="modal-body">
<form class="w-full max-w-sm">
<input type="text" name="title" v-model="tag" placeholder="Title :" /><br />
<VueDatePicker
placeholder="debut"
v-model="periodStart"
:format="dateFormat"
:language="datePickerLanguage"
/>
<VueDatePicker
placeholder="fin"
v-model="periodEnd"
:format="dateFormat"
:language="datePickerLanguage"
/>
<input type="url" placeholder="picture link" v-model="picture" /><br />
<input type="text" name="language" v-model="language" placeholder="Language :" /><br />
<input type="text" name="title" v-model="this.tag" placeholder="Title :" /><br />
<input type="datetime-local" class="text-field" v-model="this.periodStart" /><br />
<input type="datetime-local" class="text-field" v-model="this.periodEnd" /><br />
<input type="url" placeholder="picture link" v-model="this.picture" /><br />
<input
type="text"
name="language"
v-model="this.language"
placeholder="Language :"
/><br />
<div class="flex justify-center mt-6">
<button
class="px-4 py-2 text-white bg-blue-500 rounded-lg hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50"
Expand All @@ -46,8 +41,6 @@

<script lang="ts">
import { useCoursStore } from '@/store/modules/course.store';
import VueDatePicker from '@vuepic/vue-datepicker';
import Swal from 'sweetalert2';
export default {
name: 'AddCourses',
Expand All @@ -64,17 +57,11 @@ export default {
project: [],
site: '',
teacherId: '',
dateFormat: 'yyyy-MM-dd HH:mm',
datePickerLanguage: 'fr', // Langue du date picker
selectedFile: null,
base64String: '',
};
},
methods: {
AddCourses(event) {
AddCourses() {
const course = useCoursStore();
this.newCourse = {
tag: this.tag,
classTag: '',
Expand All @@ -90,21 +77,6 @@ export default {
};
course.addCourse(this.newCourse);
},
onFileSelected(event) {
this.selectedFile = event.target.files[0];
this.convertToBase64();
},
convertToBase64() {
if (this.selectedFile) {
const reader = new FileReader();
reader.onload = (event) => {
let result = event.target.result;
this.base64String = result.toString();
};
reader.readAsDataURL(this.selectedFile);
}
},
},
};
</script>
Expand Down

0 comments on commit 8f7dd4f

Please sign in to comment.