<div class="notification-panel-title"><span translate>Your notifications</span><a ng-click="CloseNotificationPanel()"><i class="fa fa-times-circle"></i></a></div>

<div class="actions-container">
    <a href="#/notifications" ng-click="goToNoficiationsPage()" class="ekup-button ekup-button-secondary" translate>See all notifications</a>
    <button ng-if="Notifications.length > 1" ng-click="doDismissAll()" class="ekup-button ekup-button-secondary ekup-error-button" translate>Hide all</button>
</div>

<div ng-if="Notifications.length == 0" style="text-align: center; padding: 20px;" translate>
    No notifications
</div>

<ul class="notification">
    <li ng-repeat="item in Notifications track by item.ID" id="notification-item-{{item.ID}}" class="item {{item.Type.toLowerCase()}} {{item.HasBeenSeen == false ? 'new' : ''}}">
        <div class="title"><i class="fa {{GetItemIcon(item.Type)}}"></i><span>{{item.Title}}</span><a ng-if="item.HasBeenSeen == false" class="markAsRead" ng-click="flagAsSeen(item.ID)"><i class="fa fa-eye"></i></a></div>
        <div class="content">
            <div>{{RelativeDate(item.Timestamp)}}</div>
            <div ng-if="item.Action != 'update:new'" class="message">{{item.Message}}</div>
            <div ng-show="item.DownloadLink != null">
                <div translate>If the backup file was not downloaded automatically, <a href="{{item.DownloadLink}}" target="_blank">right click and choose &quot;Save as …&quot;</a></div>
            </div>
            <div ng-if="item.Action != 'update:new'" class="actions-container">
                <button ng-click="doDismiss(item.ID)" class="ekup-button ekup-{{item.Type.toLowerCase()}}-button" translate>Hide</button>

                <button ng-show="item.Action == 'backup:show-log'" ng-click="doShowLog(item.BackupID)" class="ekup-button ekup-{{item.Type.toLowerCase()}}-button" translate>Show</button>

                <button ng-show="item.Message.indexOf('please run repair') > 0" ng-click="doRepair(item.BackupID)" class="ekup-button ekup-{{item.Type.toLowerCase()}}-button" translate>Repair</button>

                <button ng-show="item.Action.indexOf('bug-report:created:') == 0 &amp;&amp; item.DownloadLink == null" ng-click="doDownloadBugreport(item)" class="ekup-button ekup-{{item.Type.toLowerCase()}}-button" translate>Download</button>
                <div class="clear"></div>
            </div>


            <div ng-if="item.Action == 'update:new'">
                <div class="message" translate translate-params-message="item.Message">New update found: {{message}}</div>

                <progress-bar ng-show="state.updaterState == 'Downloading'" ng-text="'Downloading update…' | translate" ng-progress="state.updateDownloadProgress"></progress-bar>

                <div class="actions-container">
                    <button ng-click="doDismiss(item.ID)" class="ekup-button ekup-button-secondary ekup-error-button" translate>Hide</button>
                    <button ng-show="!state.updateReady &amp;&amp; state.updaterState == 'Waiting'" ng-click="doInstallUpdate(item.ID)" class="ekup-button ekup-button-secondary " translate>Install</button>
                    <button ng-show="state.updateReady &amp;&amp; state.updaterState == 'Waiting'" ng-click="doActivateUpdate(item.ID)" class="ekup-button ekup-button-secondary " translate>Activate</button>
                    <button ng-show="state.updaterState == 'Downloading'" class="ekup-button ekup-button-secondary " ng-disabled="true" ng-click="" translate>Downloading …</button>
                    <button ng-show="state.updaterState == 'Checking'" class="ekup-button ekup-button-secondary" ng-disabled="true" ng-click="" translate>Verifying …</button>
                    <button ng-click="doShowUpdate()" class="ekup-button ekup-button-secondary " translate>Show</button>
                    <div class="clear"></div>
                </div>
            </div>
        </div>
    </li>
</ul>

<iframe style="display: none" ng-src="{{DownloadLink}}"></iframe>
