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> <template>
<div> <div>
<!-- <span v-for="hidden in form.hidden_fields" :key="hidden">
{{ hidden }}
</span> -->
<div class="ui teal segment"> <div class="ui teal segment">
<h4> <h4>
Pièce jointe Pièce jointe
<button <button
@click="remove_attachment_formset(form.dataKey)" @click="removeAttachmentFormset(form.dataKey)"
class="ui small compact right floated icon button remove-formset" class="ui small compact right floated icon button remove-formset"
type="button" type="button"
> >
...@@ -33,9 +29,10 @@ ...@@ -33,9 +29,10 @@
</div> </div>
<div class="required field"> <div class="required field">
<label>Fichier (PDF, PNG, JPEG)</label> <label>Fichier (PDF, PNG, JPEG)</label>
<!-- // todo : mettre en place la sélection de fichier --> <label
<!-- @click="selectFile" --> class="ui icon button"
<label class="ui icon button" for="attachment_file"> :for="'attachment_file' + attachmentForm.dataKey"
>
<i class="file icon"></i> <i class="file icon"></i>
<span v-if="form.attachment_file.value" class="label">{{ <span v-if="form.attachment_file.value" class="label">{{
form.attachment_file.value form.attachment_file.value
...@@ -47,11 +44,8 @@ ...@@ -47,11 +44,8 @@
type="file" type="file"
style="display: none" style="display: none"
:name="form.attachment_file.html_name" :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 }} {{ form.attachment_file.errors }}
</div> </div>
</div> </div>
...@@ -113,7 +107,6 @@ export default { ...@@ -113,7 +107,6 @@ export default {
methods: { methods: {
initForm(attachmentForm) { initForm(attachmentForm) {
console.log("initForm");
for (let el in attachmentForm) { for (let el in attachmentForm) {
if (el && this.form[el]) { if (el && this.form[el]) {
this.form[el].value = this.form[el].value =
...@@ -123,7 +116,7 @@ export default { ...@@ -123,7 +116,7 @@ export default {
} }
} }
}, },
remove_attachment_formset() { removeAttachmentFormset() {
this.$store.commit( this.$store.commit(
"feature/REMOVE_ATTACHMENT_FORM", "feature/REMOVE_ATTACHMENT_FORM",
this.attachmentForm.dataKey this.attachmentForm.dataKey
......
...@@ -139,18 +139,6 @@ const feature = { ...@@ -139,18 +139,6 @@ const feature = {
//DELETE_FEATURE({ state }, feature_slug) { //DELETE_FEATURE({ state }, feature_slug) {
//console.log("Deleting feature:", feature_slug, state) //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) { // POST_COMMENT({ state }, data) {
//console.log("post comment", data, state) //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