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