<div class="single-page-wrapper" ng-controller="ShareLinkViewController as sharelinkCtrl" style="width: 450px;">
    <div id="logo_box">
        <img src="/img/logo.png" border="0" style="height: 80px;">
    </div>

    <div class="loading-text" translate ng-show="loading">TEXT.LOADING_PLEASE_WAIT</div>
    <div class="loading-text" translate ng-show="accessDenied">SHARE_LINK.ACCESS_EXPIRED</div>

    <form class="form-horizontal" novalidate ng-show="!loading && data.mode == 'read'">
        <div ng-if="!loading && data.mode == 'read'">
            <div class="form-group row">
                <div class="col-sm-12">
                    <h2><i class="fa" ng-class="password.icon" style="font-size: 20px; margin-top: 20px;"></i> {{ password.name }}</h2>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'email'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.email_type" on-copied="sharelinkCtrl.onCopied('WORDS.EMAIL_TYPE')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.EMAIL_TYPE', password.email_type)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.EMAIL_TYPE'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.email_type">{{password.email_type}}</p>
                        <p class="form-control-static" ng-show="!password.email_type" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'email'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.auth_method" on-copied="sharelinkCtrl.onCopied('WORDS.AUTH_METHOD')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.AUTH_METHOD', password.auth_method)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.AUTH_METHOD'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.auth_method">{{password.auth_method}}</p>
                        <p class="form-control-static" ng-show="!password.auth_method" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="!password.password_type  || password.password_type == 'plain' || password.password_type == 'bankaccount' || password.password_type == 'software_license'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.url" on-copied="sharelinkCtrl.onCopied('WORDS.URL')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.URL', password.url)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.URL'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.url">{{password.url}}</p>
                        <p class="form-control-static" ng-show="!password.url" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'server' || password.password_type == 'email'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.host" on-copied="sharelinkCtrl.onCopied('WORDS.HOST')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.HOST', password.host)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.HOST'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.host">{{password.host}}</p>
                        <p class="form-control-static" ng-show="!password.host" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'email' || password.password_type == 'server'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.port" on-copied="sharelinkCtrl.onCopied('WORDS.PORT')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.PORT', password.port)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.PORT'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.port">{{password.port}}</p>
                        <p class="form-control-static" ng-show="!password.port" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="!password.password_type  || password.password_type == 'plain' || password.password_type == 'server' || password.password_type == 'bankaccount' || password.password_type == 'email'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.username" on-copied="sharelinkCtrl.onCopied('WORDS.USERNAME')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.USERNAME', password.username)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.USERNAME'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.username">{{password.username}}</p>
                        <p class="form-control-static" ng-show="!password.username" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="(!password.password_type  || password.password_type == 'plain' || password.password_type == 'server' || password.password_type == 'email') && password.complete">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.password" on-copied="sharelinkCtrl.onCopied('WORDS.PASSWORD')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.PASSWORD', password.password)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.PASSWORD'|translate}}</label>
                <div class="col-sm-9">
                    <div class="input-group">
                        <div class="input-group-prepend">
                            <span class="input-group-text"><a ng-click="togglePasswordVisibility('password')"><i class="fa" ng-class="{'fa-eye': passwordInputType.password == 'password', 'fa-eye-slash': passwordInputType.password == 'text'}"></i></a></span>
                        </div>
                        <input type="{{passwordInputType.password}}" class="form-control" id="inputPassword" name="inputPassword" ng-model="password.password" style="width: 40%;" readonly>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="(password.password_type == 'bankaccount' || password.password_type == 'credit_card') && password.complete">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.pin" on-copied="sharelinkCtrl.onCopied('WORDS.PIN')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.PIN', password.pin)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.PIN'|translate}}</label>
                <div class="col-sm-9">
                    <div class="input-group">
                        <div class="input-group-prepend">
                            <span class="input-group-text"><a ng-click="togglePasswordVisibility('pin')"><i class="fa" ng-class="{'fa-eye': passwordInputType.pin == 'password', 'fa-eye-slash': passwordInputType.pin == 'text'}"></i></a></span>
                        </div>
                        <input type="{{passwordInputType.pin}}" class="form-control" name="inputPin" ng-model="password.pin" style="width: 40%;" readonly>
                    </div>
                </div>
            </div>

            <div class="form-group row" ng-if="password.password_type == 'bankaccount'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.bank_name" on-copied="sharelinkCtrl.onCopied('WORDS.BANK_NAME')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.BANK_NAME', password.bank_name)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.BANK_NAME'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.bank_name">{{password.bank_name}}</p>
                        <p class="form-control-static" ng-show="!password.bank_name" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'bankaccount'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.bank_code" on-copied="sharelinkCtrl.onCopied('WORDS.BANK_CODE')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.BANK_CODE', password.bank_code)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.BANK_CODE'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.bank_code">{{password.bank_code}}</p>
                        <p class="form-control-static" ng-show="!password.bank_code" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'bankaccount'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.account_holder" on-copied="sharelinkCtrl.onCopied('WORDS.ACCOUNT_HOLDER')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.ACCOUNT_HOLDER', password.account_holder)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.ACCOUNT_HOLDER'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.account_holder">{{password.account_holder}}</p>
                        <p class="form-control-static" ng-show="!password.account_holder" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'bankaccount'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.account_number" on-copied="sharelinkCtrl.onCopied('WORDS.ACCOUNT_NUMBER')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.ACCOUNT_NUMBER', password.account_number)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.ACCOUNT_NUMBER'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.account_number">{{password.account_number}}</p>
                        <p class="form-control-static" ng-show="!password.account_number" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'bankaccount'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.iban" on-copied="sharelinkCtrl.onCopied('WORDS.IBAN')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.IBAN', password.iban)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.IBAN'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.iban">{{password.iban}}</p>
                        <p class="form-control-static" ng-show="!password.iban" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'credit_card'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.card_type" on-copied="sharelinkCtrl.onCopied('WORDS.CREDIT_CARD_TYPE')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.CREDIT_CARD_TYPE', password.card_type)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.CREDIT_CARD_TYPE'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.card_type">{{password.card_type}}</p>
                        <p class="form-control-static" ng-show="!password.card_type" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'credit_card'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.card_number" on-copied="sharelinkCtrl.onCopied('WORDS.CARD_NUMBER')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.CARD_NUMBER', password.card_number)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.CARD_NUMBER'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.card_number">{{password.card_number}}</p>
                        <p class="form-control-static" ng-show="!password.card_number" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'credit_card'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.card_cvc" on-copied="sharelinkCtrl.onCopied('WORDS.CARD_CVC')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.CARD_CVC', password.card_cvc)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.CARD_CVC'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.card_type">{{password.card_cvc}}</p>
                        <p class="form-control-static" ng-show="!password.card_type" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'credit_card'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.valid_from" on-copied="sharelinkCtrl.onCopied('WORDS.VALID_FROM')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.VALID_FROM', password.valid_from)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.VALID_FROM'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.valid_from">{{password.valid_from}}</p>
                        <p class="form-control-static" ng-show="!password.valid_from" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'credit_card'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.valid_to" on-copied="sharelinkCtrl.onCopied('WORDS.VALID_TO')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.VALID_TO', password.valid_to)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.VALID_TO'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.valid_to">{{password.valid_to}}</p>
                        <p class="form-control-static" ng-show="!password.valid_to" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'email'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.smtp_auth_method" on-copied="sharelinkCtrl.onCopied('WORDS.SMTP_AUTH_METHOD')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.SMTP_AUTH_METHOD', password.smtp_auth_method)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.SMTP_AUTH_METHOD'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.smtp_auth_method">{{password.smtp_auth_method}}</p>
                        <p class="form-control-static" ng-show="!password.smtp_auth_method" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'email'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.smtp_host" on-copied="sharelinkCtrl.onCopied('WORDS.SMTP_HOST')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.SMTP_HOST', password.smtp_host)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.SMTP_HOST'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.smtp_host">{{password.smtp_host}}</p>
                        <p class="form-control-static" ng-show="!password.smtp_host" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'email'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.smtp_port" on-copied="sharelinkCtrl.onCopied('WORDS.SMTP_PORT')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.SMTP_PORT', password.smtp_port)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.SMTP_PORT'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.smtp_port">{{password.smtp_port}}</p>
                        <p class="form-control-static" ng-show="!password.smtp_port" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'email'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.smtp_username" on-copied="sharelinkCtrl.onCopied('WORDS.SMTP_USERNAME')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.SMTP_USERNAME', password.smtp_username)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.SMTP_USERNAME'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.smtp_username">{{password.smtp_username}}</p>
                        <p class="form-control-static" ng-show="!password.smtp_username" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="(password.password_type == 'email') && password.complete">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.smtp_password" on-copied="sharelinkCtrl.onCopied('WORDS.SMTP_PASSWORD')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.SMTP_PASSWORD', password.smtp_password)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.SMTP_PASSWORD'|translate}}</label>
                <div class="col-sm-9">
                    <div class="input-group">
                        <div class="input-group-append">
                            <span class="input-group-text"><a ng-click="togglePasswordVisibility('smtpPassword')"><i class="fa" ng-class="{'fa-eye': passwordInputType.smtpPassword == 'password', 'fa-eye-slash': passwordInputType.smtpPassword == 'text'}"></i></a></span>
                        </div>
                        <input type="{{passwordInputType.smtpPassword}}" class="form-control" name="inputSmtpPassword" ng-model="password.smtp_password" style="width: 40%;" readonly>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'software_license'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.version" on-copied="sharelinkCtrl.onCopied('WORDS.VERSION')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.VERSION', password.version)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.VERSION'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.version">{{password.version}}</p>
                        <p class="form-control-static" ng-show="!password.version" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.password_type == 'software_license'">
                <label class="col-sm-3 control-label" clipboard uib-tooltip="{{ 'WORDS.COPY_TO_CLIPBOARD'|translate }}" tooltip-placement="right" text="password.license_key" on-copied="sharelinkCtrl.onCopied('WORDS.LICENSE_KEY')" on-error="sharelinkCtrl.onCopyFailed(err, 'WORDS.LICENSE_KEY', password.license_key)" aria-haspopup="true" style="cursor: pointer;">{{'WORDS.LICENSE_KEY'|translate}}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.license_key">{{password.license_key}}</p>
                        <p class="form-control-static" ng-show="!password.license_key" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-if="password.complete">
                <label class="col-sm-3 control-label">{{ 'WORDS.NOTICE'|translate }}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="password.notice">{{password.notice}}</p>
                        <p class="form-control-static" ng-show="!password.notice" translate>WORDS.NONE</p>
                    </div>
                </div>
            </div>
    
            <div class="form-group row" ng-repeat="customField in password.custom_fields">
                <label class="col-sm-3 control-label">{{ customField.name }}</label>
                <div class="col-sm-9">
                    <div class="controls">
                        <p class="form-control-static" ng-show="customField.value">{{ customField.value }}</p>
                    </div>
                </div>
            </div>
        </div>
    </form>

    <form name="modalForm" class="form-horizontal" ng-submit="submit()" novalidate ng-show="!loading && data.mode == 'read_write'">

        <div ng-if="!loading && data.mode == 'read_write'">
            <div class="form-group row">
                <label for="inputName" class="col-sm-2 control-label" translate>WORDS.NAME</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputName" name="inputName" ng-model="password.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 control-label" translate>WORDS.URL</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputURL" name="inputURL" ng-model="password.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 control-label" translate>WORDS.EMAIL_TYPE</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputEmailType" name="inputEmailType" ng-model="password.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 control-label" translate>WORDS.AUTH_METHOD</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputAuthMethod" name="inputAuthMethod" ng-model="password.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 control-label" translate>WORDS.HOST</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputHost" name="inputHost" ng-model="password.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 control-label" translate>WORDS.PORT</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputPort" name="inputPort" ng-model="password.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 control-label" translate>WORDS.USERNAME</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputUsername" name="inputUsername" ng-model="password.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 control-label" translate>WORDS.PASSWORD</label>
                <div class="col-sm-10">

                    <div class="input-group">
                        <div class="input-group-append">
                            <span class="input-group-text"><a ng-click="togglePasswordVisibility('password')"><i class="fa" ng-class="{'fa-eye': passwordInputType.password == 'password', 'fa-eye-slash': passwordInputType.password == 'text'}"></i></a></span>
                        </div>
                        <input type="{{passwordInputType.password}}" class="form-control" id="inputPassword" name="inputPassword" ng-model="password.password" ng-maxlength=255 required>
                    </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 control-label" translate>WORDS.PIN</label>
                <div class="col-sm-10">

                    <div class="input-group">
                        <div class="input-group-append">
                            <span class="input-group-text"><a ng-click="togglePasswordVisibility('pin')"><i class="fa" ng-class="{'fa-eye': passwordInputType.pin == 'password', 'fa-eye-slash': passwordInputType.pin == 'text'}"></i></a></span>
                        </div>
                        <input type="{{passwordInputType.pin}}" class="form-control" id="inputPIN" name="inputPIN" ng-model="password.pin" ng-maxlength=128>
                    </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 control-label" translate>WORDS.BANK_NAME</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputBankName" name="inputBankName" ng-model="password.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 control-label" translate>WORDS.BANK_CODE</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputBankCode" name="inputBankCode" ng-model="password.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 control-label" translate>WORDS.ACCOUNT_HOLDER</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputAccountHolder" name="inputAccountHolder" ng-model="password.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 control-label" translate>WORDS.ACCOUNT_NUMBER</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputAccountNumber" name="inputAccountNumber" ng-model="password.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 control-label" translate>WORDS.IBAN</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputIBAN" name="inputIBAN" ng-model="password.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 control-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="password.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 control-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="password.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 control-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="password.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 control-label" translate>WORDS.VALID_FROM</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputValidFrom" name="inputValidFrom" ng-model="password.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 control-label" translate>WORDS.VALID_TO</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputValidTo" name="inputValidTo" ng-model="password.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 control-label" translate>WORDS.SMTP_AUTH_METHOD</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputSmtpAuthMethod" name="inputSmtpAuthMethod" ng-model="password.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 control-label" translate>WORDS.SMTP_HOST</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputSmtpHost" name="inputSmtpHost" ng-model="password.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 control-label" translate>WORDS.SMTP_PORT</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputSmtpPort" name="inputSmtpPort" ng-model="password.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 control-label" translate>WORDS.SMTP_USERNAME</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputSmtpUsername" name="inputSmtpUsername" ng-model="password.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 control-label" translate>WORDS.SMTP_PASSWORD</label>
                <div class="col-sm-10">

                    <div class="input-group">
                        <div class="input-group-append">
                            <span class="input-group-text"><a ng-click="togglePasswordVisibility('smtpPassword')"><i class="fa" ng-class="{'fa-eye': passwordInputType.smtpPassword == 'password', 'fa-eye-slash': passwordInputType.smtpPassword == 'text'}"></i></a></span>
                        </div>
                        <input type="{{passwordInputType.smtpPassword}}" class="form-control" id="inputSMTPPassword" name="inputSMTPPassword" ng-model="password.smtp_password" ng-maxlength=128>
                    </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 control-label" translate>WORDS.VERSION</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputVersion" name="inputVersion" ng-model="password.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 control-label" translate>WORDS.LICENSE_KEY</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputLicenseKey" name="inputLicenseKey" ng-model="password.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 control-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="password.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" ng-repeat="customField in password.custom_fields">

                <label class="col-sm-2 control-label">{{ password.custom_fields[$index].name }}</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="customFields[{{$index}}][value]" ng-model="password.custom_fields[$index].value" required ng-maxlength=255>
                </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">{{ 'WORDS.EDIT'|translate }}</button>
                </div>
            </div>
        </div>
    </form>

</div>
