<div ng-switch on="item.subscriptionType">

    <div ng-switch-when="keywords">
        <p class="news-feed-item-action">
            <span class="news-feed-user">{{item.contentVariables.from | userIdToName}}</span> <span translate>has added <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">a new {{ item.sourceType | elementTypeToText | translate }}</a>.</span>
        </p>

        <blockquote class="news-feed-item-content" ng-if="item.sourceType === 'note'" ng-bind-html="item.contentVariables.text"></blockquote>

        <table class="news-feed-item-details">
            <tbody>
            <tr>
                <td class="news-feed-item-details-key" translate>Keywords</td>
                <td class="news-feed-item-details-value">
                    {{item.contentVariables.keywords | keywordsPrint}}
                </td>
            </tr>
            </tbody>
        </table>

        <span class="news-feed-footnote" translate>Based on your keyword subscription to {{ item.subscriptionTargetDescription }}.</span>
    </div>


    <div ng-switch-when="riskCategory">
        <div ng-if="item.actionType === 'new-risk'">

            <p class="news-feed-item-action">
                <span class="news-feed-user">{{item.contentVariables.risk.lastAuthor }}</span> <span translate>has added <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">a new risk</a>.</span>
            </p>

            <blockquote class="news-feed-item-content">
                <a href="{{ absoluteUrl }}{{ item.sourceUrl }}"><b ng-bind-html="item.contentVariables.risk.title"></b></a><br>
                <span ng-bind-html="item.contentVariables.risk.description"></span>
            </blockquote>

            <table class="news-feed-item-details">
                <tbody>
                <tr>
                    <td class="news-feed-item-details-key" translate>Risk category you are watching</td>
                    <td class="news-feed-item-details-value">
                        {{ item.subscriptionTargetDescription }}
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

        <div ng-if="item.actionType === 'changed-risk'">

            <p class="news-feed-item-action">
                <span class="news-feed-user">{{ item.contentVariables.risk.lastAuthor }}</span> <span translate>has changed <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">a risk entry</a>.</span>
            </p>

            <blockquote class="news-feed-item-content">
                <b ng-bind-html="item.contentVariables.risk.title"></b><br>
                <span ng-bind-html="item.contentVariables.risk.description"></span>
            </blockquote>

            <blockquote class="news-feed-item-content-old">
                <b ng-bind-html="item.contentVariables.risk.old.title"></b><br>
                <span ng-bind-html="item.contentVariables.risk.old.description"></span>
            </blockquote>

            <table class="news-feed-item-details">
                <tbody>
                <tr>
                    <td class="news-feed-item-details-key" translate>Risk category you are watching</td>
                    <td class="news-feed-item-details-value">
                        {{ item.subscriptionTargetDescription }}
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

        <div ng-if="item.actionType === 'deleted-risk'">
            <p class="news-feed-item-action">
                <span translate>A risk was <b>deleted</b>.</span>
            </p>

            <blockquote class="news-feed-item-content">
                <b ng-bind-html="item.contentVariables.risk.title"></b><br>
                <span ng-bind-html="item.contentVariables.risk.description"></span>
            </blockquote>

            <table class="news-feed-item-details">
                <tbody>
                <tr>
                    <td class="news-feed-item-details-key" translate>Risk category you are watching</td>
                    <td class="news-feed-item-details-value">
                        {{ item.subscriptionTargetDescription }}
                    </td>
                </tr>
                </tbody>
            </table>

        </div>

        <div ng-if="item.actionType === 'new-impact'">

            <p class="news-feed-item-action">
                <span class="news-feed-user">{{ item.contentVariables.from | userIdToName }}</span>
                <span translate>has added <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">a new impact</a>.</span>
            </p>

            <table class="news-feed-item-details">
                <tbody>
                <tr>
                    <td class="news-feed-item-details-key" translate>Impactful note</td>
                    <td class="news-feed-item-details-value">
                        <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">{{ item.contentVariables.impact.sourceDescription }}</a>
                    </td>
                </tr>
                <tr>
                    <td class="news-feed-item-details-key" translate>Risk category you are watching</td>
                    <td class="news-feed-item-details-value">
                        {{ item.subscriptionTargetDescription }}
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div ng-switch-when="note">
        <div ng-if="item.actionType === 'new-impact'">

            <p class="news-feed-item-action">
                <span class="news-feed-user">{{ item.contentVariables.from | userIdToName }}</span>
                <span translate>has added <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">a new impact</a>.</span>
            </p>

            <table class="news-feed-item-details">
                <tbody>
                <tr>
                    <td class="news-feed-item-details-key" translate>Impactful note you are watching</td>
                    <td class="news-feed-item-details-value">
                        <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">{{ item.contentVariables.impact.sourceDescription }}</a>
                    </td>
                </tr>
                <tr>
                    <td class="news-feed-item-details-key" translate>Risk</td>
                    <td class="news-feed-item-details-value">
                        {{ item.contentVariables.targetDescription }}
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div ng-switch-when="risk">
        <div ng-switch on="item.actionType">
            <div ng-switch-when="changed-risk">

                <p class="news-feed-item-action">
                    <span class="news-feed-user">{{ item.contentVariables.risk.lastAuthor }}</span>
                    <span translate>has changed <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">a risk</a> you are watching.</span>
                </p>

                <blockquote class="news-feed-item-content">
                    <b ng-bind-html="item.contentVariables.risk.title"></b><br>
                    <span ng-bind-html="item.contentVariables.risk.description"></span>
                </blockquote>

                <blockquote class="news-feed-item-content-old">
                    <b ng-bind-html="item.contentVariables.risk.old.title"></b><br>
                    <span ng-bind-html="item.contentVariables.risk.old.description"></span>
                </blockquote>
            </div>

            <div ng-switch-when="deleted-risk">
                <p class="news-feed-item-action">
                    <span translate>A risk you have been watching was <b>deleted</b>.</span>
                </p>

                <blockquote class="news-feed-item-content">
                    <b ng-bind-html="item.contentVariables.risk.title"></b><br>
                    <span ng-bind-html="item.contentVariables.risk.description"></span>
                </blockquote>
            </div>

            <div ng-switch-when="new-impact">
                <p class="news-feed-item-action">
                    <span class="news-feed-user">{{ item.contentVariables.from | userIdToName }}</span>
                    <span translate>has added <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">a new impact</a>.</span>
                </p>

                <table class="news-feed-item-details">
                    <tbody>
                    <tr>
                        <td class="news-feed-item-details-key" translate>Impactful note</td>
                        <td class="news-feed-item-details-value">
                            <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">{{ item.contentVariables.impact.sourceDescription }}</a>
                        </td>
                    </tr>
                    <tr>
                        <td class="news-feed-item-details-key" translate>Risk you are watching</td>
                        <td class="news-feed-item-details-value">
                            {{ item.contentVariables.targetDescription }}
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <div ng-switch-when="task">
        <div ng-if="item.actionType === 'changed-task-status'">

            <p class="news-feed-item-action">
                <span class="news-feed-user">{{ item.contentVariables.from | userIdToName }}</span>
                <span translate>updated the status of <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">this OCA task</a>.</span>
            </p>

            <table class="news-feed-item-details">
                <tbody>
                <tr>
                    <td class="news-feed-item-details-key" translate>Task</td>
                    <td class="news-feed-item-details-value">
                        <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">{{ item.contentVariables.task.title }}</a>
                    </td>
                </tr>
                <tr>
                    <td class="news-feed-item-details-key" translate>Status</td>
                    <td class="news-feed-item-details-value">
                        {{ item.contentVariables.new_status | translate }}
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div ng-switch-when="auditForm">
        TODO TODO TODO
    </div>

    <div ng-switch-when="interaction">
        <div ng-if="item.actionType === 'new-comment'">

            <p class="news-feed-item-action">
                <span class="news-feed-user">{{ item.contentVariables.interactionObj.userId | userIdToName }}</span>
                <span translate>has added <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">a new comment</a>.</span>
            </p>

            <blockquote class="news-feed-item-content">
                {{ item.contentVariables.interactionObj.content.commentText }}
            </blockquote>

            <table class="news-feed-item-details">
                <tbody>
                <tr>
                    <td class="news-feed-item-details-key">{{ item.sourceType | elementTypeToText | translate }}</td>
                    <td class="news-feed-item-details-value">
                        <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">{{ item.subscriptionTargetDescription }}</a>
                    </td>
                </tr>
                </tbody>
            </table>

        </div>

        <div ng-if="item.actionType === 'new-watch'">

            <p class="news-feed-item-action">
                <span class="news-feed-user">{{ item.contentVariables.interactionObj.userId | userIdToName }}</span>
                <span translate>is now watching this item.</span>
            </p>

            <table class="news-feed-item-details">
                <tbody>
                <tr>
                    <td class="news-feed-item-details-key">{{ item.sourceType | elementTypeToText | translate }}</td>
                    <td class="news-feed-item-details-value">
                        <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">{{ item.subscriptionTargetDescription }}</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

        <div ng-if="item.actionType === 'new-unwatch'">

            <p class="news-feed-item-action">
                <span class="news-feed-user">{{ item.contentVariables.interactionObj.userId | userIdToName }}</span>
                <span translate>has stopped watching this item.</span>
            </p>

            <table class="news-feed-item-details">
                <tbody>
                <tr>
                    <td class="news-feed-item-details-key">{{ item.sourceType | elementTypeToText | translate }}</td>
                    <td class="news-feed-item-details-value">
                        <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">{{ item.subscriptionTargetDescription }}</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>

        <div ng-if="item.actionType === 'new-highlight1'">

            <p class="news-feed-item-action" style="min-height: 60px;">
                <span class="news-feed-user">{{ item.contentVariables.interactionObj.userId | userIdToName }}</span>
                <span translate>has <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">posted</a> a</span> {{ 'Highlight (!)' | translate }}.
            </p>

            <table class="news-feed-item-details">
                <tbody>
                <tr>
                    <td class="news-feed-item-details-key">{{ item.sourceType | elementTypeToText | translate }}</td>
                    <td class="news-feed-item-details-value">
                        <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">{{ item.subscriptionTargetDescription }}</a>
                    </td>
                </tr>
                </tbody>
            </table>

        </div>

        <div ng-if="item.actionType === 'new-highlight2'">

            <p class="news-feed-item-action" style="min-height: 60px;">
                <span class="news-feed-user">{{ item.contentVariables.interactionObj.userId | userIdToName }}</span>
                <span translate>has <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">posted</a> a</span> {{ 'Highlight (!!)' | translate }}.
            </p>

            <table class="news-feed-item-details">
                <tbody>
                <tr>
                    <td class="news-feed-item-details-key">{{ item.sourceType | elementTypeToText | translate }}</td>
                    <td class="news-feed-item-details-value">
                        <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">{{ item.subscriptionTargetDescription }}</a>
                    </td>
                </tr>
                </tbody>
            </table>

        </div>

        <div ng-if="item.actionType === 'new-highlight3'">

            <p class="news-feed-item-action" style="min-height: 60px;">
                <span class="news-feed-user">{{ item.contentVariables.interactionObj.userId | userIdToName }}</span>
                <span translate>has <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">posted</a> a</span> {{ 'Highlight (!!!)' | translate }}.
            </p>

            <table class="news-feed-item-details">
                <tbody>
                <tr>
                    <td class="news-feed-item-details-key">{{ item.sourceType | elementTypeToText | translate }}</td>
                    <td class="news-feed-item-details-value">
                        <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">{{ item.subscriptionTargetDescription }}</a>
                    </td>
                </tr>
                </tbody>
            </table>

        </div>
    </div>

    <div ng-switch-default>
        <div ng-if="item.actionType === 'mention'">

            <p class="news-feed-item-action">
                <span class="news-feed-user">{{ item.contentVariables.from | userIdToName }}</span>
                <span translate>has mentioned you.</span>
            </p>

            <blockquote class="news-feed-item-content">
                {{item.contentVariables.text}}
            </blockquote>

            <table class="news-feed-item-details">
                <tbody>
                <tr>
                    <td class="news-feed-item-details-key" translate>Mentioned in</td>
                    <td class="news-feed-item-details-value">
                        <a href="{{ absoluteUrl }}{{ item.sourceUrl }}">
                            {{ item.sourceType | elementTypeToText | translate }}
                        </a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
