<div ng-controller="AddressFormController">


    <form name="FieldConfiguration" novalidate="" class="form-horizontal well" >
        <api-validate></api-validate>
        <fieldset>


            <div class="form-group" ng-show="addressType">
                <div class="control-label col-sm-2">
                    <label>{{ 'label.input.addressType' | translate }}</label>
                </div>
                <div class="col-sm-3"  >
                    <select chosen="addressTypes" id="addressType"  ng-change="isEditRequired(addressTypeId)" ng-model="addressTypeId"  class="form-control"
                            ng-options="addressType.id as addressType.name for addressType in addressTypes track by addressType.id"
                            value="addressTypeId"  ></select>

                </div>
            </div>
            
			<div class="form-group" ng-show="street">
				<label class="control-label col-sm-2" for="street">{{
					'label.input.street' | translate }}<span class="required">*</span>
				</label>

				<div class="col-sm-3">
					<input type="text" id="street" name="street"
						ng-model="formData.street" class="form-control">
				</div>

			</div>
            


            <div class="form-group" ng-show="addressLine1">
                <label class="control-label col-sm-2" for="addressline1">{{ 'label.input.addressline1' | translate }}</label>

                <div class="col-sm-3">
                    <input type="text" id="addressline1" name="addressline1" ng-model="formData.addressLine1"  class="form-control">
                </div>

            </div>


            <div class="form-group" ng-show="addressLine2">
                <label class="control-label col-sm-2" for="addressline2">{{ 'label.input.addressline2' | translate }}</label>

                <div class="col-sm-3">
                    <input type="text" id="addressline2" name="addressline2" ng-model="formData.addressLine2"  class="form-control">
                </div>

            </div>

            <div class="form-group" ng-show="addressLine3">
                <label class="control-label col-sm-2" for="addressline3">{{ 'label.input.addressline3' | translate }}</label>

                <div class="col-sm-3">
                    <input type="text" id="addressline3" name="addressline3" ng-model="formData.addressLine3"  class="form-control">
                </div>

            </div>


            <div class="form-group" ng-show="city">
                <label class="control-label col-sm-2" for="city">{{ 'label.input.city' | translate }}</label>

                <div class="col-sm-3">
                    <input type="text" id="city" name="city" ng-model="formData.city"  class="form-control">
                </div>

            </div>



            <div class="form-group" ng-show="townVillage">
                <label class="control-label col-sm-2" for="town_village">{{ 'label.input.town_village' | translate }}</label>

                <div class="col-sm-3">
                    <input type="text" id="town_village" name="town_village" ng-model="formData.townVillage"  class="form-control">
                </div>

            </div>

            <div class="form-group" ng-show="countyDistrict">
                <label class="control-label col-sm-2" for="county_district">{{ 'label.input.county_district' | translate }}</label>

                <div class="col-sm-3">
                    <input type="text" id="county_district" name="county_district" ng-model="formData.countyDistrict"  class="form-control">
                </div>

            </div>

            <div class="form-group" ng-show="stateProvinceId">
                <div class="control-label col-sm-2">
                    <label>{{ 'label.input.state_province' | translate }}</label>
                </div>
                <div class="col-sm-3" >
                    <select chosen="stateOptions" id="stateOption" ng-model="formData.stateProvinceId"  class="form-control"
                            ng-options="stateOption.id as stateOption.name for stateOption in stateOptions track by stateOption.id"
                            value="formData.state_province_id"></select>
                </div>
            </div>
            <div>

            </div>

            <div class="form-group" ng-show="countryId">
                <div class="control-label col-sm-2">
                    <label>{{ 'label.input.country' | translate }}</label>
                </div>
                <div class="col-sm-3" >
                    <select chosen="countryOptions" id="countryOption" ng-model="formData.countryId"  class="form-control"
                            ng-options="countryOption.id as countryOption.name for countryOption in countryOptions track by countryOption.id"
                            value="formData.countryId"></select>
                </div>
            </div>

            <div class="form-group" ng-show="postalCode">
                <label class="control-label col-sm-2" for="postal_code">{{ 'label.input.postal_code' | translate }}</label>

                <div class="col-sm-3">
                    <input type="text" id="postal_code" name="postal_code" ng-model="formData.postalCode"  class="form-control">
                </div>

            </div>

            <div class="form-group" ng-show="latitude">
                <label class="control-label col-sm-2" for="latitude">{{ 'label.input.latitude' | translate }}</label>

                <div class="col-sm-3">
                    <input type="text" id="latitude" name="latitude" ng-model="formData.latitude"  class="form-control">
                </div>

            </div>

            <div class="form-group" ng-show="longitude">
                <label class="control-label col-sm-2" for="longitude">{{ 'label.input.longitude' | translate }}</label>

                <div class="col-sm-3">
                    <input type="text" id="longitude" name="longitude" ng-model="formData.longitude"  class="form-control">
                </div>

            </div>




            <div class="col-md-offset-3" ng-model="editable">
                <button id="cancel"   ng-click="routeTo()" class="btn btn-primary">{{
                    'label.button.cancel' | translate }}
                </button>

                <button id="save" type="submit"  ng-disabled="editable" ng-click="submit()" class="btn btn-primary">{{
                    'label.button.save' | translate }}
                </button>



            </div>

        </fieldset>

    </form>
</div>