summaryrefslogtreecommitdiffstats
path: root/client/components/main/header.js
blob: c05b1c3c3f2d9a7d142dbd62c03cd2a2f6a264ae (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
37
38
39
40
41
42
43
Meteor.subscribe('user-admin');
Meteor.subscribe('boards');
Meteor.subscribe('setting');

Template.header.helpers({
  wrappedHeader() {
    return !Session.get('currentBoard');
  },

  currentSetting() {
    return Settings.findOne();
  },

  hideLogo() {
    return Utils.isMiniScreen() && Session.get('currentBoard');
  },

  appIsOffline() {
    return !Meteor.status().connected;
  },

  hasAnnouncement() {
    const announcements =  Announcements.findOne();
    return announcements && announcements.enabled;
  },

  announcement() {
    $('.announcement').show();
    const announcements =  Announcements.findOne();
    return announcements && announcements.body;
  },
});

Template.header.events({
  'click .js-create-board': Popup.open('headerBarCreateBoard'),
  'click .js-close-announcement'() {
    $('.announcement').hide();
  },
  'click .js-select-list'() {
    Session.set('currentList', this._id);
    Session.set('currentCard', null);
  },
});