InlineEditFilm.html.twig 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <div {{ attributes }}>
  2. <div>
  3. {% if isEditing %}
  4. {# The form isn't used, but allows the user to hit enter to save. #}
  5. <form>
  6. <fieldset role="group">
  7. {% set error = this.getError('film.name') %}
  8. <div>
  9. <input
  10. type="text"
  11. data-model="film.name"
  12. autofocus
  13. id="film_name"
  14. />
  15. </div>
  16. <button
  17. data-action="live#action:prevent"
  18. data-live-action-param="save"
  19. ><i class="fa fa-save"></i></button>
  20. {% if error %}
  21. <div class="invalid-feedback">{{ error.message }}</div>
  22. {% endif %}
  23. </fieldset>
  24. </form>
  25. {% else %}
  26. {{ film.name }}
  27. <a
  28. data-action="live#action"
  29. data-live-action-param="activateEditing"
  30. >
  31. <i class="fa fa-edit"></i>
  32. </a>
  33. {% endif %}
  34. </div>
  35. </div>