Commit b7650177 authored by Porter Libby's avatar Porter Libby
Browse files

generalize content population

parent f7530aa8
......@@ -29,14 +29,16 @@
<link rel="stylesheet" href="public/css/input.css">
<link rel="stylesheet" href="public/css/modal.css">
<link rel="stylesheet" href="public/css/main.css">
<!-- LOCAL DATA -->
<script src="public/data/data.js"></script>
<!-- LOCAL JS -->
<script src="public/js/index.js"></script>
<script src="public/js/populate.js"></script>
<script src="public/js/searchBar.js"></script>
<script src="public/js/modal.js"></script>
<!-- LOCAL DATA -->
<script src="public/data/data.js"></script>
</head>
<body>
......@@ -186,44 +188,24 @@
<div class='block' id="block2">
<span class='section-prompt'>2. Pursue a passion project</span>
<div id='radio-form-container' style='position:absolute;'>
<form id='radio-form'>
<input type="radio" id="1" name="gender" value="entrepreneurship_innovation" onchange="section_two(this.value)">
<label for="1">Center for Entrepreneurship & Innovation</label><br>
<input type="radio" id="2" name="gender" value="environmental_leadership" onchange="section_two(this.value)">
<label for="2">Center for Environmental Leadership</label><br>
<input type="radio" id="3" name="gender" value="global_health" onchange="section_two(this.value)">
<label for="3">Center for Global Health</label><br>
<input type="radio" id="4" name="gender" value="social_justice" onchange="section_two(this.value)">
<label for="4">Center for Social Justice</label>
</form>
<form id='radio-form-2'> </form>
</div>
</div>
<!-- Block 3 -->
<div class='block' id="block3">
<span class='section-prompt'>3. Access opportunities</span>
<br>
<div class='inner-nav'> <!-- Nav options for this block -->
<button type="button" class="btn btn-labeled btn-dark">
<span class="btn-label"><i class="fa fa-flask"></i></span><br>Research</button>
<button type="button" class="btn btn-labeled btn-dark">
<span class="btn-label"><i class="fa fa-user-md"></i></span><br> Internship</button>
<button type="button" class="btn btn-labeled btn-dark">
<span class="btn-label"><i class="fa fa-book"></i></span><br> Off-campus Study</button>
<div id='radio-form-container' style='position:absolute;'>
<form id='radio-form-3'> </form>
</div>
</div>
<!-- Block 4 -->
<div class='block' id="block4">
<span class='section-prompt'>4. Explore ways forward</span>
<br>
<div class='inner-nav'> <!-- Nav options for this block -->
<button type="button" class="btn btn-labeled btn-dark btn-explore">
<span class="btn-label"><i class="fa fa-globe"></i></span><br> Explore</button>
<div id='radio-form-container' style='position:absolute;'>
<form id='radio-form-4'> </form>
</div>
</div>
......
......@@ -307,7 +307,7 @@ var dictionary = {
'entrepreneurship_innovation' : [
"",
"The Center for Entrepreneurship and Innovation helps students connect business to the social good. Join the EPIC Grand Challenge, where you’ll build a plan to impact 25,000 people in the Richmond area in the areas of neighborhood development, employability, and community development. Or get involved with our campus chapter of Net Impact, a student organization that serves as a leadership accelerator for future changemakers.",
"Entrepreneurship Innovation",
"Center for Entrepreneurship & Innovation",
"https://www.youtube.com/embed/OFXvx_QAbX4?list=PLLskAD3RU43XcMiIvtAEOnTHh0Zdp33N1"
],
'environmental_leadership' : [
......
function section_two(val){ // load info for section two based on value
var url = dictionary["passion project"][val][0];
var desc = dictionary["passion project"][val][1];
var title = dictionary["passion project"][val][2];
var video = dictionary["passion project"][val][3];
console.log(dictionary["passion project"])
var url = dictionary["passion_project"][val][0];
var desc = dictionary["passion_project"][val][1];
var title = dictionary["passion_project"][val][2];
var video = dictionary["passion_project"][val][3];
open_modal()
set_modal_text(url,desc,title,video)
}
......
// For populating each section with information from DATA.JS
$(document).ready(function() { // populate when document is loaded
// SECTION 2
var form = document.getElementById('radio-form-2');
var count = 0;
for (property in dictionary["passion_project"]) {
// for each item in passion project section, create a form element
count++;
form.innerHTML += '<input type="radio" id="' + count + '" name="passion-project" value="' + property + '" onchange="section_two(this.value)">';
form.innerHTML += '<label for="' + count + '">' + dictionary["passion_project"][property][2] + '</label><br>';
}
// SECTION 3
var form = document.getElementById('radio-form-3');
var count = 0;
for (property in dictionary["access_opportunities"]) {
// for each item in passion project section, create a form element
count++;
form.innerHTML += '<input type="radio" id="' + count + '" name="access_opportunities" value="' + property + '" onchange="section_two(this.value)">';
form.innerHTML += '<label for="' + count + '">' + dictionary["access_opportunities"][property][2] + '</label><br>';
}
// SECTION 4
var form = document.getElementById('radio-form-4');
var count = 0;
for (property in dictionary["ways_forward"]) {
// for each item in passion project section, create a form element
count++;
form.innerHTML += '<input type="radio" id="' + count + '" name="ways_forward" value="' + property + '" onchange="section_two(this.value)">';
form.innerHTML += '<label for="' + count + '">' + dictionary["ways_forward"][property][2] + '</label><br>';
}
});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment