<script type="text/ng-template" id="password_generator.html">
    <div class="row">
        <div class="col-md-12">

            <div class="checkbox">
                <label>
                    <input type="checkbox" ng-model="passwordOptions.password.addUpper"> {{ 'PASSWORD_MANAGEMENT.GENERATOR.UPPERCASE_CHARACTERS'|translate }}
                </label>
            </div>
            <div class="checkbox">
                <label>
                    <input type="checkbox" ng-model="passwordOptions.password.addNumbers"> {{ 'PASSWORD_MANAGEMENT.GENERATOR.NUMBERS'|translate }}
                </label>
            </div>
            <div class="checkbox">
                <label>
                    <input type="checkbox" ng-model="passwordOptions.password.addSymbols"> {{ 'PASSWORD_MANAGEMENT.GENERATOR.SPECIAL_CHARACTERS'|translate }}
                </label>
            </div>
            <div class="row">
                <div class="col-9">
                    <input type="range" min="8" max="50" step="1" value="12" ng-model="passwordOptions.password.passwordLength" />
                </div>
                <div class="col-3">
                    {{passwordOptions.password.passwordLength}}
                </div>
            </div>

            <password-generator field="data.password" button-text="{{ 'PASSWORD_MANAGEMENT.GENERATOR.BUTTON_GENERATE_NOW'|translate }}" password-length="passwordOptions.password.passwordLength" uppercase="passwordOptions.password.addUpper" numbers="passwordOptions.password.addNumbers" specials="passwordOptions.password.addSymbols"></password-generator>

        </div>
    </div>
</script>
<script type="text/ng-template" id="password_generator_pin.html">
    <div class="row">
        <div class="col-md-12">

            <div class="checkbox">
                <label>
                    <input type="checkbox" ng-model="passwordOptions.pin.addUpper">{{ 'PASSWORD_MANAGEMENT.GENERATOR.UPPERCASE_CHARACTERS'|translate }}
                </label>
            </div>
            <div class="checkbox">
                <label>
                    <input type="checkbox" ng-model="passwordOptions.pin.addNumbers">{{ 'PASSWORD_MANAGEMENT.GENERATOR.NUMBERS'|translate }}
                </label>
            </div>
            <div class="checkbox">
                <label>
                    <input type="checkbox" ng-model="passwordOptions.pin.addSymbols">{{ 'PASSWORD_MANAGEMENT.GENERATOR.SPECIAL_CHARACTERS'|translate }}
                </label>
            </div>
            <div class="form-group row">
                <input type="range" min="8" max="50" step="1" value="12" ng-model="passwordOptions.pin.passwordLength" /> {{passwordOptions.pin.passwordLength}}
            </div>

            <password-generator field="data.pin" button-text="{{ 'PASSWORD_MANAGEMENT.GENERATOR.BUTTON_GENERATE_NOW'|translate }}" password-length="passwordOptions.pin.passwordLength" uppercase="passwordOptions.pin.addUpper" numbers="passwordOptions.pin.addNumbers" specials="passwordOptions.pin.addSymbols"></password-generator>

        </div>
    </div>
</script>
<script type="text/ng-template" id="password_generator_smtp_password.html">
    <div class="row">
        <div class="col-md-12">

            <div class="checkbox">
                <label>
                    <input type="checkbox" ng-model="passwordOptions.smtpPassword.addUpper">{{ 'PASSWORD_MANAGEMENT.GENERATOR.UPPERCASE_CHARACTERS'|translate }}
                </label>
            </div>
            <div class="checkbox">
                <label>
                    <input type="checkbox" ng-model="passwordOptions.smtpPassword.addNumbers">{{ 'PASSWORD_MANAGEMENT.GENERATOR.NUMBERS'|translate }}
                </label>
            </div>
            <div class="checkbox">
                <label>
                    <input type="checkbox" ng-model="passwordOptions.smtpPassword.addSymbols">{{ 'PASSWORD_MANAGEMENT.GENERATOR.SPECIAL_CHARACTERS'|translate }}
                </label>
            </div>
            <div class="form-group row">
                <input type="range" min="8" max="50" step="1" value="12" ng-model="passwordOptions.smtpPassword.passwordLength" /> {{passwordOptions.smtpPassword.passwordLength}}
            </div>

            <password-generator field="data.smtp_password" button-text="{{ 'PASSWORD_MANAGEMENT.GENERATOR.BUTTON_GENERATE_NOW'|translate }}" password-length="passwordOptions.smtpPassword.passwordLength" uppercase="passwordOptions.smtpPassword.addUpper" numbers="passwordOptions.smtpPassword.addNumbers" specials="passwordOptions.smtpPassword.addSymbols"></password-generator>

        </div>
    </div>
</script>

<form name="modalForm" ng-submit="submit()" novalidate>
    <div ng-if="loaded">
        <div class="form-group row" ng-show="!editingMode">
            <label for="inputName" class="col-sm-2 col-form-label" translate>WORDS.TYPE</label>
            <div class="col-sm-10">
                <select ng-model="passwordType" id="passwordType" ng-change="onPasswordTypeChange()" class="form-control">
                    <option value="plain">Normal</option>
                    <option value="bankaccount">{{ 'PASSWORD_MANAGEMENT.TYPE.BANKACCOUNT'|translate }}</option>
                    <option value="credit_card">{{ 'PASSWORD_MANAGEMENT.TYPE.CREDIT_CARD'|translate }}</option>
                    <option value="email">{{ 'PASSWORD_MANAGEMENT.TYPE.EMAIL'|translate }}</option>
                    <option value="server">{{ 'PASSWORD_MANAGEMENT.TYPE.SERVER'|translate }}</option>
                    <option value="software_license">{{ 'PASSWORD_MANAGEMENT.TYPE.SOFTWARE_LICENSE'|translate }}</option>
                </select>
            </div>
        </div>

        <div class="form-group row">
            <label for="inputName" class="col-sm-2 col-form-label" translate>WORDS.NAME</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputName" name="inputName" ng-model="data.name" ng-focus="closePopoverWindow()" ng-maxlength=255 required>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputName.$error.required" ng-show="modalForm.$submitted" translate>VALIDATION.REQUIRED</div>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputName.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="255" translate>VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.name">{{formErrors.name}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'plain' || passwordType == 'bankaccount' || passwordType == 'software_license'">
            <label for="inputURL" class="col-sm-2 col-form-label" translate>WORDS.URL</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputURL" name="inputURL" ng-model="data.url" ng-focus="closePopoverWindow()" ng-maxlength=255>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputURL.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="255" translate>VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.url">{{formErrors.url}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'email'">
            <label for="inputEmailType" class="col-sm-2 col-form-label" translate>WORDS.EMAIL_TYPE</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputEmailType" name="inputEmailType" ng-model="data.email_type" ng-focus="closePopoverWindow()" ng-maxlength=128>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputEmailType.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="128" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.email_type">{{formErrors.email_type}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'email'">
            <label for="inputAuthMethod" class="col-sm-2 col-form-label" translate>WORDS.AUTH_METHOD</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputAuthMethod" name="inputAuthMethod" ng-model="data.auth_method" ng-focus="closePopoverWindow()" ng-maxlength=128>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputAuthMethod.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="128" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.auth_method">{{formErrors.auth_method}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'server' || passwordType == 'email'">
            <label for="inputHost" class="col-sm-2 col-form-label" translate>WORDS.HOST</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputHost" name="inputHost" ng-model="data.host" ng-focus="closePopoverWindow()" ng-maxlength=128>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputHost.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="128" translate>VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.host">{{formErrors.host}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'email' || passwordType == 'server'">
            <label for="inputPort" class="col-sm-2 col-form-label" translate>WORDS.PORT</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputPort" name="inputPort" ng-model="data.port" ng-focus="closePopoverWindow()" ng-maxlength=128>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputPort.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="128" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.port">{{formErrors.port}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'plain' || passwordType == 'bankaccount' || passwordType == 'email' || passwordType == 'server'">
            <label for="inputUsername" class="col-sm-2 col-form-label" translate>WORDS.USERNAME</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputUsername" name="inputUsername" ng-model="data.username" ng-focus="closePopoverWindow()" ng-maxlength=255>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputUsername.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="255" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.username">{{formErrors.username}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'plain' || passwordType == 'email' || passwordType == 'server'">
            <label for="inputPassword" class="col-sm-2 col-form-label" translate>WORDS.PASSWORD</label>
            <div class="col-sm-10">

                <div class="input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"><a  ng-click="togglePasswordVisibility('password')" style="cursor: pointer;"><i class="fa fa-eye"></i></a></span>
                    </div>
                    <input type="{{passwordInputType.password}}" class="form-control" id="inputPassword" name="inputPassword" ng-model="data.password" ng-maxlength=255 required>
                    <span class="input-group-btn">
                        <a href="" class="btn btn-primary" uib-popover-template="'password_generator.html'" popover-placement="bottom-right" popover-is-open="popoverIsOpen.password" ng-click="popoverIsOpen.password = !popoverIsOpen.password">{{ 'PASSWORD_MANAGEMENT.GENERATOR.TITLE'|translate }}</a>
                    </span>
                </div>

                <div class="invalid-feedback d-block" ng-if="modalForm.inputPassword.$error.required" ng-show="modalForm.$submitted" translate>VALIDATION.REQUIRED</div>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputPassword.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="255" translate>VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.password">{{formErrors.password}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'bankaccount' || passwordType == 'credit_card'">
            <label for="inputPIN" class="col-sm-2 col-form-label" translate>WORDS.PIN</label>
            <div class="col-sm-10">

                <div class="input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"><a  ng-click="togglePasswordVisibility('pin')" style="cursor: pointer;"><i class="fa fa-eye"></i></a></span>
                    </div>
                    <input type="{{passwordInputType.pin}}" class="form-control" id="inputPIN" name="inputPIN" ng-model="data.pin" ng-maxlength=128>
                    <span class="input-group-btn">
                        <a href="" class="btn btn-primary" uib-popover-template="'password_generator_pin.html'" popover-placement="bottom-right" popover-is-open="popoverIsOpen.pin" ng-click="popoverIsOpen.pin = !popoverIsOpen.pin">{{ 'PASSWORD_MANAGEMENT.GENERATOR.TITLE'|translate }}</a>
                    </span>
                </div>

                <div class="invalid-feedback d-block" ng-if="modalForm.inputPIN.$error.required" ng-show="modalForm.$submitted" translate>VALIDATION.REQUIRED</div>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputPIN.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="128" translate>VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.pin">{{formErrors.pin}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'bankaccount'">
            <label for="inputBankName" class="col-sm-2 col-form-label" translate>WORDS.BANK_NAME</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputBankName" name="inputBankName" ng-model="data.bank_name" ng-focus="closePopoverWindow()" ng-maxlength=128>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputBankName.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="128" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.bank_name">{{formErrors.bank_name}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'bankaccount'">
            <label for="inputBankCode" class="col-sm-2 col-form-label" translate>WORDS.BANK_CODE</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputBankCode" name="inputBankCode" ng-model="data.bank_code" ng-focus="closePopoverWindow()" ng-maxlength=40>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputBankCode.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="40" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.bank_code">{{formErrors.bank_code}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'bankaccount'">
            <label for="inputAccountHolder" class="col-sm-2 col-form-label" translate>WORDS.ACCOUNT_HOLDER</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputAccountHolder" name="inputAccountHolder" ng-model="data.account_holder" ng-focus="closePopoverWindow()" ng-maxlength=128>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputAccountHolder.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="128" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.account_holder">{{formErrors.account_holder}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'bankaccount'">
            <label for="inputAccountNumber" class="col-sm-2 col-form-label" translate>WORDS.ACCOUNT_NUMBER</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputAccountNumber" name="inputAccountNumber" ng-model="data.account_number" ng-focus="closePopoverWindow()" ng-maxlength=40>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputAccountNumber.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="40" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.account_number">{{formErrors.account_number}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'bankaccount'">
            <label for="inputIBAN" class="col-sm-2 col-form-label" translate>WORDS.IBAN</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputIBAN" name="inputIBAN" ng-model="data.iban" ng-focus="closePopoverWindow()" ng-maxlength=40>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputIBAN.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="40" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.iban">{{formErrors.iban}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'credit_card'">
            <label for="inputCreditCardType" class="col-sm-2 col-form-label" translate>WORDS.CREDIT_CARD_TYPE</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputCreditCardType" name="inputCreditCardType" ng-focus="closePopoverWindow()" ng-model="data.card_type" ng-maxlength=255>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputCreditCardType.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="255" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.card_type">{{formErrors.card_type}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'credit_card'">
            <label for="inputCardNumber" class="col-sm-2 col-form-label" translate>WORDS.CARD_NUMBER</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputCardNumber" name="inputCardNumber" ng-focus="closePopoverWindow()" ng-model="data.card_number" ng-maxlength=255>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputCardNumber.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="255" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.card_number">{{formErrors.card_number}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'credit_card'">
            <label for="inputCardCVC" class="col-sm-2 col-form-label" translate>WORDS.CARD_CVC</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputCardCVC" name="inputCardCVC" ng-focus="closePopoverWindow()" ng-model="data.card_cvc" ng-maxlength=255>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputCardCVC.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="255" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.card_cvc">{{formErrors.card_cvc}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'credit_card'">
            <label for="inputValidFrom" class="col-sm-2 col-form-label" translate>WORDS.VALID_FROM</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputValidFrom" name="inputValidFrom" ng-model="data.valid_from" ng-maxlength=32>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputValidFrom.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="32" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.valid_from">{{formErrors.valid_from}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'credit_card'">
            <label for="inputValidTo" class="col-sm-2 col-form-label" translate>WORDS.VALID_TO</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputValidTo" name="inputValidTo" ng-model="data.valid_to" ng-maxlength=32>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputValidTo.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="32" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.valid_to">{{formErrors.valid_to}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'email'">
            <label for="inputSmtpAuthMethod" class="col-sm-2 col-form-label" translate>WORDS.SMTP_AUTH_METHOD</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputSmtpAuthMethod" name="inputSmtpAuthMethod" ng-model="data.smtp_auth_method" ng-focus="closePopoverWindow()" ng-maxlength=128>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputSmtpAuthMethod.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="128" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.smtp_auth_method">{{formErrors.smtp_auth_method}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'email'">
            <label for="inputSmtpHost" class="col-sm-2 col-form-label" translate>WORDS.SMTP_HOST</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputSmtpHost" name="inputSmtpHost" ng-model="data.smtp_host" ng-focus="closePopoverWindow()" ng-maxlength=128>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputSmtpHost.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="128" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.smtp_host">{{formErrors.smtp_host}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'email'">
            <label for="inputSmtpPort" class="col-sm-2 col-form-label" translate>WORDS.SMTP_PORT</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputSmtpPort" name="inputSmtpPort" ng-model="data.smtp_port" ng-focus="closePopoverWindow()" ng-maxlength=128>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputSmtpPort.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="128" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.smtp_port">{{formErrors.smtp_port}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'email'">
            <label for="inputSmtpUsername" class="col-sm-2 col-form-label" translate>WORDS.SMTP_USERNAME</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputSmtpUsername" name="inputSmtpUsername" ng-model="data.smtp_username" ng-focus="closePopoverWindow()" ng-maxlength=128>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputSmtpUsername.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="128" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.smtp_username">{{formErrors.smtp_username}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'email'">
            <label for="inputSMTPPassword" class="col-sm-2 col-form-label" translate>WORDS.SMTP_PASSWORD</label>
            <div class="col-sm-10">

                <div class="input-group">
                    <div class="input-group-prepend">
                        <span class="input-group-text"><a  ng-click="togglePasswordVisibility('smtpPassword')" style="cursor: pointer;"><i class="fa fa-eye"></i></a></span>
                    </div>
                    <input type="{{passwordInputType.smtpPassword}}" class="form-control" id="inputSMTPPassword" name="inputSMTPPassword" ng-model="data.smtp_password" ng-maxlength=128>
                    <span class="input-group-btn">
                        <a href="" class="btn btn-primary" uib-popover-template="'password_generator_smtp_password.html'" popover-placement="bottom-right" popover-is-open="popoverIsOpen.smtpPassword" ng-click="popoverIsOpen.smtpPassword = !popoverIsOpensmtpPassword">{{ 'PASSWORD_MANAGEMENT.GENERATOR.TITLE'|translate }}</a>
                    </span>
                </div>

                <div class="invalid-feedback d-block" ng-if="modalForm.inputSMTPPassword.$error.required" ng-show="modalForm.$submitted" translate>VALIDATION.REQUIRED</div>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputSMTPPassword.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="128" translate>VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.smtp_password">{{formErrors.smtp_password}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'software_license'">
            <label for="inputVersion" class="col-sm-2 col-form-label" translate>WORDS.VERSION</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputVersion" name="inputVersion" ng-model="data.version" ng-focus="closePopoverWindow()" ng-maxlength=255>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputVersion.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="255" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.version">{{formErrors.version}}</div>
            </div>
        </div>

        <div class="form-group row" ng-if="passwordType == 'software_license'">
            <label for="inputLicenseKey" class="col-sm-2 col-form-label" translate>WORDS.LICENSE_KEY</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="inputLicenseKey" name="inputLicenseKey" ng-model="data.license_key" ng-focus="closePopoverWindow()" ng-maxlength=255>
                <div class="invalid-feedback d-block" ng-if="modalForm.inputLicenseKey.$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="255" translate>MAIN.VALIDATION.MAX_LENGTH</div>
                <div class="invalid-feedback d-block" ng-if="formErrors.license_key">{{formErrors.license_key}}</div>
            </div>
        </div>

        <div class="form-group row">
            <label for="notice" class="col-sm-2 col-form-label">{{ 'WORDS.NOTICE'|translate }} <br /><small class="text-muted">({{'WORDS.OPTIONAL'|translate}})</small></label>
            <div class="col-sm-10">
                <textarea class="form-control" id="notice" name="notice" rows="7" ng-model="data.notice" ng-focus="closePopoverWindow()"></textarea>
                <div class="invalid-feedback d-block" ng-if="formErrors.notice">{{formErrors.notice}}</div>
            </div>
        </div>

        <div class="form-group row">
            <label for="inputName" class="col-sm-2 col-form-label" translate>WORDS.CUSTOM_FIELDS</label>
            <div class="col-sm-10">

                <div class="row custom-field-headline" ng-show="data.custom_fields.length > 0">
                    <div class="col-sm-4" translate>WORDS.NAME</div>
                    <div class="col-sm-7" translate>WORDS.VALUE</div>
                    <div class="col-sm-1"></div>
                </div>

                <div class="form-group" ng-repeat="customField in data.custom_fields">
                    <div class="row">
                        <div class="col-sm-4">
                            <input type="text" class="form-control" name="customFields[{{$index}}][name]" ng-model="data.custom_fields[$index].name" required ng-maxlength=255>
                            <div class="invalid-feedback d-block" ng-if="modalForm['customFields[' + $index + '][name]'].$error.required" ng-show="modalForm.$submitted" translate>VALIDATION.REQUIRED</div>
                            <div class="invalid-feedback d-block" ng-if="modalForm['customFields[' + $index + '][name]'].$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="255" translate>VALIDATION.MAX_LENGTH</div>
                            <div class="invalid-feedback d-block" ng-if="formErrors.custom_fields[$index].name">{{formErrors.custom_fields[$index].name}}</div>
                        </div>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" name="customFields[{{$index}}][value]" ng-model="data.custom_fields[$index].value" required ng-maxlength=255>
                            <div class="invalid-feedback d-block" ng-if="modalForm['customFields[' + $index + '][value]'].$error.required" ng-show="modalForm.$submitted" translate>VALIDATION.REQUIRED</div>
                            <div class="invalid-feedback d-block" ng-if="modalForm['customFields[' + $index + '][value]'].$error.maxlength" ng-show="modalForm.$submitted" translate-value-characters="255" translate>VALIDATION.MAX_LENGTH</div>
                            <div class="invalid-feedback d-block" ng-if="formErrors.custom_fields[$index].value">{{formErrors.custom_fields[$index].value}}</div>
                        </div>
                        <div class="col-sm-1">
                            <a class="btn btn-light" ng-click="deleteCustomField($index)"><i class="fa fa-trash-o"></i></a>
                        </div>
                    </div>
                </div>

                <div>
                    <a class="btn btn-light btn-sm" ng-click="addCustomField()"><i class="fa fa-plus"></i> {{ "WORDS.ADD_CUSTOM_FIELD" | translate }}</a>
                </div>
            </div>
        </div>

        <div class="form-group row">
            <div class="col-sm-2"></div>
            <div class="col-sm-10">
                <div class="form-check">
                    <input class="form-check-input" type="checkbox" id="logEnableCheckbox" name="inputLogEnabled" ng-model="data.log_enabled">
                    <label class="form-check-label" for="logEnableCheckbox">
                        {{ 'WORDS.ENABLE_LOG'|translate }}
                    </label>
                </div>
            </div>
        </div>

        <div class="form-group row">
            <div class="col-sm-2"></div>
            <div class="col-sm-10">
                <button class="btn btn-primary" type="submit" ladda="isLaddaWorking" ng-if="!editingMode">{{ 'WORDS.ADD'|translate }}</button>
                <button class="btn btn-primary" type="submit" ladda="isLaddaWorking" ng-if="editingMode">{{ 'WORDS.EDIT'|translate }}</button>
            </div>
        </div>

    </div>

</form>
