forked from broadstone/PAXSignatureGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.jsp
105 lines (99 loc) · 4.43 KB
/
index.jsp
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
<!--
@author: Mike Burgess (MetricalSky)
@date: 2016 September 10
-->
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>PAX Signature Generator</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet"/>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"/>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"/>
<![endif]-->
</head>
<body>
<div class="container">
<h1>PAX Signature Generator</h1>
<c:forEach items="${applicationScope['paxen']}" var="pax">
<div class="panel panel-default">
<div class="panel-heading">${pax.displayName}</div>
<div class="panel-body">
<div class="btn-group" data-toggle="buttons">
<c:forEach items="${pax.years}" var="year">
<label class="btn btn-default"><input type="checkbox" class="paxselect" autocomplete="off" data-pax="${pax.name}">${year}</label>
</c:forEach>
</div>
</div>
</div>
</c:forEach>
<form method="POST" action="signature.png">
<div class="panel panel-primary">
<div class="panel-heading">My PAX</div>
<table class="table table-striped table-bordered table-responsive">
<tbody id="my-pax">
</tbody>
</table>
<div class="panel-footer clearfix">
<label class="btn btn-default">Wrap:
<select name="wrap">
<option value="nowrap">No Wrap</option>
<c:forEach begin="1" end="20" varStatus="loop">
<option value="${loop.index}">${loop.index}</option>
</c:forEach>
</select>
</label>
<label class="btn btn-default">
<input type="checkbox" autocomplete="off" name="upload">(beta) Upload to imgur?</label>
<button type="submit" class="btn btn-primary pull-right">Generate!</button>
</div>
</div>
</form>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script>
// add or remove My PAX rows as the above year checkboxes are toggled
$('input:checkbox.paxselect').change(function() {
var paxid = $(this).data('pax') + $(this).parent().text();
if ($(this).is(':checked')) {
$('#my-pax').append(
'<tr id="' + paxid + '">' +
'<td>' + paxid + '</td>' +
'<td>' +
'<input type="hidden" name="Year[]" value="' + $(this).parent().text() + '"/>' +
'<input type="hidden" name="PAX[]" value="' + $(this).data('pax') + '"/>' +
'<select class="form-control" name="Badge[]">' +
<c:forEach items="${applicationScope['badgetypes']}" var="type">
'<option value="${type.name}">${type.displayName}</option>' +
</c:forEach>
'</select>' +
'</td>' +
'<td>' +
'<div class="btn-group" data-toggle="buttons">' +
'<label class="btn btn-default"><input type="checkbox" name="future[]" class="future-pax"/>Future PAX?</label>' +
'</div>' +
'</td>' +
'</tr>');
} else {
$('#' + paxid).remove();
}
// reset the values of the Future PAX checkboxes to match their index
$('.future-pax').each(function(index) {
$(this).attr('value', index);
})
})
</script>
</body>
</html>