You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
special-issue-11-wiki2html/templates/index.html

110 lines
5.4 KiB
HTML

5 years ago
<!DOCTYPE html>
<html lang="en">
<head>
5 years ago
<meta charset="utf-8">
5 years ago
<link rel="stylesheet" href="{{ staticpath }}/static/archive.css"/>
<link rel="stylesheet" href="{{ staticpath }}/static/index.css"/>
<!-- <script type="text/javascript" src="{{ staticpath }}/static/index.js"></script> -->
5 years ago
<title>{{ page.name }}</title>
</head>
<body>
5 years ago
<div id="myBtnContainer">
5 years ago
<button class="btn active" onclick="filterSelection('All')">All</button>
<button class="btn" onclick="filterSelection('Arts and Culture')">Arts and Culture</button>
<button class="btn" onclick="filterSelection('Civil Rights')">Civil Rights</button>
<button class="btn" onclick="filterSelection('Clergy / Religion')">Clergy / Religion</button>
<button class="btn" onclick="filterSelection('Economics')">Economics</button>
<button class="btn" onclick="filterSelection('Education')">Education</button>
<button class="btn" onclick="filterSelection('Elections')">Elections</button>
5 years ago
<button class="btn" onclick="filterSelection('Food Production / Nutrition / Food')">Food Production / Nutrition / Food</button>
<button class="btn" onclick="filterSelection('Healthcare')">Healthcare</button>
<button class="btn" onclick="filterSelection('Imprisonment')">Imprisonment</button>
<button class="btn" onclick="filterSelection('Infrastructure')">Infrastructure</button>
<button class="btn" onclick="filterSelection('Internal Affairs')">Internal Affairs</button>
<button class="btn" onclick="filterSelection('International Affairs')">International Affairs</button>
<button class="btn" onclick="filterSelection('Key Political Figures')">Key Political Figures</button>
<button class="btn" onclick="filterSelection('Martial Law')">Martial Law</button>
<button class="btn" onclick="filterSelection('Military Abuse')">Military Abuse</button>
<button class="btn" onclick="filterSelection('Military Resources')">Military Resources</button>
<button class="btn" onclick="filterSelection('Natural Phenomena')">Natural Phenomena</button>
<button class="btn" onclick="filterSelection('Political Ideologies')">Political Ideologies</button>
<button class="btn" onclick="filterSelection('Resistance Tactics')">Resistance Tactics</button>
<button class="btn" onclick="filterSelection('Social Policies')">Social Policies</button>
<button class="btn" onclick="filterSelection('US Foreign Policy')">US Foreign Policy</button>
<button class="btn" onclick="filterSelection('Workers Rights')">Workers Rights</button>
5 years ago
<div class="line"></div>
5 years ago
<button class="btn" onclick="filterSelection('Agenda')">Agenda</button>
<button class="btn" onclick="filterSelection('Article')">Article</button>
<button class="btn" onclick="filterSelection('Bulletin')">Bulletin</button>
<button class="btn" onclick="filterSelection('Comic')">Comic</button>
<button class="btn" onclick="filterSelection('Editorial')">Editorial</button>
<button class="btn" onclick="filterSelection('Handbook')">Handbook</button>
<button class="btn" onclick="filterSelection('Interview')">Interview</button>
<button class="btn" onclick="filterSelection('Invitation')">Invitation</button>
<button class="btn" onclick="filterSelection('Legal Document')">Legal Document</button>
<button class="btn" onclick="filterSelection('Letter')">Letter</button>
<button class="btn" onclick="filterSelection('List')">List</button>
<button class="btn" onclick="filterSelection('Manifesto')">Manifesto</button>
<button class="btn" onclick="filterSelection('Manual')">Manual</button>
<button class="btn" onclick="filterSelection('News')">News</button>
<button class="btn" onclick="filterSelection('Notes')">Notes</button>
<button class="btn" onclick="filterSelection('Pamphlet')">Pamphlet</button>
<button class="btn" onclick="filterSelection('Paper')">Paper</button>
<button class="btn" onclick="filterSelection('Poem')">Poem</button>
<button class="btn" onclick="filterSelection('Reader')">Reader</button>
<button class="btn" onclick="filterSelection('Report')">Report</button>
<button class="btn" onclick="filterSelection('Song')">Song</button>
<button class="btn" onclick="filterSelection('Statement')">Statement</button>
</div>
5 years ago
<ul id="menu">
{{ body|safe }}
</ul>
5 years ago
</body>
5 years ago
</html>
5 years ago
<script>
filterSelection("All")
function filterSelection(c) {
var x, i;
x = document.getElementsByClassName("filter");
if (c == "All") c = "";
for (i = 0; i < x.length; i++) {
w3RemoveClass(x[i], "show");
if (x[i].className.indexOf(c) > -1) w3AddClass(x[i], "show");
}
}
function w3AddClass(element, name) {
var i, arr1, arr2;
arr1 = element.className.split(" ");
arr2 = name.split(" ");
for (i = 0; i < arr2.length; i++) {
if (arr1.indexOf(arr2[i]) == -1) {element.className += " " + arr2[i];}
}
}
function w3RemoveClass(element, name) {
var i, arr1, arr2;
arr1 = element.className.split(" ");
arr2 = name.split(" ");
for (i = 0; i < arr2.length; i++) {
while (arr1.indexOf(arr2[i]) > -1) {
arr1.splice(arr1.indexOf(arr2[i]), 1);
}
}
element.className = arr1.join(" ");
}
// Add active class to the current button (highlight it)
var btnContainer = document.getElementById("myBtnContainer");
var btns = btnContainer.getElementsByClassName("btn");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click", function(){
var current = document.getElementsByClassName("active");
current[0].className = current[0].className.replace(" active", "");
this.className += " active";
});
}
</script>