Difference between revisions of "Sitemap"

 
(198 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Main2017}}
 
{{Main2017}}
 
<html>
 
<html>
 +
<link rel="stylesheet" type="text/css" href="https://igem.org/wiki/index.php?title=HQ:Sitemap.css&action=raw&ctype=text/css" />
 +
<script src="https://igem.org/wiki/index.php?title=HQ:Sitemap.js&action=raw&ctype=text/javascript"></script>
  
<div class="column full_width" >
 
<h1> Sitemap </h1>
 
<p> iGEM is a multifaceted competition with many different components. Our websites have a lot of information, from requirements of the competition to tips on how make fundraising easier. This page is here to help you navigate our site and make sure you have access to all of its content. </p>
 
</div>
 
  
<div class="column half_size multiple_links">
+
<script>
<h2> iGEM 2017 wiki pages </h2>
+
<ul  id="organized_pages">
+
  
</ul>
+
var site_name = "2017.igem.org";
  
</div>
+
</script>
  
  
 +
<div class="column full_size" >
 +
<h1>SITEMAP </h1>
 +
<p> iGEM is a multifaceted competition with many different components. Our websites have a lot of information, from requirements of the competition to tips on how make fundraising easier. This page is here to help you navigate our site and make sure you have access to all of its content. </p>
 +
</div>
  
<div class="column half_size multiple_links">
 
<h2> Wiki in numbers </h2>
 
  
<table>
 
<tr>
 
<th> Total pages </th> <th> Wiki pages </th> <th> HQ pages </th> <th> Redirect pages </th>  <th> Not sorted </th> <th> Team pages </th>
 
</tr>
 
  
<tr>
 
<td id="total_pages_count"></td>
 
<td id="wiki_pages_count"> </td>
 
<td id="hq_pages_count"></td>
 
<td id="redirect_pages_count"></td>
 
<td id="not_sorted_pages_count"></td>
 
<td id="team_pages_count"></td>
 
</tr>
 
  
  
</table>
 
  
</div>
 
  
 +
<!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
  
  
  
<div class="column fourth_size multiple_links" >
 
<h2> HQ pages </h2>
 
<ul id="HQ">
 
</ul>
 
  
</div>
 
  
<div class="column fourth_size multiple_links" >
+
<div class="column full_size">
<h2> Redirects </h2>
+
<div class="view_format selected_view" id="list_view"> PAGE LIST </div>
<ul id="redirect">
+
<div class="view_format" id="team_view"> TEAM PAGES </div>
</ul>
+
<div class="view_format HQ_info" id="hq_view"> HQ </div>
 
</div>
 
</div>
  
  
  
<div class="column half_size multiple_links" >
+
<div class="clear"></div>
<h2> Not sorted </h2>
+
<ul id="not_sorted">
+
</ul>
+
  
</div>
 
  
 +
<!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
  
  
 +
<div class="column full_size multiple_links  view_format_content selected_content" id="list_view_content">
 +
<h2> LIST </h2>
  
 
+
<ol  id="organized_pages">
 
+
<div class="clear"></div>
+
 
+
<div class="column half_size multiple_links" >
+
<h2> All pages </h2>
+
<ol  id="all_pages">
+
  
 
</ol>
 
</ol>
Line 79: Line 52:
 
</div>
 
</div>
  
 +
<!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
  
<script>
 
  
$(document).ready(function() {
 
  
  
//load the list of pages from the wiki special pages
+
<div class="view_format_content" id="team_view_content">
 +
<div class = "column full_size">
 +
<h2> TEAMS </h2>     
 +
</div>
  
$("#all_pages").load( "https://2017.igem.org/Special:AllPages .mw-allpages-chunk", function() {
+
<div class="column half_size">
 +
<ol id="team_list">
 +
</ol>
 +
</div>
  
$('ul.mw-allpages-chunk li').each(function () {
 
//sort each page
 
console.log( $(this).text(),  $(this).html() );
 
sort_pages( $(this).text(),  $(this).html() ); 
 
});
 
  
// place total number of pages in each category
+
<div class="column half_size">
$("#wiki_pages_count").html( $("#organized_pages li").size() );
+
<p class="loading"> Loading all team pages... </p>
$("#total_pages_count").html( $("#all_pages li").size() );
+
</div>
$("#hq_pages_count").html( $("#HQ li").size() );
+
</div>
$("#redirect_pages_count").html( $("#redirect li").size() );
+
$("#not_sorted_pages_count").html( $("#not_sorted li").size() );
+
  
});
 
  
  
 +
<!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
  
});
 
  
 +
<div class="HQ_info">
 +
<div class="column full_size view_format_content"  id="hq_view_content">
  
 +
<h2> HQ </h2>
 +
<p> This is the view for iGEM HQ </p>
  
  
function sort_pages ( page_name , page_link ) {
 
  
// these variables will be used in some of the functions bellow - they show variations of page_name for #id purposes
+
<table>
var clean_name = page_name.replace( /\//g , "-");
+
<tr>
var no_underscores_name = page_name.replace( /_/g , " ");
+
<th> Total pages </th> <th> Wiki pages </th> <th> HQ pages </th> <th> Redirect pages </th>  <th> Not sorted </th> <th> Team pages </th>
 +
</tr>
  
+
<tr align="center">
if ( is_it_a_special_page ( page_name, page_link ) == false ) {   // check if a page is a redirect
+
<td id="total_pages_count">   <p class="loading"> ... </p>  </td>
+
<td id="wiki_pages_count"> <p class="loading"> ... </p> </td>
 +
<td id="hq_pages_count">  <p class="loading"> ... </p> </td>
 +
<td id="redirect_pages_count"> <p class="loading"> ... </p> </td>
 +
<td id="not_sorted_pages_count"> <p class="loading"> ... </p></td>
 +
<td id="team_pages_count">  <p class="loading"> ... </p> </td>
 +
</tr>
  
page_name = page_name.replace(/ /g,"_").replace(/:/g, "_");  // clean string from empty spaces
 
  
 +
</table>
  
switch  ( (page_name.match( /\//g ) || []).length  ) {  // check how many "tiers" (  /  ) the page name has in order to nest it
 
  
case 0:  // this might be a hub or an unassigned page
+
<div class="column half_size">
append_tier_one ( page_name, no_underscores_name) ;
+
break;
+
  
case 1: //this page is likely to have a hub to append to
+
<h3> HQ pages </h2>
append_tier_two ( page_name, no_underscores_name, clean_name  ); 
+
break;
+
  
case 2: //this page might be a subpage inside a page in a hub list
+
<ol id="HQ">
append_tier_three ( page_name, no_underscores_name, clean_name ); 
+
</ol>
break;
+
</div>
  
case 3: //this page might be a subpage inside a page in a hub list
+
<div class="column half_size">
append_to_not_sorted  (page_name );
+
<h3> Redirects </h3>
break;
+
<ol id="redirect">
}
+
</ol>
  
}
 
  
+
<h3> Not Sorted </h3>
}
+
<ol id="not_sorted">
 +
</ol>
  
 +
</div>
  
//Function to check if the page is a redirect ( a non existing page)
+
</div>
function is_it_a_special_page ( page_name, page_link ) {
+
</div>
 
+
// is it a HQ page or a Dev page ?
+
if( page_name.substring(0, 2 ) == "HQ"  ||  page_name.substring(0, page_name.indexOf("/") ) == "Dev" ) {
+
$("#HQ").append("<li ><a  href='/"+page_name+"'>"+page_name +"</a> </li>");
+
return true;
+
}
+
 
+
 
+
// is this a page from a team ?
+
else if ( page_name.substring(0, 4 ) == "Team") {
+
return true;  // page is from a team - we will figure out what to do later
+
}
+
+
// is it a redirect?
+
else if( page_link.indexOf("mw-redirect") >= 0)  {
+
$("#redirect").append("<li >"+ page_link+"</li>" );
+
return true;
+
}
+
 
+
// this page is not a special case, let's sort it!
+
else {
+
return false;
+
}
+
 
+
}
+
 
+
 
+
 
+
function append_to_not_sorted  (page_name) {
+
 
+
$("#not_sorted").append("<li> <a  href='"+page_name+"'>"+page_name +"</a></li>");
+
 
+
}
+
 
+
 
+
function append_tier_one ( page_name, no_underscores_name ) {
+
+
page_name = "map_"+page_name;
+
$("#organized_pages").append("<li> <a href='"+page_name+"'>"+no_underscores_name+"</a> <ul  id='"+page_name+"' ></ul> </li>");
+
 
+
}
+
 
+
function append_tier_two (page_name, no_underscores_name, clean_name ) {
+
page_name = "map_"+page_name;
+
$("#"+page_name.substring(4, page_name.indexOf("/") ) ).append("<li><a href='"+page_name+"'> "+no_underscores_name.substring( page_name.indexOf("/")+1, page_name.length )+"</a>  <ol id='"+clean_name+"'>  </ol></li>");
+
 
+
}
+
 
+
 
+
+
function append_tier_three (page_name,  no_underscores_name, clean_name ) {
+
 
+
$("#"+clean_name.substring(0,  clean_name.lastIndexOf("-") ) ).append("<li id='"+page_name+"'><a href='"+page_name+"'>"+no_underscores_name.substring( page_name.lastIndexOf("/")+1, page_name.length )+"</a></li>");
+
+
 
+
}
+
 
+
 
+
</script>
+
 
+
 
+
 
+
 
+
 
+
</html>
+

Latest revision as of 15:47, 19 May 2017

MENU

SITEMAP

iGEM is a multifaceted competition with many different components. Our websites have a lot of information, from requirements of the competition to tips on how make fundraising easier. This page is here to help you navigate our site and make sure you have access to all of its content.

PAGE LIST
TEAM PAGES
HQ

TEAMS

Loading all team pages...

HQ

This is the view for iGEM HQ

Total pages Wiki pages HQ pages Redirect pages Not sorted Team pages

...

...

...

...

...

...

HQ pages

Redirects

Not Sorted