<section ng-controller="AttestationsController">
    <div class="page-header">
        <h2>New Attestation</h2>
    </div>

    <form name="attestationForm" class="form-horizontal" ng-submit="create(attestationForm.$valid)" novalidate>

        <!-- Bootstrap Grid System with Panels-->
        <div class ="container">
            <!-- SubTitle -->
            <div class="col-lg-11">
                <kbd>Attestation Details</kbd>
            </div>

            <div class="col-lg-1">
                <div class="form-group">
                    <button type="submit" class="btn btn-primary">
                        <i class="glyphicon glyphicon-save"></i>
                    </button>
                </div>
                <div ng-show="error" class="text-danger">
                    <strong ng-bind="error"></strong>
                </div>
            </div>
        </div>
        <!-- End of Line -->

        <div class="row">
            <div class="col-lg-3">
                <div class="form-group form-group-lg">
                    <span class="label label-primary" >Originating Source</span>
                    <input name="originating_system_name" type="text" ng-model="attestation.originating_system_name" id="originating_system_name" class="form-control">
                </div>
            </div>
            <div class="col-lg-3">
                <div class="form-group form-group-lg">
                    <span class="label label-primary" >Originating ID</span>
                    <input name="originating_system_id" type="text" ng-model="attestation.originating_system_id" id="originating_system_id" class="form-control">
                </div>
            </div>
            <div class="col-lg-3">
                <div class="form-group form-group-lg">
                    <span class="label label-info" >Display Name</span>
                    {{attestation.user.displayName}}
                </div>
            </div>
            <div class="col-lg-3">
                <div class="form-group form-group-lg">
                    <span class="label label-info" >Date</span>
                    {{attestation.attestation_date}}
                </div>
            </div>
        </div>
        <!-- End of Line -->

        <div class="row">
            <div class="col-lg-12">
                <div class="form-group form-group-lg" show-errors>
                    <span class="label label-primary" >Statement</span>
                    <textarea name="statement" ng-model="attestation.statement" id="statement" class="form-control" required=""></textarea>
                    <div ng-messages="attestationForm.statement.$error" role="alert">
                        <div class="help-block" ng-message="required">Attestation statement is required.</div>
                    </div>
                </div>
            </div>
        </div>
        <!-- End of Line -->

        <div class="row">
            <div class="col-lg-12">
                <div class="form-group form-group-lg">
                    <span class="label label-info" >Response</span>
                    <input name="response" type="text" ng-model="attestation.response" id="response" class="form-control">
                </div>
            </div>
        </div>
        <!-- End of Line -->

        <div class="row">
            <div class="col-lg-2">
                <div class="form-group form-group-lg" show-errors>
                    <span class="label label-info" >Start Date</span>
                    <input name="date_start_string" type="text"
                           ng-model="attestation.date_start_string"
                           ng-pattern="/^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$/"
                           id="date_start_string" class="form-control"
                           placeholder="MM/DD/YYYY" required >

                    <div ng-messages="attestationForm.date_start_string.$error" role="alert">
                        <div class="help-block error-text" ng-message="required">Start Date is required.</div>
                        <div class="help-block error-text" ng-message="pattern">Start Date must by MM/DD/YYYY format.</div>
                    </div>
                </div>
            </div>
            <div class="col-lg-2">
                <div class="form-group form-group-lg" show-errors>
                    <span class="label label-info" >End Date</span>
                    <input name="date_end_string" type="text"
                           ng-model="attestation.date_end_string"
                           ng-pattern="/^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/(19|20)\d{2}$/"
                           id="date_end_string" class="form-control"
                           placeholder="MM/DD/YYYY" required>
                    <div ng-messages="attestationForm.date_end_string.$error" role="alert">
                        <div class="help-block error-text" ng-message="required">End Date is required.</div>
                        <div class="help-block error-text" ng-message="pattern">End Date must by MM/DD/YYYY format.</div>
                    </div>
                </div>
            </div>
            <div class="col-lg-3">
                <div class="form-group form-group-lg" show-errors>
                    <span class="label label-info" >Business Unit </span>
                    <input name="business_unit_id" type="text" ng-model="attestation.business_unit_id" id="business_unit_id" class="form-control" required>
                    <div ng-messages="attestationForm.business_unit_id.$error" role="alert">
                        <div class="help-block error-text" ng-message="required">Business Unit ID is required.</div>
                    </div>
                </div>
            </div>
            <div class="col-lg-3">
                <div class="form-group form-group-lg">
                    <span class="label label-info" >Department </span>
                    <input name="department" type="text" ng-model="attestation.department" id="department" class="form-control">
                </div>
            </div>
        </div>
        <!-- End of Line -->
    </form>
</section>
