aboutsummaryrefslogtreecommitdiff
path: root/src/components/notifications/notifications.vue
blob: 37104b9065649fb4463b74ca64c1885fc6c81a64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<template>
  <div class="notifications">
    <div class="panel panel-default">
      <div class="panel-heading">
        <div class="title">
          {{$t('notifications.notifications')}}
          <span class="badge badge-notification unseen-count" v-if="unseenCount">{{unseenCount}}</span>
        </div>
        <div @click.prevent class="loadmore-error alert error" v-if="error">
          {{$t('timeline.error_fetching')}}
        </div>
        <button v-if="unseenCount" @click.prevent="markAsSeen" class="read-button">{{$t('notifications.read')}}</button>
      </div>
      <div class="panel-body">
        <div v-for="notification in visibleNotifications" :key="notification.id" class="notification" :class='{"unseen": !notification.seen}'>
          <div class="notification-overlay"></div>
          <notification :notification="notification"></notification>
        </div>
      </div>
      <div class="panel-footer">
        <div v-if="bottomedOut" class="new-status-notification text-center panel-footer faint">
          {{$t('notifications.no_more_notifications')}}
        </div>
        <a v-else-if="!loading" href="#" v-on:click.prevent="fetchOlderNotifications()">
          <div class="new-status-notification text-center panel-footer">{{$t('notifications.load_older')}}</div>
        </a>
        <div v-else class="new-status-notification text-center panel-footer">
          <i class="icon-spin3 animate-spin"/>
        </div>
      </div>
    </div>
  </div>
</template>

<script src="./notifications.js"></script>
<style lang="scss" src="./notifications.scss"></style>