update new offer form

This commit is contained in:
Jannis Portmann 2021-05-04 14:28:06 +02:00
parent eaebcaad57
commit 75142b9347
2 changed files with 16 additions and 2 deletions

View file

@ -18,4 +18,11 @@ import '@fortawesome/fontawesome-free/js/regular'
import '@fortawesome/fontawesome-free/js/brands'
// Friendly captcha
import "friendly-challenge/widget";
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
})

View file

@ -8,5 +8,12 @@
{% endfor %}
<h1 class="mb-3">Add new offering</h1>
{{ 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 %}