-
Notifications
You must be signed in to change notification settings - Fork 341
/
index.php
114 lines (98 loc) · 2.53 KB
/
index.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
107
108
109
110
111
112
113
114
<?php
$page_title = "Specs — OAuth";
$page_section = "specs";
$page_secondary = "";
$page_meta_description = "";
require('../../includes/_header.php');
// These are sorted by the fetch-status.php script already
$specs = json_decode(file_get_contents(__DIR__.'/../../data/specs/data/specs.json'), true);
function display_draft($draft) {
$filename = __DIR__.'/../../data/specs/drafts/'.$draft.'/status.json';
if(!file_exists($filename)) {
echo '<tr><td>'.$draft.'</td><td>Could not find file</td></tr>';
return;
}
$status = json_decode(file_get_contents($filename), true);
?>
<tr>
<td>
<b><?= htmlspecialchars($status['title']) ?></b>
<br>
<?php
if(isset($status['rfc'])) {
echo '<a href="https://www.rfc-editor.org/rfc/rfc' . $status['rfc'] . '">'
. 'RFC ' . $status['rfc']
. '</a>';
} else {
if(!empty($status['version'])) {
echo '<a href="https://www.ietf.org/archive/id/' . $draft . '-' . $status['version'] . '.html">'
. $draft . '-' . $status['version']
. '</a>';
} else {
echo '<a href="https://tools.ietf.org/html/' . $draft . '">'
. $draft
. '</a>';
}
}
?>
<br>
<?php
$draftStatus = trim(preg_replace('/RFC [0-9]+/', '', $status['status']), '() ');
if(!in_array($draftStatus, ['I-D Exists', 'Proposed Standard'])) {
echo htmlspecialchars($draftStatus);
}
?>
</td>
<td width="100">
<nobr><?= $status['last_revised_date'] ?></nobr>
</td>
</tr>
<?php
}
?>
<style>
table.rfcs {
width: 100%;
}
table.rfcs td {
padding: 8px;
vertical-align: top;
border-top: 1px #ddd solid;
}
table.rfcs tr:nth-child(odd) {
background: #eee;
}
</style>
<div class="container">
<div>
<h2>OAuth Working Group Specifications</h2>
<p>Current active drafts in the OAuth working group</p>
<h3>Active Drafts</h3>
<table class="rfcs">
<?php
foreach($specs['drafts'] as $spec) {
display_draft($spec);
}
?>
</table>
<br><br>
<h3>Active Individual Drafts</h3>
<table class="rfcs">
<?php
foreach($specs['individuals'] as $spec) {
display_draft($spec);
}
?>
</table>
<br><br>
<h3>RFCs</h3>
<table class="rfcs">
<?php
foreach($specs['rfcs'] as $spec) {
display_draft($spec);
}
?>
</table>
</div>
</div>
<?php require('../../includes/_footer.php'); ?>