diff --git a/addons/default/visiosoft/location-module/resources/views/location/admin-sub-location.twig b/addons/default/visiosoft/location-module/resources/views/location/admin-sub-location.twig index f2cad4145..5378763e8 100644 --- a/addons/default/visiosoft/location-module/resources/views/location/admin-sub-location.twig +++ b/addons/default/visiosoft/location-module/resources/views/location/admin-sub-location.twig @@ -1,32 +1,54 @@ {% extends "theme::layouts/default" %} {% block content %} {% include "theme::partials/messages" %} + {{ asset_add("scripts.js", "streams::js/form/form.js") }} + {{ asset_add("scripts.js", "streams::js/form/translations.js") }} - {% set form = form('location', app.request.query|keys|first).entry(id).get() %} - {{ form_open()|raw }} -
-
-
- {{ form.fields.name|raw }} - {{ form.fields.slug|raw }} - {% if app.request.get('cities') is not empty %} - - {% elseif app.request.get('districts') is not empty %} - - {% elseif app.request.get('neighborhoods') is not empty %} - - {% elseif app.request.get('village') is not empty %} - - {% endif %} - {{ form.fields.order|raw }} -
-
-
-
- {{ form.actions|raw }} -
+ {% if app.request.get('cities') is not empty %} + {% set parent = "country" %} + {% elseif app.request.get('districts') is not empty %} + {% set parent = "city" %} + {% elseif app.request.get('neighborhoods') is not empty %} + {% set parent = "district" %} + {% elseif app.request.get('village') is not empty %} + {% set parent = "neighborhood" %} + {% endif %} + + {% set redirect_parameter = app.request.query|keys|first %} + +
+ {% set form = form('location', app.request.query|keys|first). + entry(id). + actions({'save':{}}). + redirect('/admin/location/'~redirect_parameter~'?'~parent~"="~app.request.get(redirect_parameter)) + .get() %} + {{ form.open({ + 'class': 'form ' ~ form.options.class , + 'enctype': 'multipart/form-data', + })|raw }} +
+
+
+
+ {% set fields = form.fields.base().pluck('field_name').all() %} +
+ {% for field in form.fields.translations('name') %} + {{ field.render({'form': form})|raw }} + {% endfor %} +
+ {{ form.fields.slug|raw }} + + {{ form.fields.order|raw }} +
+
- {{ form.close|raw}} +
+
+ {{ form.actions|raw }} +
+
+ {{ form.close|raw }} +
{% endblock %} \ No newline at end of file