edit.html.twig 2.5KB

4 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {% form_theme form with easyadmin_config('design.form_theme') only %}
  2. {% set _entity_config = easyadmin_entity(app.request.query.get('entity')) %}
  3. {% set _entity_id = attribute(entity, _entity_config.primary_key_field_name) %}
  4. {% trans_default_domain _entity_config.translation_domain %}
  5. {% set _trans_parameters = { '%entity_name%': _entity_config.name|trans, '%entity_label%': _entity_config.label|trans, '%entity_id%': _entity_id } %}
  6. {% extends _entity_config.templates.layout %}
  7. {% block body_id 'easyadmin-edit-' ~ _entity_config.name ~ '-' ~ _entity_id %}
  8. {% block content_title %}
  9. {% apply spaceless %}
  10. {% if entity.title is defined %}
  11. {{ 'edit.title'|trans({"%title%" : entity.title, "%id%" : entity.id}, 'lcshop') }}
  12. {% else %}
  13. {% set _default_title = 'edit.page_title'|trans(_trans_parameters, 'EasyAdminBundle') %}
  14. {{ _entity_config.edit.title is defined ? _entity_config.edit.title|trans(_trans_parameters) : _default_title }}
  15. {% endif %}
  16. {% endapply %}
  17. {% endblock %}
  18. {% block main %}
  19. {% block entity_form %}
  20. {{ form(form) }}
  21. {% endblock entity_form %}
  22. {% block delete_form %}
  23. {{ include('@EasyAdmin/default/includes/_delete_form.html.twig', {
  24. view: 'edit',
  25. referer: app.request.query.get('referer', ''),
  26. delete_form: delete_form,
  27. _translation_domain: _entity_config.translation_domain,
  28. _trans_parameters: _trans_parameters,
  29. _entity_config: _entity_config,
  30. }, with_context = false) }}
  31. {% endblock delete_form %}
  32. {% endblock %}
  33. {% block head_stylesheets %}
  34. {{ parent() }}
  35. <link rel="stylesheet"
  36. href="{{ asset('bundles/lcshop/css/backend/adminlte/plugins/jquery-ui/jquery-ui.min.css') }}">
  37. {% endblock %}
  38. {% block plugin_javascript %}
  39. {{ parent() }}
  40. <script src="{{ asset('bundles/lcshop/js/backend/plugin/jquery-ui/jquery-ui.min.js') }}"></script>
  41. <script type="text/javascript">
  42. var CKEDITOR_BASEPATH = "{{ ckeditor_base_path("/bundles/fosckeditor/") }}";
  43. </script>
  44. <script type="text/javascript" src="{{ asset('bundles/fosckeditor/ckeditor.js') }}"></script>
  45. {#{% if jquery %}
  46. <script type="text/javascript" src="{{ ckeditor_js_path(jquery_path) }}"></script>
  47. {% endif %}#}
  48. {% endblock %}
  49. {% block script_javascript %}
  50. {{ parent() }}
  51. <script src="{{ asset('bundles/lcshop/js/backend/script/default/init-edit.js') }}"></script>
  52. {% endblock %}