-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathticket.html
123 lines (111 loc) · 5.17 KB
/
ticket.html
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
115
116
117
118
119
120
121
122
123
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ticket · The Nottingham New Theatre</title>
<meta name="description" content="The Nottingham New Theatre is England's only fully student-run theatre producing over 30 productions annually across two venues.">
<meta property="og:image" content="https://newtheatre.org.uk/images/logos/nnt_squares.png">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,400italic,600|Montserrat:400,500,600,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/css/main.css?cachebust=202412011755">
<link rel="canonical" href="/ticket" data-proofer-ignore>
<link rel="shortcut icon" type="image/x-icon" href="/static/images/favicon.png" />
<link rel="author" href="/humans.txt" />
<!-- JQuery -->
<script
src="https://code.jquery.com/jquery-3.3.1.js"
integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.min.js" integrity="sha384-a5N7Y/aK3qNeh15eJKGWxsqtnX/wWdSZSKp+81YjTmS15nvnvxKHuzaWwXHDli+4" crossorigin="anonymous"></script>
<!-- FontAwesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-724643-13"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-724643-13');
</script>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-5">
<img class="img-fluid vh-100" alt="Show poster" id="show_poster" src="https://ticketing.newtheatre.org.uk/static/images/no_image.png" />
</div>
<div class="col text-center align-center">
<img src="/static/images/logos/nt_logo-web.png" class="img-fluid my-4" alt="New Theatre Logo" />
<div id="whats-on"></div>
</div>
</div>
</div>
<script>
$( document ).ready(function() {
$.getJSON("https://ticketing.newtheatre.org.uk/api/shows/").done(function(data){
var the_show = data.results[0];
var show_html = '';
show_html = show_html + '<h1 class="display-2 mb-4">' + the_show.name + '</h1>';
if (the_show.runtime){
show_html += '<h2 class="display-4 my-4"><em>' + the_show.runtime + ' minutes, with'
if (the_show.interval_number > 0){
show_html += ' ' + the_show.interval_number
if (the_show.interval_number > 1){ show_html += ' intervals' }
if (the_show.interval_number == 1){ show_html += ' interval' }
}
else {
show_html += 'out interval'
}
show_html += '</em></h2>';
}
// Todo: Sort warnings alphabetically?
if (the_show.warnings_technical[0] || the_show.warnings_action[0] || the_show.warnings_dialogue[0]) {
show_html += '<h1 class="my-4">Please note, this show contains ';
for (var i = 0; i < the_show.warnings_technical.length; i++) {
show_html += the_show.warnings_technical[i].title.toLowerCase()
if (i < the_show.warnings_technical.length - 1) {
show_html += ', '
}
else if (i == the_show.warnings_technical.length - 1 && the_show.warnings_action[0] || the_show.warnings_dialogue[0]) {
show_html += '; '
}
}
if (the_show.warnings_action[0]) {
show_html += 'scenes featuring '
for (var i = 0; i < the_show.warnings_action.length; i++) {
show_html += the_show.warnings_action[i].title.toLowerCase()
if (i < the_show.warnings_action.length - 1) {
show_html += ', '
}
else if (i == the_show.warnings_action.length - 1 && the_show.warnings_dialogue[0]) {
show_html += '; '
}
}
}
if (the_show.warnings_dialogue[0]) {
show_html += 'discussions/themes of '
for (var i = 0; i < the_show.warnings_dialogue.length; i++) {
show_html += the_show.warnings_dialogue[i].title.toLowerCase()
if (i < the_show.warnings_dialogue.length - 1) {
show_html += ', '
}
}
}
}
else {
show_html += 'There are no warnings for this show'
}
show_html += '.</h1>';
document.getElementById('whats-on').innerHTML = show_html;
if (the_show.small_poster != null){
document.getElementById('show_poster').src = the_show.small_poster;
}
}).fail(function(){
document.getElementById('whats-on').innerHTML = "Unable to load shows";
});
});
</script>
</body>
</html>