<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>Vertragsstammdaten</h2>
        <ol class="breadcrumb">
            <li class="breadcrumb-item">
                <a href="index.html">Home</a>
            </li>
            <li class="breadcrumb-item">
                <a>Vertragsverwaltung</a>
            </li>
            <li class="breadcrumb-item active">
                <strong>Stammdaten</strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">
    </div>
</div>
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>Vertragsstammdaten</h5>
                </div>
                <div class="ibox-content">
                    <div class="sk-spinner sk-spinner-double-bounce">
                        <div class="sk-double-bounce1"></div>
                        <div class="sk-double-bounce2"></div>
                    </div>
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="alert alert-info">
                                <p style="margin-bottom: 0">
                                    <strong>Diese Daten werden bei Verträgen automatisch als Daten für den Vertragsgeber verwendet.</strong> Sie können aber bei Bedarf während der Vertragserstellung frei überschrieben werden.
                                </p>
                            </div>
                            <form data-id="form-contract-master-data">
                                <div class="hr-line-dashed"></div>
                                <input type="hidden"
                                       name="groupId"
                                       value="<%= group.getId() %>"
                                       />
                                <div class="form-group row">
                                    <label class="col-sm-2 col-form-label">
                                        Gruppenname
                                    </label>
                                    <div class="col-sm-10">
                                        <input type="text"
                                               class="form-control"
                                               value="<%= group.display_name %>"
                                               disabled />
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-2 col-form-label">
                                        Name Vertragsgeber
                                    </label>
                                    <div class="col-sm-10">
                                        <input type="text"
                                               name="name"
                                               class="form-control"
                                               value="<%= group.getContracteeData( 'name' ) ? group.getContracteeData( 'name' ) : '' %>"
                                               placeholder="Vertragsgeber"
                                               required />
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-2 col-form-label">
                                        Straße
                                    </label>
                                    <div class="col-sm-10">
                                        <input type="text"
                                               name="street"
                                               class="form-control"
                                               value="<%= group.getContracteeData( 'street' ) ? group.getContracteeData( 'street' ) : '' %>"
                                               placeholder="Straßenname und Hausnummer"
                                               required />
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-2 col-form-label">
                                        PLZ, Stadt
                                    </label>
                                    <div class="col-sm-3">
                                        <input type="text"
                                               name="zip_code"
                                               class="form-control"
                                               value="<%= group.getContracteeData( 'zip_code' ) ? group.getContracteeData( 'zip_code' ) : '' %>"
                                               placeholder="PLZ"
                                               required />
                                    </div>
                                    <div class="col-sm-7">
                                        <input type="text"
                                               name="city"
                                               class="form-control"
                                               value="<%= group.getContracteeData( 'city' ) ? group.getContracteeData( 'city' ) : '' %>"
                                               placeholder="Stadt"
                                               required />
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-2 col-form-label">
                                        Land
                                    </label>
                                    <div class="col-sm-10">
                                        <select name="country"
                                                class="form-control"
                                                required>
                                            <% for ( let ci = 0; ci < countries.length; ci++ ) {    %>
                                                <option value="<%= countries[ ci ].key %>"
                                                    <%= ( countries[ ci ].key === group.getContracteeData( 'country' ) ) ? 'selected' : '' %>
                                                >
                                                    <%= countries[ ci ].name %>
                                                </option>

                                            <% }    %>
                                        </select>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                            </form>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-12">
                            <button type="button"
                                    class="btn btn-primary"
                                    data-id="btnSaveMasterData">
                                Speichern
                            </button>
                            <a  class="btn btn-secondary"
                                href="javascript:history.back()">
                                Abbrechen
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>