forked from elementary/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
team.php
106 lines (86 loc) · 4.43 KB
/
team.php
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
include '_templates/sitewide.php';
$page['description'] = 'Meet the people behind elementary.';
$page['title'] = 'Team ⋅ elementary';
// $page['theme-color'] = '#226BB3';
$page['scripts'] = '<link rel="stylesheet" type="text/css" media="all" href="styles/team.css">';
include $template['header'];
include $template['alert'];
require_once __DIR__.'/backend/config.loader.php';
$apiUrl = "https://slack.com/api/users.list?presence=1&token={$config['slack_token']}";
$apiContent = file_get_contents($apiUrl);
$apiResponse = json_decode($apiContent, true);
$apiFilter = array( // Filter certain member IDs from showing up on the page
"USLACKBOT", // slackbot
"U02CH39T2", // Nathan Dyer (3rd-party)
"U02DCH8AF", // ikey (3rd-party)
"U043P7SCH", // debarshi.ray (GNOME)
"U02RZBX56", // sri (GNOME)
"U0299PY5U", // David Gomes (Fix title!)
"U0299C8QT", // teemperor (Fix title!)
"U02RCLE6C", // Gero (Remove "Elementary" from title)
"U028XTDHM", // Kiran (inactive)
"U02AEMYH1", // Tom (inactive)
"U02AENUA1", // Mario (inactive)
);
?>
<section class="grid">
<div class="two-thirds">
<h2>We believe in the unique combination of top-notch UX and the world-changing power of Open Source.</h2>
<p>elementary was founded in 2007 by a small group of passionate volunteers. Over the years, we’ve been able to grow into a tiny company and fund the development of open source software. We’re a dedicated team of developers, designers, writers, and everyday computer users crafting an incredible open computing experience. We are elementary.</p>
</div>
</section>
<section class="grid">
<div class="whole">
<?php
if ($apiResponse['ok']) {
?>
<div class="team-directory">
<?php
$members = array_filter( $apiResponse['members'], function($member) use ($apiFilter) {
if ( in_array( $member['id'], $apiFilter ) ) return false;
if ( $member['deleted'] ) return false;
if ( !isset($member['profile']['title']) || $member['profile']['title'] == '' ) return false;
if ( $member['is_bot'] ) return false;
return true;
});
foreach ( $members as $key => $member ) {
// Because some people just want to see the page burn
if ( !empty($member['real_name']) ) {
$members[$key]['name'] = htmlspecialchars($member['real_name']);
} else {
$members[$key]['name'] = htmlspecialchars($member['name']);
}
$members[$key]['profile']['title'] = htmlspecialchars($member['profile']['title']);
}
usort( $members, function($a, $b) {
if ( $a['id'] == 'U029601AF' ) return -1; // "I'm #1!" ~ Dan
if ( $b['id'] == 'U029601AF' ) return 1;
if ( $a['is_admin'] && !$b['is_admin'] ) return -1; // Admin's first
if ( $b['is_admin'] && !$a['is_admin'] ) return 1;
if ( $a['presence'] == 'active' && $b['presence'] != 'active') return -1; // Online people first
if ( $b['presence'] == 'active' && $a['presence'] != 'active') return 1;
return strcasecmp( $a['name'], $b['name'] ); // Sort alphabetically
});
foreach( $members as $member ) {
?>
<div class="member">
<div class="member_photo" style="background-image:url(<?=$member['profile']['image_192']?>)"></div>
<h5 class="member_name"><?=$member['name']?><?php if ($member['presence'] == 'active') { ?><img class="member_status" title="Online" src="<?=$sitewide['root'];?>images/team/user-available.svg"><?php } ?></h5>
<span class="member_title"><?=$member['profile']['title']?></span>
<span class="member_time"><?=$member['tz_label']?></span>
</div>
<?php
}
?>
</div>
<?php
}
?>
<a class="button suggested-action" href="get-involved">Get Involved</a>
<p class="small-label"><i class="fa fa-slack"></i> Powered by Slack</p>
</div>
</section>
<?php
include $template['footer'];
?>