{# Edit action form component #}
    <div style="margin-bottom: 1vh;margin-top: 1vh;">
        <a type="button"
           data-get-url="{{ url_for('design.get_operation_sidebar') }}"
           onclick="updateInstrumentPanel(this)">
            <i class="bi bi-arrow-return-left"></i>
        </a>
    </div>
    {% if action %}
    <h5> {{ action['action'] | format_name }} </h5>
    <form role="form" method='POST' name="{{instrument}}" 
          action="{{ url_for('design.design_steps.get_step', uuid=action['uuid']) }}"
          onsubmit="submitEditForm(event); return false;">
        {% if not action['args'] == None %}
        <div class="form-group">
            {% if not action['args'].__class__.__name__ == 'dict' %}
                <div class="input-group mb-3">
                    <label class="input-group-text">{{ action['action'] }}</label>
                    <input class="form-control" type="text" id="arg" name="arg" 
                           placeholder="{{ action['arg_types']}}" value="{{ action['args'] }}" 
                           aria-labelledby="variableHelpBlock">
                </div>
            {% else %}
                {{ forms.hidden_tag() }}
                {% for field in forms %}

                    {% if field.type not in ['CSRFTokenField'] %}
                        <div class="input-group mb-3">
                            <label class="input-group-text">{{ field.label.text | format_name }}</label>
                            {% if field.type == "BooleanField" %}
                                {{ field(class="form-check-input") }}
                            {% elif field.type == "FlexibleEnumField" %}
                               <input type="text" id="{{ field.id }}" name="{{ field.name }}" value="{{ field.data }}"
                                  list="{{ field.id }}_options" placeholder="{{ field.render_kw.placeholder if field.render_kw and field.render_kw.placeholder }}"
                                  class="form-control">
                               <datalist id="{{ field.id }}_options">
                                  {% for key in field.choices %}
                                     <option value="{{ key }}">{{ key }}</option>
                                  {% endfor %}
                               </datalist>
                            {% else %}
                                {{ field(class="form-control") }}
                            {% endif %}
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}
        </div>
        {% endif %}
        <button type="submit" class="btn btn-primary">Save</button>
        <button type="button" class="btn btn-primary" id="back">Back</button>
    </form>
    {% endif %}
