-
Notifications
You must be signed in to change notification settings - Fork 1
/
about.js
49 lines (44 loc) · 1.39 KB
/
about.js
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
44
45
46
47
48
49
import $ from 'jquery';
import _ from 'underscore';
import util from './app/Util';
import sheet from './app/Sheet';
const SPREADSHEET_ID = '1j3zUIVBgxS7ZiSGlMsnq-g8bwsFGASr6ShZjX5CtQTU'; //'1ZbpkjdrrAH95xHWKxjp-bb6nvoKZIZLhXrDwBREa_PA';
// setup contributors
sheet.load(SPREADSHEET_ID, 1, rows => {
var core = [],
nonCore = [];
_.each(rows, row => {
var obj = sheet.parseRow(row);
obj.core = util.parseBool(obj.core);
if (obj.core) {
core.push(obj);
} else {
nonCore.push(obj);
}
});
$('.contributors-core').append(util.joinAnd(_.map(core, c => {
if (c.url) {
return `<a href="${c.url}" target="_blank">${c.name}</a>`;
} else {
return c.name;
}
})));
$('.contributors-more').append(util.joinAnd(_.map(nonCore, c => {
if (c.url) {
return `<a href="${c.url}" target="_blank">${c.name}</a>`;
} else {
return c.name;
}
})));
});
// setup about text
// sheet.load(SPREADSHEET_ID, 2, rows => {
// var topText = sheet.parseRow(rows[0]).text,
// introText = sheet.parseRow(rows[1]).text,
// bodyText = sheet.parseRow(rows[2]).text;
// $('.about-intro .about-body').html(`<p><b>${topText}</b></p>`);
// $('.about-intro .about-body').append(
// _.map(introText.split('\n'), line => `<p>${line}</p>`));
// $('.about-letter').html(
// _.map(bodyText.split('\n'), line => `<p>${line}</p>`));
// });