Skip to content
This repository was archived by the owner on Jun 9, 2020. It is now read-only.

Commit 6287eb0

Browse files
committed
Update waiver, age of majority
1 parent d1dff34 commit 6287eb0

File tree

3 files changed

+136
-32
lines changed

3 files changed

+136
-32
lines changed

app/Http/Controllers/Vip/IndexController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,13 @@ public function getSurvey()
8383

8484
public function getWaiver()
8585
{
86-
$url = $this->ticket->getSigningLink();
8786
if ($this->ticket->waiver_pdf !== null) {
88-
return \Redirect::to('/'.$this->ticket->id);
87+
return \Redirect::to($this->ticket->waiver_pdf);
8988
}
9089

91-
return \View::make('vip/waiver', ['url' => $url]);
90+
$waiverContent = file_get_contents(sprintf('https://srnd-cdn.net/codeday/waiver-%sminor.html', ($this->ticket->is_minor ? '' : 'non')));
91+
92+
return \View::make('vip/waiver', ['waiver_content' => $waiverContent]);
9293
}
9394

9495
public function getSyncwaiver()

resources/views/vip/parent.twig

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,25 @@
1010
<input type="number" name="age" id="age" value="{{ ticket.age }}" required />
1111
<span class="help">Your age on {{ ticket.event.starts_at|date('F j, Y') }}.</span>
1212
</div>
13-
{% elseif ticket.age >= 18 %}
13+
{% elseif not ticket.is_minor %}
1414
{% if ticket.age > 25 %}
1515
<div class="warning">
1616
<p><strong>Hey! There might be a problem:</strong> CodeDay is mostly targeted to high school students.</p>
1717
<p>For security reasons, we cannot accept attendees who are older than 25. (In the past, older students
1818
generally had a bad time, anyway.)</p>
1919
<p>Please <a href="mailto:{{ ticket.event.webname }}@codeday.org">contact us</a> for a refund.</p>
2020
</div>
21+
{% elseif ticket.age > 22 %}
22+
<div class="warning">
23+
<p><strong>Heads-up:</strong> most CodeDay attendees will be in high school.</p>
24+
<p>You're welcome to attend, and you'll probably still have a good time, just be aware that a
25+
a lot of attendees will be younger than you.</p>
26+
</div>
2127
{% endif %}
2228
<div class="field">
2329
<label>Parent Info</label>
2430
<div class="group">
25-
Because you're over 18, we don't need your parent info. If you need to change your age, please
31+
Because you're not a minor, we don't need your parent info. If you need to change your age, please
2632
<a href="mailto:{{ ticket.event.webname }}@codeday.org">contact us.</a>
2733
</div>
2834
</div>
@@ -40,6 +46,13 @@
4046
<p>If you have more questions, or would like a refund, please
4147
<a href="mailto:{{ ticket.event.webname }}@codeday.org">contact us</a>.</p>
4248
</div>
49+
{% elseif ticket.age < 14 %}
50+
<div class="warning">
51+
<p><strong>Heads-up:</strong></p>
52+
<p>The overnight portion of CodeDay isn't ideal for younger students. We recommend
53+
you pick your student up around 10pm, and drop them back off for presentations at 8am
54+
the next morning.</p>
55+
</div>
4356
{% endif %}
4457
<div class="field">
4558
<label for="age">Age</label>

resources/views/vip/waiver.twig

Lines changed: 117 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,122 @@
88
{% block nav %}<nav><ul><li><a href="/{{ ticket.id }}">{{ ticket.name }}</a></li></ul></nav>{% endblock %}
99
{% block content %}
1010
<section class="waiver" id="waiver">
11-
<p>If you have any problems signing your waiver, you can
12-
<a href="https://srnd-cdn.net/codeday/waiver.pdf" target="_blank">print and sign,</a> however you will need
13-
to use the slow line at check-in.</p>
14-
<iframe src="{{ url }}?hidenav=1&hidetext=1"></iframe>
15-
<section class="notice">
16-
<section class="esign">
17-
<p>To submit this document online, you must agree to our e-signature policy as follows: This is a legally
18-
binding document. You must be 18 or older to sign, and must be either the attendee, or the attendee's
19-
parent or other legal guardian. We will store this document on our servers for a period of no less
20-
than four years, and email you a copy which you will be responsible for retaining.</p>
21-
</section>
22-
<section class="powered">
23-
<a href="https://legalesign.com/"><img src="/assets/img/legalesign_powered.png" /></a>
24-
</section>
25-
</section>
11+
12+
<style>
13+
@import url("https://srnd.org/assets/fonts/avenir-next.css");
14+
.page {
15+
width: 720pt;
16+
padding: 0.5in;
17+
background-color: $color-white;
18+
border: 1px solid gray;
19+
font-family: 'Avenir Next', Helvetica, Arial, sans-serif;
20+
}
21+
.page, .page p, .page li, .page blockquote, .page strong, .page h1, .page h2 {
22+
font-size: 12pt;
23+
line-height: 18pt;
24+
}
25+
.page h2 {
26+
font-weight: 700;
27+
margin-top: 3rem;
28+
}
29+
.page strong {
30+
font-weight: 600;
31+
}
32+
.page header img {
33+
float: left;
34+
width: 50pt;
35+
height auto;
36+
}
37+
.page header h1 {
38+
float: left;
39+
padding-left: 2rem;
40+
font-weight: 700;
41+
margin-top: 0.2em;
42+
}
43+
.page header:after {
44+
content: "";
45+
display: block;
46+
clear: both;
47+
}
48+
.c-forms-heading {
49+
display: none !important;
50+
}
51+
.c-forms-form label, .c-forms-form input[type="text"], .c-content {
52+
font-family: 'Avenir Next', Helvetica, Arial, sans-serif !important;
53+
font-size: 12pt !important;
54+
font-weight: 500;
55+
}
56+
.c-forms-form input[type="text"], .c-content {
57+
border-bottom: 1pt solid #ccc !important;
58+
font-style: italic !important;
59+
}
60+
.c-text-singleline input {
61+
position: relative;
62+
top: -17pt;
63+
}
64+
.c-calculation-singleline .c-content {
65+
position: relative;
66+
top: -9pt;
67+
}
68+
.c-text-singleline label, .c-calculation-singleline label {
69+
position: relative;
70+
top: 26pt
71+
}
72+
.c-label:after {
73+
display: none !important;
74+
}
75+
.c-signature .c-editor {
76+
position: relative;
77+
top: -14pt;
78+
}
79+
.c-signature label {
80+
position: relative;
81+
top: 100pt;
82+
z-index: 100;
83+
}
84+
.cognito > div {
85+
width: 0;
86+
height: 0;
87+
overflow: hidden;
88+
}
89+
</style>
90+
<div class="page" style="display:none">
91+
<header>
92+
<img src="https://srnd.org/assets/img/logo.svg" />
93+
<h1>PARTICIPANT AGREEMENT, WAIVER, and RELEASE of LIABILITY</h1>
94+
</header>
95+
{{ waiver_content|raw }}
96+
<div class="cognito">
97+
<script src="https://services.cognitoforms.com/s/7hYXr3TPxk6yIpJxjqVoFQ"></script>
98+
<script>Cognito.load("forms", { id: "5", entry: {
99+
"Ticket": "{{ ticket.id|escape('js') }}",
100+
"ParticipantName": "{{ ticket.name|escape('js') }}",
101+
"Minor": "{% if ticket.is_minor %}yes{% else %}no{% endif %}",
102+
"EventName": "CodeDay",
103+
"SignerEmail": "{% if ticket.is_minor %}{{ ticket.parent_email|escape("js") }}{% else %}{{ ticket.email|escape("js") }}{% endif %}",
104+
{% if ticket.is_minor %}
105+
"Relationship": "Parent",
106+
{% endif %}
107+
}}, {
108+
success: function() {
109+
document.querySelector(".page").style.display = "block";
110+
ExoJQuery(function() {
111+
ExoJQuery(document).on('afterSubmit.cognito', function(data) {
112+
document.querySelector(".page").style.display = "none";
113+
document.querySelector(".alternative").style.display = "none";
114+
document.querySelector(".success").style.display = "block";
115+
});
116+
});
117+
}
118+
});</script>
119+
</div>
120+
</div>
121+
<div class="alternative">
122+
<p>If you have any problems signing your waiver, you can
123+
<a href="https://srnd-cdn.net/codeday/waiver-{%if not ticket.is_minor %}non{% endif %}minor.pdf" target="_blank">print and sign.</a></p>
124+
</div>
125+
<div class="success" style="display: none">
126+
<p>Thanks, your waiver has been successfully signed! You can download a copy at any time from your ticket page. <a href="/{{ticket.id}}">Click here to return to it.</a></p>
127+
</div>
26128
</section>
27129
{% endblock %}
28-
{% block scripts %}
29-
<script type="text/javascript">
30-
{% if ticket.age < 18 %}alert("Please get your parent to sign this waiver.");{% endif %}
31-
window.addEventListener("message", function (event) {
32-
var origin = event.origin || event.originalEvent.origin;
33-
if (origin !== "https://app.legalesign.com") return;
34-
if (event.data != "signed") return;
35-
document.getElementById('waiver').innerHTML = "<p>Please wait...</p>";
36-
window.location.href = "syncwaiver";
37-
}, false);
38-
</script>
39-
{% endblock %}

0 commit comments

Comments
 (0)