<div class="ui-fixed-width" ng-form="connectionForm" tooltip-anchor tooltip-position="right">
    <label tooltip="{{::$ctrl.tooltips.server}}" class="ui-field">
        <span class="ui-field-label">{{::AnalysisServicesConnectionText.Label_Server}}</span>
        <input required type="text" name="server" class="ui-input-box ui-field-input"
               ng-model="$ctrl.config.Server"
               ng-model-options="{updateOn: 'blur'}"
               ng-change="$ctrl.onConfigChanged({ resetPassword :true })">
        <span class="ui-validation ui-indicator-medium ui-indicator-error" title="{{AnalysisServicesConnectionText.Validation_CubeServerIsEmpty}}"></span>
    </label>
    <div class="ui-field">
        <span class="ui-field-label" tooltip="{{::$ctrl.tooltips.authentication}}">{{::AnalysisServicesConnectionText.Label_Authentication}}</span>
        <div tooltip="{{::$ctrl.tooltips.applicationPoolServiceAccount}}">
            <label class="ui-radio">
                <input type="radio" ng-value="{{::Zap.DataSources.ConnectAsAccount.AppPoolServiceAccount}}"
                       ng-model="$ctrl.config.ConnectAs"
                       ng-change="$ctrl.onConfigChanged({ resetPassword :false })">
                <span class="ui-radio-label">{{::ConnectAsAccountText.ConnectAsAccount_AppPoolServiceAccount}}</span>
            </label>
            <div class="connectionSettings-authentication-label ui-indented">
                <span class="ui-text">{{::$ctrl.appPoolServiceAccount}}</span>
            </div>
        </div>
        <label tooltip="{{::$ctrl.tooltips.specifiedAccount}}" class="ui-radio">
            <input type="radio" ng-value="{{::Zap.DataSources.ConnectAsAccount.AlternateAccount}}"
                   ng-model="$ctrl.config.ConnectAs"
                   ng-change="$ctrl.onConfigChanged({ resetPassword :false })">
            <span class="ui-radio-label">{{::ConnectAsAccountText.ConnectAsAccount_AlternateAccount}}</span>
        </label>
    </div>
    <label tooltip="{{::$ctrl.tooltips.username}}" class="ui-field ui-indented">
        <span class="ui-field-label">{{::AnalysisServicesConnectionText.SpecifyCredentials_DomainUserNameLabel}}</span>
        <input type="text" name="cubeConnectionUserName"
               ng-model="$ctrl.config.DomainUserName"
               ng-model-options="{updateOn: 'blur'}"
               ng-change="$ctrl.onConfigChanged({ resetPassword :true })"
               ng-required="$ctrl.config.ConnectAs == Zap.DataSources.ConnectAsAccount.AlternateAccount"
               ng-pattern="$ctrl.config.ConnectAs == Zap.DataSources.ConnectAsAccount.AlternateAccount ? '[^\\\\@]+[\\\\@][^\\\\@]+' : ''"
               ng-disabled="$ctrl.config.ConnectAs != Zap.DataSources.ConnectAsAccount.AlternateAccount"
               class="ui-input-box ui-field-input">
        <ng-messages for="connectionForm.cubeConnectionUserName.$error" class="ui-validation">
            <span ng-message="pattern" class="ui-indicator-medium ui-indicator-error" title="{{::AnalysisServicesConnectionText.Validation_NoDomain}}"></span>
            <span ng-message="required" class="ui-indicator-medium ui-indicator-error" title="{{::AnalysisServicesConnectionText.Validation_UserNameIsEmpty}}"></span>
        </ng-messages>
    </label>
    <label tooltip="{{::$ctrl.tooltips.password}}" class="ui-field ui-indented">
        <span class="ui-field-label">{{::AnalysisServicesConnectionText.SpecifyCredentials_PasswordLabel}}</span>
        <input type="password" class="ui-input-box ui-field-input"
               name="password"
               ng-model="$ctrl.password"
               ng-model-options="{updateOn: 'blur'}"
               ng-change="$ctrl.onConfigChanged({ resetPassword :false })"
               ng-required="$ctrl.config.ConnectAs == Zap.DataSources.ConnectAsAccount.AlternateAccount"
               ng-disabled="$ctrl.config.ConnectAs != Zap.DataSources.ConnectAsAccount.AlternateAccount">
        <span class="ui-validation ui-indicator-medium ui-indicator-error" title="{{AnalysisServicesConnectionText.Validation_PasswordIsEmpty}}"></span>
    </label>
</div>
