Skip to content
Snippets Groups Projects
Commit 229c268c authored by Timothee P's avatar Timothee P :sunflower:
Browse files

allow to upload multiple attachments

parent 072edb3a
No related branches found
No related tags found
No related merge requests found
<template>
<div>
<!-- <span v-for="hidden in form.hidden_fields" :key="hidden">
{{ hidden }}
</span> -->
<div class="ui teal segment">
<h4>
Pièce jointe
<button
@click="remove_attachment_formset(form.dataKey)"
@click="removeAttachmentFormset(form.dataKey)"
class="ui small compact right floated icon button remove-formset"
type="button"
>
......@@ -33,9 +29,10 @@
</div>
<div class="required field">
<label>Fichier (PDF, PNG, JPEG)</label>
<!-- // todo : mettre en place la sélection de fichier -->
<!-- @click="selectFile" -->
<label class="ui icon button" for="attachment_file">
<label
class="ui icon button"
:for="'attachment_file' + attachmentForm.dataKey"
>
<i class="file icon"></i>
<span v-if="form.attachment_file.value" class="label">{{
form.attachment_file.value
......@@ -47,11 +44,8 @@
type="file"
style="display: none"
:name="form.attachment_file.html_name"
id="attachment_file"
:id="'attachment_file' + attachmentForm.dataKey"
/>
<!-- // todo: récupérer la valeur :accept="IMAGE_FORMAT" -->
<!-- @change="processImgData" -->
{{ form.attachment_file.errors }}
</div>
</div>
......@@ -113,7 +107,6 @@ export default {
methods: {
initForm(attachmentForm) {
console.log("initForm");
for (let el in attachmentForm) {
if (el && this.form[el]) {
this.form[el].value =
......@@ -123,7 +116,7 @@ export default {
}
}
},
remove_attachment_formset() {
removeAttachmentFormset() {
this.$store.commit(
"feature/REMOVE_ATTACHMENT_FORM",
this.attachmentForm.dataKey
......
......@@ -139,18 +139,6 @@ const feature = {
//DELETE_FEATURE({ state }, feature_slug) {
//console.log("Deleting feature:", feature_slug, state)
/* axios
.post(`${DJANGO_API_BASE}feature_type/`, data)
.then((response) => {
const routerHistory = router.options.routerHistory
commit("SET_USER", response.data.user);
router.push(routerHistory[routerHistory.length - 1] || "/")
dispatch("GET_USER_LEVEL_PROJECTS");
})
.catch(() => {
commit("SET_USER", false)
}); */
// },
// POST_COMMENT({ state }, data) {
//console.log("post comment", data, state)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment