-
Notifications
You must be signed in to change notification settings - Fork 6
/
apply.html
237 lines (191 loc) · 9.3 KB
/
apply.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Peace Corps Opportunities</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
<!-- Custom CSS for the 'One Page Wonder' Template -->
<link href="css/one-page-wonder.css" rel="stylesheet">
<link href="css/modern-business.css" rel="stylesheet">
<link href="css/custom.css" rel="stylesheet">
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "0632f4ec-e15d-41e8-b4e1-eaee53a4038b", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- You'll want to use a responsive image option so this logo looks good on devices - I recommend using something like retina.js (do a quick Google search for it and you'll find it) -->
<a class="navbar-brand" href="index.html">Peace Corps Opportunities Portal</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="about.html">About</a></li>
<li><a href="explore.html">Explore</a></li>
<li><a href="apply.html">Apply</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container -->
</nav>
<div class="container">
<div class="col-lg-3"> </div><!-- end of col-lg-3 -->
<div class="col-lg-6">
<div class="starter-template">
<h1>PeaceCorps Opportunity Search</h1>
<p>Use this form to find PeaceCorp opportunities related to your interests.If you have a clear idea of the projects you want to work on, you can start picking categories you are interested in. You can also explore all the opportunities by not choosing anything and clicking on submit.</p>
</div>
<h3> Choose your country: </h3>
<div class="pref">
<div class="col-lg-6">
<input class="prefplace" type="checkbox" value="Albania">Albania<br>
<input class="prefplace" type="checkbox" value="Armenia">Armenia<br>
<input class="prefplace" type="checkbox" value="Azerbaijan">Azerbaijan<br>
<input class="prefplace" type="checkbox" value="Belize">Belize<br>
<input class="prefplace" type="checkbox" value="Benin">Benin<br>
<input class="prefplace" type="checkbox" value="Burkina Faso">Burkina Faso<br>
<input class="prefplace" type="checkbox" value="Botswana">Botswana<br>
</div>
<div class="col-lg-6">
<input class="prefplace" type="checkbox" value="Cambodia">Cambodia<br>
<input class="prefplace" type="checkbox" value="Cameroon">Cameroon<br>
<input class="prefplace" type="checkbox" value="China">China<br>
<input class="prefplace" type="checkbox" value="Colombia">Colombia<br>
<input class="prefplace" type="checkbox" value="Costa Rica">Costa Rica<br>
<input class="prefplace" type="checkbox" value="Dominican Republic">Dominican Republic<br>
</div>
</div><!-- end of pref -->
<h3> Choose your sector: </h3>
<div class="pref">
<div class="col-lg-6">
<input class="prefsector" type="checkbox" value="Education" id="sector_education"><label for="sector_education">Education </label><br>
<input class="prefsector" type="checkbox" value="Agriculture" id="sector_agriculture"><label for="sector_agriculture">Agriculture </label><br>
<input class="prefsector" type="checkbox" value="Business" id="sector_business"><label for="sector_business">Business </label><br>
</div>
<div class="col-lg-6">
<input class="prefsector" type="checkbox" value="Environment" id="sector_environment"><label for="sector_environment">Environment </label><br>
<input class="prefsector" type="checkbox" value="Health" id="sector_health"><label for="sector_health">Health </label><br>
<input class="prefsector" type="checkbox" value="Youth" id="sector_youth"><label for="sector_youth">Youth</label><br>
</div>
</div><!-- end of pref -->
<div class="col-lg-12">
<div class="btn-group">
<button id="sendpref" type="button" class="btn btn-default">Submit</button>
</div>
</div>
<hr/>
<div class="result-panel panel panel-default" style="display:none;">
<!-- Default panel contents -->
<div class="panel-heading">Results</div>
<!-- Table -->
<div class="result-table">
</div>
</div>
</div>
<div class="col-lg-3"> </div><!-- end of col-lg-3 -->
<!-- FOOTER -->
<div class="col-lg-12">
<footer>
<hr>
<p>Copyright © Peace Corps 2014</p>
<span class='st_facebook_large' displayText='Facebook'></span>
<span class='st_twitter_large' displayText='Tweet'></span>
<span class='st_email_large' displayText='Email'></span>
</footer>
</div><!-- end of col-log-12 -->
<!-- /END OF FOOTER -->
</div><!-- /.container -->
<!-- Modal -->
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel"></h3>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<!--
<button type ="button" class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
<button type="button" class="btn btn-primary" href="http://www.peacecorps.gov/">Apply</button>
-->
<span class='st_facebook_large' displayText='Facebook'></span>
<span class='st_twitter_large' displayText='Tweet'></span>
<span class='st_email_large' displayText='Email'></span>
<a href="http://www.peacecorps.gov/apply/" class="btn btn-primary btn-lg active" role="button">Apply</a>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="./js/jquery-1.10.2.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script>
var result_data = {};
var country = "";
var sector = "";
$("#sendpref").click(function(){
//var country = "";
$(".prefplace:checked").each(function(i){
if(country==""){
country = $(this).val();
} else
{
country = country + "+" + $(this).val();
}
//var sector = "";
$(".prefsector:checked").each(function(i){
if(sector==""){
sector = $(this).val();
} else
{
sector = sector + "+" + $(this).val();
}
})
console.log(sector);
});
console.log(country);
$.getJSON("http://idhack.iis-dev.seas.harvard.edu/get_jobs?callback=?",{"location":country,"sector":sector},function(result){
console.log(result);
//var result_html = "<div class='result-table-row'><div class='result-table-header'>#</div><div class='result-table-header'>Title</div></div>";
var result_html = "";
for (obj in result.data){
// display link
var functiontext = 'displayDetail("' + result.data[obj]["REQ ID"] + '")';
result_html += "<a href='#myModal' data-toggle='modal' onclick='" + functiontext + "' ><div class='result-table-row'><div class='result-table-cell-1'>" + result.data[obj]["REQ ID"] + "</div><div class='result-table-cell-2'>" + result.data[obj]["title"] + "</div></div></a> ";
// create object
result_data[result.data[obj]["REQ ID"]] = result.data[obj];
}
$(".result-panel").show();
$(".result-table").html(result_html);
});
});
// end submit search
function displayDetail(req_id) {
console.log(req_id);
console.log(result_data[req_id]);
var result = result_data[req_id];
var detailHtml = "";
//detailHtml += "<h1>"+ req_id + "</h1>";
$("#myModalLabel").html("<h3>"+ result.title + "</h3>");
detailHtml += "<h4> Location: </h4> <p>"+ result.location + "</p>";
detailHtml += "<h4> Sector: </h4> <p>" + result.sector + "</p>";
detailHtml += "<h4> Project Description: </h4> <p>"+result.proj_desc+"</p>";
//detailHtml += "<h3>"+ result.proj_desc +"</h3>";
$(".modal-body").html(detailHtml);
}
</script>
</body></html>