From 75142b934704a0e5063c8d4840daee9dde46e255 Mon Sep 17 00:00:00 2001 From: thisfro Date: Tue, 4 May 2021 14:28:06 +0200 Subject: [PATCH] update new offer form --- assets/app.js | 9 ++++++++- templates/app/new_listing.html.twig | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/assets/app.js b/assets/app.js index 2c2535d..67845a1 100644 --- a/assets/app.js +++ b/assets/app.js @@ -18,4 +18,11 @@ import '@fortawesome/fontawesome-free/js/regular' import '@fortawesome/fontawesome-free/js/brands' // Friendly captcha -import "friendly-challenge/widget"; \ No newline at end of file +import "friendly-challenge/widget"; + +// Dsiplay Filename when uploading +document.querySelector('.custom-file-input').addEventListener('change',function(e){ + var fileName = document.getElementById("offering_form_photo").files[0].name; + var nextSibling = e.target.nextElementSibling + nextSibling.innerText = fileName +}) \ No newline at end of file diff --git a/templates/app/new_listing.html.twig b/templates/app/new_listing.html.twig index cfd6899..d9a9547 100644 --- a/templates/app/new_listing.html.twig +++ b/templates/app/new_listing.html.twig @@ -8,5 +8,12 @@ {% endfor %}

Add new offering

- {{ form(offering_form) }} + {{ form_start(offering_form) }} + {{ form_row(offering_form.title) }} + {{ form_row(offering_form.zipCode) }} + {{ form_row(offering_form.description) }} + {{ form_row(offering_form.photo, { + label: 'Choose file' + }) }} + {{ form_end(offering_form) }} {% endblock %} \ No newline at end of file