ProjetVM/templates/prof_creer_matiere.html
2025-12-08 14:18:02 +01:00

278 lines
12 KiB
HTML

<!doctype html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/static/style.css" />
<title>Créer une matière - EduGrade</title>
</head>
<body>
<div class="dashboard-wrapper">
<nav class="navbar">
<div class="nav-brand">
<svg
width="35"
height="35"
viewBox="0 0 60 60"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect
width="60"
height="60"
rx="15"
fill="white"
fill-opacity="0.2"
/>
<path
d="M30 15L40 25L30 35L20 25L30 15Z"
fill="white"
/>
<path
d="M30 25L40 35L30 45L20 35L30 25Z"
fill="white"
fill-opacity="0.7"
/>
</svg>
<span>EduGrade</span>
</div>
<div class="nav-links">
<a href="/prof/matieres" class="nav-link">
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="currentColor"
>
<path
d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"
/>
</svg>
Retour aux matières
</a>
<a href="/prof/dashboard" class="nav-link">Dashboard</a>
<a href="/logout" class="btn-logout">
<svg
width="18"
height="18"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
d="M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"
/>
</svg>
Déconnexion
</a>
</div>
</nav>
<div class="content-wrapper">
<div class="page-header">
<h1>
<svg
width="30"
height="30"
viewBox="0 0 24 24"
fill="currentColor"
>
<path
d="M21 5c-1.11-.35-2.33-.5-3.5-.5-1.95 0-4.05.4-5.5 1.5-1.45-1.1-3.55-1.5-5.5-1.5S2.45 4.9 1 6v14.65c0 .25.25.5.5.5.1 0 .15-.05.25-.05C3.1 20.45 5.05 20 6.5 20c1.95 0 4.05.4 5.5 1.5 1.35-.85 3.8-1.5 5.5-1.5 1.65 0 3.35.3 4.75 1.05.1.05.15.05.25.05.25 0 .5-.25.5-.5V6c-.6-.45-1.25-.75-2-1z"
/>
</svg>
Créer une matière
</h1>
<p class="page-subtitle">
Ajoutez une nouvelle matière à une UE
</p>
</div>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %} {% for category, message in messages %}
<div class="message {{ category }}">{{ message }}</div>
{% endfor %} {% endif %} {% endwith %} {% if not ues %}
<div class="alert alert-warning">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="currentColor"
>
<path
d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"
/>
</svg>
<div>
<strong>Attention :</strong> Aucune UE disponible.
<a href="/prof/ue/creer">Créez d'abord une UE</a>
</div>
</div>
{% endif %}
<div class="form-card">
<form
action="/prof/matieres/creer"
method="post"
class="create-form"
>
<div class="form-group">
<label for="code">
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="currentColor"
>
<path
d="M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"
/>
</svg>
Code matière
</label>
<input
type="text"
id="code"
name="code"
placeholder="Ex: PYTHON"
required
{%
if
not
ues
%}disabled{%
endif
%}
/>
<small class="form-hint"
>Code unique de la matière</small
>
</div>
<div class="form-group">
<label for="nom">
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="currentColor"
>
<path
d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"
/>
</svg>
Nom de la matière
</label>
<input
type="text"
id="nom"
name="nom"
placeholder="Ex: Programmation Python"
required
{%
if
not
ues
%}disabled{%
endif
%}
/>
</div>
<div class="form-group">
<label for="ue_id">
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="currentColor"
>
<path
d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z"
/>
</svg>
Unité d'Enseignement
</label>
<select
id="ue_id"
name="ue_id"
required
{%
if
not
ues
%}disabled{%
endif
%}
>
<option value="">Sélectionner une UE</option>
{% for ue in ues %}
<option value="{{ ue.id }}">
{{ ue.code }} - {{ ue.nom }}
</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label for="coefficient">
<svg
width="18"
height="18"
viewBox="0 0 24 24"
fill="currentColor"
>
<path
d="M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4z"
/>
</svg>
Coefficient
</label>
<input
type="number"
id="coefficient"
name="coefficient"
step="0.5"
min="0.5"
value="1.0"
required
{%
if
not
ues
%}disabled{%
endif
%}
/>
<small class="form-hint"
>Coefficient de la matière dans l'UE</small
>
</div>
<button
type="submit"
class="btn btn-primary btn-large"
{%
if
not
ues
%}disabled{%
endif
%}
>
<svg
width="20"
height="20"
viewBox="0 0 24 24"
fill="currentColor"
>
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
</svg>
Créer la matière
</button>
</form>
</div>
</div>
</div>
</body>
</html>