Compare commits

..

No commits in common. "872f2378446ae405164ff8b58430a51b64d6e6f2" and "21ef5140f0342d67530487818cbfedec3d7a0d16" have entirely different histories.

8 changed files with 38 additions and 142 deletions

View File

@ -6,6 +6,8 @@
{% block title %}Marketplace{% endblock title %} {% block title %}Marketplace{% endblock title %}
{% block main %} {% block main %}
<a href="{% url "colloscope.dashboard" %}">Retour au tableau de bord</a>
<h1>Marketplace</h1> <h1>Marketplace</h1>
Bienvenue sur le marketplace. Bienvenue sur le marketplace.

View File

@ -2,10 +2,12 @@
{% block title %}Sélection du profil{% endblock title %} {% block title %}Sélection du profil{% endblock title %}
{% block main %} {% block header %}
<h1>Sélection du profil</h1> <h1>Sélection du profil</h1>
{% endblock header %}
{% block main %}
Vous êtes connecté. Votre compte correspond à deux profils : Vous êtes connecté. Votre compte correspond à deux profils :
<ul> <ul>
<li>en tant que colleur : {{ profil.colleur }}&nbsp;; Classes : {{ profil.colleur.get_classes|join:"; " }}</li> <li>en tant que colleur : {{ profil.colleur }}&nbsp;; Classes : {{ profil.colleur.get_classes|join:"; " }}</li>

View File

@ -9,9 +9,13 @@
<link href="{% static 'table.css' %}" rel="stylesheet" type="text/css"> <link href="{% static 'table.css' %}" rel="stylesheet" type="text/css">
{% endblock head %} {% endblock head %}
{% block main %} {% block header %}
<h1>Colloscope</h1> <h1>Colloscope</h1>
{% endblock header %}
{% block main %}
<p> <p>
Lycée : {{ term.cls.school.description }}. Classe : {{ term.cls.description }}. <a href="dashboard.html">Retour au tableau de bord</a> Lycée : {{ term.cls.school.description }}. Classe : {{ term.cls.description }}. <a href="dashboard.html">Retour au tableau de bord</a>
</p> </p>

View File

@ -2,10 +2,12 @@
{% block title %}Sélection du profil{% endblock title %} {% block title %}Sélection du profil{% endblock title %}
{% block main %} {% block header %}
<h1>Sélection du profil</h1> <h1>Sélection du profil</h1>
{% endblock header %}
{% block main %}
Vous êtes connecté, mais votre compte n'est associé à aucun profil. Veuillez contacter le webmestre à l'adresse <a href="mailto:valentin@mp2i-vms.fr">valentin@mp2i-vms.fr</a>. Vous êtes connecté, mais votre compte n'est associé à aucun profil. Veuillez contacter le webmestre à l'adresse <a href="mailto:valentin@mp2i-vms.fr">valentin@mp2i-vms.fr</a>.
{% endblock main %} {% endblock main %}

View File

@ -78,7 +78,7 @@ class SlotViewset(ReadOnlyModelViewSet):
return Slot.objects.all() return Slot.objects.all()
class ColleViewset(ModelViewSet): class ColleViewset(ReadOnlyModelViewSet):
serializer_class = ColleSerializer serializer_class = ColleSerializer
permission_classes = [IsAuthenticated] permission_classes = [IsAuthenticated]

View File

@ -4,6 +4,7 @@
body { body {
font-family: sans-serif; font-family: sans-serif;
background-color: #fafafa;
margin: 0; margin: 0;
} }
@ -35,49 +36,6 @@ header .bandeau button:active {
background-color: darkgoldenrod; background-color: darkgoldenrod;
} }
.navbar {
background-color: #eee;
display: flex;
flex-direction: column;
}
.navbar .block {
display: flex;
flex-direction: column;
text-align: center;
}
@media screen and (min-width: 400px)
{
.navbar {
padding: 0 10px;
flex-direction: row;
justify-content: space-between;
}
.navbar .block {
flex-direction: row;
gap: 0 10px;
}
}
.navbar a:link, .navbar a:visited {
color: black;
text-decoration: none;
}
.navbar .link {
background: none;
border: none;
font: inherit;
padding: 10px;
cursor: pointer;
}
.navbar .link:hover {
background-color: #ddd;
}
main { main {
margin: 20px auto; margin: 20px auto;
width: clamp(350px, 60%, 1200px); width: clamp(350px, 60%, 1200px);
@ -89,34 +47,6 @@ h1 {
text-align: center; text-align: center;
} }
form.login table {
margin: auto;
}
form.login input[type=text], form.login input[type=password] {
padding: 5px;
border: none;
background-color: #eee;
}
form.login button {
border: none;
padding: 10px;
background-color: dodgerblue;
border-radius: 5px;
color: white;
display: block;
margin: 15px auto;
}
form.login button:hover {
background-color: #0483ff;
}
form.login button:active {
background-color: #0077ea;
}
nav.semaine { nav.semaine {
width: 100%; width: 100%;
display: flex; display: flex;

View File

@ -5,73 +5,28 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}{% endblock title %}</title> <title>{% block title %}{% endblock title %}</title>
<link href="{% static 'unified-navigator/navigator.css' %}" rel="stylesheet" type="text/css">
<link href="{% static 'main.css' %}" rel="stylesheet" type="text/css"> <link href="{% static 'main.css' %}" rel="stylesheet" type="text/css">
<script src="https://kit.fontawesome.com/0fd87250ec.js" crossorigin="anonymous"></script> <script src="https://kit.fontawesome.com/0fd87250ec.js" crossorigin="anonymous"></script>
{% block head %}{% endblock head %} {% block head %}{% endblock head %}
</head> </head>
<body> <body>
<header> <header>
<script> {% if request.user.is_authenticated %}
function navigator_toggleMenu() { <div class="bandeau">
if (document.body.clientWidth > 600) Vous êtes connecté avec le compte <b>{{ user.username }}</b>.
return document.location = "https://mp2i-vms.fr" {% if request.session.profile == "student" %}
Profil actuel : étudiant.
if (document.getElementById("menu-sec").classList.contains("hidden")) { {% elif request.session.profile == "colleur" %}
document.getElementById("menu-sec").classList.remove("hidden"); Profil actuel : colleur.
document.getElementById("navigator-dropdown-indicator").className = "fa-solid fa-caret-up"; {% else %}
} else { Pas de profil.
document.getElementById("menu-sec").classList.add("hidden"); {% endif %}
document.getElementById("navigator-dropdown-indicator").className = "fa-solid fa-caret-down"; <form action="{% url 'logout' %}" method="post">
} {% csrf_token %}
} <button type="submit">Se déconnecter</button>
</script> </form>
<div class="unified_navigator">
<div class="nav-container">
<div class="logo-wrapper" onclick="navigator_toggleMenu();">
<a class="logo">
<img src="{% static 'unified-navigator/icon.png' %}" alt="logo"><strong>mp2i-vms.fr</strong>
</a>
<i id="navigator-dropdown-indicator" class="fa-solid fa-caret-down"></i>
</div>
<div class="menu-wrapper hidden" id="menu-sec">
<div class="link"><a href="https://mp2i-vms.fr/pages.html"><i class="fa-solid fa-house"></i> Pages personnelles</a></div>
<div class="link"><a href="https://git.mp2i-vms.fr"><i class="fa-brands fa-git-alt"></i> Git</a></div>
<div class="link"><a href="https://play.mp2i-vms.fr"><i class="fa-solid fa-cubes"></i> Minecraft</a></div>
<div class="link"><a href="{% url "home" %}"><i class="fa-solid fa-book"></i> Colles</a></div>
</div>
</div>
</div>
<div class="navbar">
<div class="block">
{% if request.user.is_authenticated %}
<a href="{% url "colloscope.dashboard" %}">
<div class="link"><i class="fa-solid fa-rocket"></i> Tableau de bord</div>
</a>
<a href="{% url "colloscope.table" %}">
<div class="link"><i class="fa-solid fa-calendar"></i> Colloscope</div>
</a>
<a href="{% url "colloscope.marketplace" %}">
<div class="link"><i class="fa-solid fa-shop"></i> Marketplace</div>
</a>
{% endif %}
</div>
<div class="block">
{% if request.user.is_authenticated %}
<form action="{% url 'logout' %}" method="post">
{% csrf_token %}
<button class="link" type="submit" href="{% url "login" %}">
<i class="fa-solid fa-right-from-bracket"></i> Se déconnecter
</button>
</form>
{% else %}
<a href="{% url "login" %}">
<div class="link right"><i class="fa-solid fa-right-from-bracket"></i> Se connecter</div>
</a>
{% endif %}
</div>
</div> </div>
{% endif %}
{% block header %}{% endblock header %} {% block header %}{% endblock header %}
</header> </header>

View File

@ -19,7 +19,7 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
<form class="login" method="post" action="{% url 'login' %}"> <form method="post" action="{% url 'login' %}">
{% csrf_token %} {% csrf_token %}
<table> <table>
<tr> <tr>
@ -31,7 +31,8 @@
<td>{{ form.password }}</td> <td>{{ form.password }}</td>
</tr> </tr>
</table> </table>
<button type="submit">Se connecter</button>
<input type="submit" value="Se connecter">
<input type="hidden" name="next" value="{{ next }}"> <input type="hidden" name="next" value="{{ next }}">
</form> </form>