123456789101112131415161718192021222324252627282930313233343536373839 |
- <div {{ attributes }}>
- <div>
- {% if isEditing %}
- {# The form isn't used, but allows the user to hit enter to save. #}
- <form>
- <fieldset role="group">
- {% set error = this.getError('film.name') %}
- <div>
- <input
- type="text"
- data-model="film.name"
- autofocus
- id="film_name"
- />
- </div>
- <button
- data-action="live#action:prevent"
- data-live-action-param="save"
- ><i class="fa fa-save"></i></button>
- {% if error %}
- <div class="invalid-feedback">{{ error.message }}</div>
- {% endif %}
- </fieldset>
-
- </form>
- {% else %}
- {{ film.name }}
- <a
- data-action="live#action"
- data-live-action-param="activateEditing"
- >
- <i class="fa fa-edit"></i>
- </a>
- {% endif %}
- </div>
- </div>
|