scripts/pirate_program/templates/index.html

166 lines
3.4 KiB
HTML

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Programme du Parti Pirate</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f5f5f5;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.container {
width: 45rem;
max-width: 1200px;
background-color: #fff;
padding: 8rem;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
font-size: 1.25rem;
}
h1 {
font-size: 24px;
margin-bottom: 10px;
}
.article {
margin-bottom: 40px;
}
.article h2 {
font-size: 18px;
margin-bottom: 10px;
}
.article .tags {
margin-bottom: 10px;
}
.article .tags a {
color: #333;
text-decoration: none;
}
.article .date {
font-size: 12px;
color: #999;
margin-bottom: 10px;
}
.article .content {
font-size: 16px;
line-height: 1.6;
color: #333;
}
.article .content p {
margin-bottom: 20px;
}
.article .content ul {
margin-left: 20px;
}
a {
color: darkslateblue;
}
.tags-menu {
position: fixed;
top: 20px;
left: 20px;
background-color: #fff;
padding: 10px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.tags-menu ul {
list-style: none;
padding: 0;
margin: 0;
}
.tags-menu li {
display: inline-block;
margin-right: 10px;
}
.tags-menu a {
color: #333;
text-decoration: none;
padding: 5px 10px;
border-radius: 5px;
background-color: #f5f5f5;
}
.tags-menu a:hover {
background-color: #e5e5e5;
}
</style>
</head>
<body id="main">
<div class="middle w-5/6 max-w-screen-xl mt-16 ml-auto mr-auto project-container">
<div class="container">
<h1>Programme du
<a href="https://partipirate.org/index.php/">Parti Pirate</a>
</h1>
{% for page in pages %}
<div class="article">
<h2>
<a href="{{ page.url}}">
{{ page.title }}
</a>
</h2>
<div class="tags">
<strong>Tags :</strong> {{ page.tags }}
</div>
<div class="date">{{ page.date }}</div>
<div class="image"><img src="{{ page.image }}" alt="image d'article"></div>
<div class="content">{{ page.content|safe }}</div>
<hr>
</div>
{% endfor %}
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
var tagsMenu = document.querySelector('.tags-menu')
var tags = document.querySelectorAll('.tags-menu a')
var articles = document.querySelectorAll('.article')
tagsMenu.addEventListener('click', function (e) {
if (e.target && e.target.matches('a')) {
var tag = e.target.getAttribute('data-tag')
articles.forEach(function (article) {
if (article.getAttribute('data-tags').includes(tag)) {
article.style.display = 'block'
} else {
article.style.display = 'none'
}
})
}
})
// Ajouter un événement de clic sur le premier tag pour afficher tous les articles
tags[0].addEventListener('click', function () {
articles.forEach(function (article) {
article.style.display = 'block'
})
})
})
</script>
</body>
</html>