mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-10 07:16:06 -06:00
set form input values for posted form
This commit is contained in:
parent
ec80aad3e7
commit
f2f739c7e3
@ -13,6 +13,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
{% set form_params = app.request.session.get('_old_input') %}
|
||||||
<section class="clearfix home-default">
|
<section class="clearfix home-default">
|
||||||
|
|
||||||
{% include 'visiosoft.module.advs::new-ad/partials/steps' with {'step': 'new-create'} %}
|
{% include 'visiosoft.module.advs::new-ad/partials/steps' with {'step': 'new-create'} %}
|
||||||
@ -75,7 +76,7 @@
|
|||||||
{% for field in form.fields.translations('name') %}
|
{% for field in form.fields.translations('name') %}
|
||||||
{{ field.setAttributes({
|
{{ field.setAttributes({
|
||||||
'class': 'd-block mt-3 w-100 border-0'
|
'class': 'd-block mt-3 w-100 border-0'
|
||||||
}).render({'form': form})|raw }}
|
}).setValue(form_params[field.field~"_"~field.getLocale()]).render({'form': form})|raw }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
@ -244,7 +245,7 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="field-group advs_desc">
|
<div class="field-group advs_desc">
|
||||||
{% for field in form.fields.translations('advs_desc') %}
|
{% for field in form.fields.translations('advs_desc') %}
|
||||||
{{ field.render({'form': form})|raw }}
|
{{ field.setValue(form_params[field.field~"_"~field.getLocale()]).render({'form': form})|raw }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -784,7 +784,7 @@ class AdvsController extends PublicController
|
|||||||
if ($this->request->action == "update") {
|
if ($this->request->action == "update") {
|
||||||
$error = $form->build($this->request->update_id)->validate()->getFormErrors()->getMessages();
|
$error = $form->build($this->request->update_id)->validate()->getFormErrors()->getMessages();
|
||||||
if (!empty($error)) {
|
if (!empty($error)) {
|
||||||
return $this->redirect->back();
|
return $this->redirect->back()->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update Adv */
|
/* Update Adv */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user