<div ng-if="$ctrl.card.hasAccount">
    <vn-watcher
        vn-id="watcher"
        url="MailForwards"
        id-field="account"
        id-value="$ctrl.$params.id"
        data="data"
        form="form">
    </vn-watcher>
    <form
        name="form"
        ng-submit="watcher.submit()"
        class="vn-w-md">
        <vn-card class="vn-pa-lg">
            <vn-vertical>
                <vn-check
                    label="Enable mail forwarding"
                    ng-model="watcher.hasData">
                </vn-check>
                <vn-textfield
                    ng-if="watcher.hasData"
                    label="Forward email"
                    ng-model="data.forwardTo"
                    info="All emails will be forwarded to the specified address."
                    rule="MailForward"
                    vn-focus>
                </vn-textfield>
            </vn-vertical>
        </vn-card>
        <vn-button-bar>
            <vn-submit
                disabled="!watcher.dataChanged()"
                label="Save">
            </vn-submit>
            <vn-button
                class="cancel"
                label="Undo changes"
                disabled="!watcher.dataChanged()"
                ng-click="watcher.loadOriginalData()">
            </vn-button>
        </vn-button-bar>
    </form>
</div>
<div
    ng-if="!$ctrl.card.hasAccount"
    class="bg-title"
    translate>
    Account not enabled
</div>