Difference between revisions of "Dev/Awards2"

Line 88: Line 88:
 
$(document).ready(function() {
 
$(document).ready(function() {
  
// to use this function send the "source page" and then send the div's id to where you want to send it
 
  
 +
// awards
 +
 +
var awards_set = [
 +
{'award':'Best Diagnostics Project, Overgrad','team_name':'Pasteur Paris','section':'overgrad'},
 +
{'award':'Nominated for Best Diagnostics Project, Overgrad','team_name':'Pasteur Paris','section':'overgrad'},
 +
{'award':'Best Diagnostics Project','team_name':'INSA-Lyon','section':'undergrad'},
 +
{'award':'Nominated for Best Diagnostics Project','team_name':'INSA-Lyon','section':'undergrad'},
 +
{'award':'Nominated for Best Diagnostics Project','team_name':'NCKU Tainan','section':'undergrad'},
 +
{'award':'Nominated for Best Diagnostics Project','team_name':'NUS Singapore','section':'undergrad'},
 +
{'award':'Nominated for Best Diagnostics Project','team_name':'Sheffield','section':'undergrad'},
 +
{'award':'Best Energy Project','team_name':'Nanjing-China','section':'underover'},
 +
{'award':'Nominated for Best Energy Project','team_name':'Nanjing-China','section':'underover'},
 +
{'award':'Nominated for Best Energy Project','team_name':'UESTC-China','section':'underover'},
 +
{'award':'Best Environment Project, Overgrad','team_name':'TJUSLS China','section':'overgrad'},
 +
{'award':'Nominated for Best Environment Project, Overgrad','team_name':'BGU ISRAEL','section':'overgrad'},
 +
{'award':'Nominated for Best Environment Project, Overgrad','team_name':'Ionis Paris','section':'overgrad'},
 +
{'award':'Nominated for Best Environment Project, Overgrad','team_name':'TJUSLS China','section':'overgrad'},
 +
];
 +
 +
 +
// to use this function send the "source page" and then send the div's id to where you want to send it
  
 
load_these_items ( "https://2017.igem.org/Dev/Awards #demo_gold",  "gold_medals");
 
load_these_items ( "https://2017.igem.org/Dev/Awards #demo_gold",  "gold_medals");
Line 97: Line 117:
 
});
 
});
  
 
function load_these_items ( source_page , destination_div ) {
 
  
  
 +
//wrap medals in a hrefs
 +
function load_these_items ( source_page , destination_div ) {
 
$("#"+destination_div ).load( source_page , function() {   
 
$("#"+destination_div ).load( source_page , function() {   
 
 
 
$( "li" ).each(function( index ) {
 
$( "li" ).each(function( index ) {
 
+
$(this).wrap( "<a href=\'https://2017.igem.org/Team:" + $( this ).text() + "\'>"  );
$(this).wrap( "<a href=\'https://2017.igem.org/Team:" + $( this ).text() + "\'>"  );
+
+
 
});
 
});
 
});
 
});
 
}
 
}
 +
 +
 +
 +
 +
  
  

Revision as of 20:39, 6 November 2017

MENU

Awards demo

AWARDS

GOLD

SILVER

BRONZE