<!-- Modal trainings -->
<div class="modal fade" id="addTrainingModal" tabindex="-1" role="dialog" aria-labelledby="addTrainingModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h2 class="modal-title" id="addTrainingModalLabel">Training hinzufügen</h2>
      </div>
      <div class="modal-body">
        <form id="modal-addtraining-form">
            <label>Training auswählen:</label>
            <div class="" id="sortable-user-trainings-select-trainings">
              {% if trainings is not empty %}
              <div class="form-group">
                <div class="input-group marginbottom10">
                  <input class="form-control" type="text" id="modal-addtraining-input-search" value="" placeholder="Suche..." autocomplete="off" />
                  <div class="input-group-append">
                    <button class="btn btn-outline-secondary" id="clear-addtraining-search-button" type="button"><i class="fas fa-trash-alt"></i></button>
                  </div>
                </div>
                <div id="modal-addtraining-check-trainings" class="card panel panel-default" style="height: 50vh; overflow-y: auto; padding: 9px;">
                  {% for training in trainings %}
                  <div class="form-check form-group mb-2 pl-0 d-flex align-items-center">
                    <input class="modal-select-training-input" type="checkbox" value="{{training.id}}" id="training-{{training.id}}">
                    <label class="mb-0" for="training-{{training.id}}" data-trainingname="{{ training.title }}">{{training.title}}</label>
                  </div>
                  {% endfor %}
                </div>
              </div>
              {% else %}
              <div class="alert alert-info" role="alert">
                  <h5><i class="fas fa-info-circle"></i>&nbsp;Hinweis</h5>
                  <p>
                    Es wurden noch keine Trainings angelegt.
                  </p>
              </div>
              {% endif %}
            </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button>
        <button type="button" class="btn btn-primary addtraining" data-dismiss="modal">Bestätigen</button>
      </div>
    </div>
  </div>
</div>
<style>
  #sortable-user-trainings-select-trainings label {
    margin-bottom: 0 !important;
  }
</style>