-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbonusthp.rb
108 lines (97 loc) · 4.39 KB
/
bonusthp.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
require 'sinatra'
require 'erb'
# Données (Array) Promo
students = [
{ name: "Arthur Goure", img: "Arthur.jpg", github: "https://github.com/Arthur-goure" },
{ name: "Gaetan Bordes", img: "Gaetan.jpg", github: "https://github.com/GaetanBordes" },
{ name: "houdheyfa kaddouri", img: "om.jpg", github: "https://github.com/houdheyfakaddouri/bbgb.git" },
{ name: "Ismail Bekkar", img: "Ismail.png", github: "https://github.com/Ismail23-85" },
{ name: "Jade Michel", img: "jade.jpeg", github: "https://github.com/Jade-m22" },
{ name: "Jeremy Fonnard", img: "Jeremy.png", github: "https://github.com/jeremyfonnard" },
{ name: "Charlie SIGOGNEAU", img: "Charlie.jpg", github: "https://github.com/charlieSIGOGNEAU" },
{ name: "Julien Sicard", img: "Slingo.png", github: "https://github.com/Slingod?tab=repositories" },
{ name: "Maxime Saint-Joannis", img: "radikal moodz.png", github: "https://github.com/Wieedze" },
{ name: "Samuel Chauche", img: "sam.png", github: "https://github.com/SamuelChauche/Google_SCH" },
{ name: "Franck Grandcher", img: "Franck.jpg", github: "https://github.com/Franck-Biki" },
{ name: "Adel Maiza", img: "Inconnu.JPEG", github: "https://support.google.com/" }
]
# Route principale
get '/' do
erb :index, locals: { students: students }
end
__END__
@@ index
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Rubis Test Promo</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<link rel="stylesheet" href="style.css" />
<link rel="icon" href="img/logo2.jpg" type="image/x-icon">
</head>
<body>
<header>
<div class="container-fluid d-grid gap-9 align-items-center" style="grid-template-columns: 1fr 2fr;">
<div class="dropdown">
<a href="#" class="d-flex align-items-center col-lg-1 mb-2 mb-lg-0 link-body-emphasis text-decoration-none"
data-bs-toggle="dropdown" aria-expanded="false">
<img src="img/logo3.png" class="bi me-2" width="80" height="auto">
</a>
</div>
<div class="d-flex align-items-left">
<form class="w-50 me-3" role="search">
<input type="search" class="form-control" placeholder="Search..." aria-label="Search">
</form>
</div>
</div>
</header>
<main>
<div class="px-1 pt-5 my-2 text-center border-bottom">
<img src="img/imageprojetbonus.jpg"
class="img-fluid border rounded-9 shadow-lg mb-1 shadow-lg p-1 mb-5 bg-white rounded" alt="Example image"
width="800" height="100" loading="lazy">
<h1 class="display-9 fw-bold text-body-emphasis">Bienvenue sur le portail de la promo 2025</h1>
<div class="col-lg-9 mx-auto">
<p class="lead mb-5">Faites nous profiter de vos projets ! <br>Vous pourrez retrouver ici tous vos projets et
ceux de vos camarades ! <br>N'hésitez pas à parcourir les fiches de vos co-apprenti afin d'en apprendre plus
sur eux !</p>
</div>
</div>
</main>
<section class="container text-center my-5">
<% students.each_slice(3) do |row| %>
<div class="row mb-4">
<% row.each do |student| %>
<div class="col-lg-4 mb-4">
<img src="img/<%= student[:img] %>" alt="<%= student[:name] %>" class="bd-placeholder-img rounded-circle" width="140" height="140">
<h2 class="fw-normal"><%= student[:name] %></h2>
<p><a href="<%= student[:github] %>" class="btn">Project</a></p>
</div>
<% end %>
</div>
<% end %>
</section>
<footer>
<p class="text-center">© 2023 Project BONUS. All rights reserved.</p>
</footer>
<script>
// Sélectionner tous les boutons
const buttons = document.querySelectorAll('.btn');
// Parcourir chaque bouton et vérifier l'URL
buttons.forEach(button => {
const url = button.getAttribute('href');
if (url.includes('github.com')) {
button.classList.add('btn-success');
} else {
button.classList.add('btn-danger');
}
});
</script>
</body>
</html>