-
Notifications
You must be signed in to change notification settings - Fork 0
/
acceptedpapers.php
executable file
·92 lines (88 loc) · 2.94 KB
/
acceptedpapers.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
<!DOCTYPE html>
<html lang="en">
<head>
<?php // The header includes the head tag and start of body
require "includes/head.php";
?>
<meta property="og:title" content="<?php echo $META['shortName'];?> accepted papers"/>
<meta name="twitter:title" content="<?php echo $META['shortName'];?> accepted papers"/>
<title>
<?php echo $META['shortName'];?> Accepted Papers
</title>
</head>
<body>
<?php require "includes/nav.php"; ?>
<main class="container p-4">
<h2 class="indPageTitle">
Accepted Papers
</h2>
<!-- NOTE: if json/papers.json exists, then this will be hidden. -->
<p id="notYetAvailable">
This information is not yet available. This information will be available after authors are notified, which should
occur by <?php echo $META['finalNotification'];?>. Thank you for your patience.
</p>
<!-- NOTE: if json/papers.json is malformed, then this will be shown. -->
<p id="jsonWarning" class="text-danger d-none">
The papers.json file is malformed.
</p>
<!-- NOTE: if json/papers.json is fetched and parsed, then this is populated. -->
<div id="accepted">
</div>
<!-- Handlebars import of accepted papers in websubrev export format. See
json/sample_papers.json -->
<script id="acceptedScript" type="text/x-handlebars-template">
<p>
These papers are listed in order of submission.
</p>
<ol>
{{#each acceptedPapers}}
<li>
<h4 class="paperTitle">
{{title}}
</h4>
<p>
{{authors}}
<br>
<span class="font-italic">{{affiliations}}</span>
</p>
</li>
{{/each}}
</ol>
</script>
</main>
<?php include "includes/footer.php";?>
<!-- Handlebars -->
<script src="https://iacr.org/libs/js/handlebars/handlebars-v4.1.0.js" type="text/javascript"></script>
<script>
try {
fetch('json/papers.json',
{credentials: 'same-origin'})
.then(response => {
console.dir(response);
console.dir(response.status);
if (response.ok && response.status == 200) {
return response.json();
}
})
.then(data => {
if (data) {
var theTemplateScript = $("#acceptedScript").html();
var theTemplate = Handlebars.compile(theTemplateScript);
var theCompiledHtml = theTemplate(data);
$('#accepted').html(theCompiledHtml);
$('#notYetAvailable').hide();
}
})
.catch((e) => {
console.log('an error occurred');
$('#jsonWarning').removeClass('d-none');
console.dir(e);
});
} catch (error) {
console.dir(error);
$('jsonWarning').html('The server is failing or your browser is not supported.');
$('#jsonWarning').removeClass('d-none');
}
</script>
</body>
</html>