169 lines
		
	
	
		
			9.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			169 lines
		
	
	
		
			9.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| {% extends "base.html" %}
 | ||
| 
 | ||
| {% block title %}Configuration générale - Notytex{% endblock %}
 | ||
| 
 | ||
| {% block content %}
 | ||
| <div class="space-y-8">
 | ||
|     <!-- Breadcrumb -->
 | ||
|     <nav class="flex" aria-label="Breadcrumb">
 | ||
|         <ol class="flex items-center space-x-4">
 | ||
|             <li>
 | ||
|                 <a href="{{ url_for('config.index') }}" class="text-gray-400 hover:text-gray-500">
 | ||
|                     <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
 | ||
|                         <path fill-rule="evenodd" d="M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z" clip-rule="evenodd"/>
 | ||
|                     </svg>
 | ||
|                     <span class="sr-only">Configuration</span>
 | ||
|                 </a>
 | ||
|             </li>
 | ||
|             <li>
 | ||
|                 <div class="flex items-center">
 | ||
|                     <svg class="w-5 h-5 text-gray-400" fill="currentColor" viewBox="0 0 20 20">
 | ||
|                         <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>
 | ||
|                     </svg>
 | ||
|                     <span class="ml-4 text-sm font-medium text-gray-500">Configuration générale</span>
 | ||
|                 </div>
 | ||
|             </li>
 | ||
|         </ol>
 | ||
|     </nav>
 | ||
| 
 | ||
|     <!-- En-tête -->
 | ||
|     <div class="bg-gradient-to-r from-blue-600 to-indigo-600 text-white rounded-xl p-8 shadow-lg">
 | ||
|         <div class="flex items-center justify-between">
 | ||
|             <div>
 | ||
|                 <h1 class="text-3xl font-bold mb-2">🏫 Configuration générale</h1>
 | ||
|                 <p class="text-xl opacity-90">Paramètres système et contexte de l'application</p>
 | ||
|             </div>
 | ||
|             <div class="hidden md:block">
 | ||
|                 <div class="w-20 h-20 bg-white/20 rounded-full flex items-center justify-center">
 | ||
|                     <svg class="w-10 h-10" fill="currentColor" viewBox="0 0 20 20">
 | ||
|                         <path d="M3 4a1 1 0 011-1h12a1 1 0 011 1v2a1 1 0 01-1 1H4a1 1 0 01-1-1V4zM3 10a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H4a1 1 0 01-1-1v-6zM14 9a1 1 0 00-1 1v6a1 1 0 001 1h2a1 1 0 001-1v-6a1 1 0 00-1-1h-2z"/>
 | ||
|                     </svg>
 | ||
|                 </div>
 | ||
|             </div>
 | ||
|         </div>
 | ||
|     </div>
 | ||
| 
 | ||
|     <!-- Formulaire de configuration -->
 | ||
|     <div class="bg-white rounded-lg shadow-md">
 | ||
|         <form method="POST" action="{{ url_for('config.update_general') }}" class="p-8 space-y-6">
 | ||
|             
 | ||
|             <!-- Section Contexte -->
 | ||
|             <div class="border-b border-gray-200 pb-6">
 | ||
|                 <h3 class="text-lg font-medium text-gray-900 mb-4">📅 Contexte scolaire</h3>
 | ||
|                 
 | ||
|                 <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
 | ||
|                     <div>
 | ||
|                         <label for="school_year" class="block text-sm font-medium text-gray-700 mb-2">
 | ||
|                             Année scolaire
 | ||
|                         </label>
 | ||
|                         <input 
 | ||
|                             type="text" 
 | ||
|                             id="school_year" 
 | ||
|                             name="school_year" 
 | ||
|                             value="{{ school_year }}"
 | ||
|                             pattern="^\d{4}-\d{4}$"
 | ||
|                             placeholder="2024-2025"
 | ||
|                             class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
 | ||
|                             required
 | ||
|                         >
 | ||
|                         <p class="mt-1 text-xs text-gray-500">Format attendu : YYYY-YYYY</p>
 | ||
|                     </div>
 | ||
|                 </div>
 | ||
|             </div>
 | ||
| 
 | ||
| 
 | ||
|             <!-- Section Évaluations -->
 | ||
|             <div class="pb-6">
 | ||
|                 <h3 class="text-lg font-medium text-gray-900 mb-4">🎯 Configuration des évaluations</h3>
 | ||
|                 
 | ||
|                 <div class="space-y-4">
 | ||
|                     <div>
 | ||
|                         <label for="default_grading_system" class="block text-sm font-medium text-gray-700 mb-2">
 | ||
|                             Système de notation par défaut
 | ||
|                         </label>
 | ||
|                         <select 
 | ||
|                             id="default_grading_system" 
 | ||
|                             name="default_grading_system"
 | ||
|                             class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
 | ||
|                         >
 | ||
|                             <option value="points" {% if default_grading_system == 'points' %}selected{% endif %}>
 | ||
|                                 Points (notation classique)
 | ||
|                             </option>
 | ||
|                             <option value="competences" {% if default_grading_system == 'competences' %}selected{% endif %}>
 | ||
|                                 Compétences (échelle 0-3)
 | ||
|                             </option>
 | ||
|                         </select>
 | ||
|                         <p class="mt-1 text-xs text-gray-500">
 | ||
|                             Système utilisé par défaut lors de la création d'exercices
 | ||
|                         </p>
 | ||
|                     </div>
 | ||
|                 </div>
 | ||
|             </div>
 | ||
| 
 | ||
|             <!-- Actions -->
 | ||
|             <div class="flex justify-between items-center pt-6 border-t border-gray-200">
 | ||
|                 <a 
 | ||
|                     href="{{ url_for('config.index') }}" 
 | ||
|                     class="inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
 | ||
|                 >
 | ||
|                     <svg class="w-4 h-4 mr-2" fill="currentColor" viewBox="0 0 20 20">
 | ||
|                         <path fill-rule="evenodd" d="M7.707 14.707a1 1 0 01-1.414 0L2.586 11H13a1 1 0 110 2H2.586l3.707 3.707a1 1 0 01-1.414 1.414l-5-5a1 1 0 010-1.414l5-5a1 1 0 011.414 1.414L2.586 9H13a1 1 0 110 2H7.707z" clip-rule="evenodd"/>
 | ||
|                     </svg>
 | ||
|                     Retour
 | ||
|                 </a>
 | ||
|                 
 | ||
|                 <div class="flex space-x-3">
 | ||
|                     <button 
 | ||
|                         type="button"
 | ||
|                         onclick="resetForm()"
 | ||
|                         class="inline-flex items-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
 | ||
|                     >
 | ||
|                         <svg class="w-4 h-4 mr-2" fill="currentColor" viewBox="0 0 20 20">
 | ||
|                             <path fill-rule="evenodd" d="M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z" clip-rule="evenodd"/>
 | ||
|                         </svg>
 | ||
|                         Réinitialiser
 | ||
|                     </button>
 | ||
|                     
 | ||
|                     <button 
 | ||
|                         type="submit"
 | ||
|                         class="inline-flex items-center px-6 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
 | ||
|                     >
 | ||
|                         <svg class="w-4 h-4 mr-2" fill="currentColor" viewBox="0 0 20 20">
 | ||
|                             <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
 | ||
|                         </svg>
 | ||
|                         Enregistrer
 | ||
|                     </button>
 | ||
|                 </div>
 | ||
|             </div>
 | ||
|         </form>
 | ||
|     </div>
 | ||
| 
 | ||
|     <!-- Informations système -->
 | ||
|     <div class="bg-gray-50 rounded-lg p-6">
 | ||
|         <h3 class="text-lg font-medium text-gray-900 mb-4">ℹ️ Informations système</h3>
 | ||
|         <div class="grid grid-cols-1 md:grid-cols-3 gap-4 text-sm">
 | ||
|             <div>
 | ||
|                 <span class="font-medium text-gray-600">Version :</span>
 | ||
|                 <span class="text-gray-900">Notytex 1.0</span>
 | ||
|             </div>
 | ||
|             <div>
 | ||
|                 <span class="font-medium text-gray-600">Type de base :</span>
 | ||
|                 <span class="text-gray-900">SQLite</span>
 | ||
|             </div>
 | ||
|             <div>
 | ||
|                 <span class="font-medium text-gray-600">Configuration :</span>
 | ||
|                 <span class="text-gray-900">Base de données SQLite</span>
 | ||
|             </div>
 | ||
|         </div>
 | ||
|     </div>
 | ||
| </div>
 | ||
| 
 | ||
| <script>
 | ||
| function resetForm() {
 | ||
|     if (confirm('Êtes-vous sûr de vouloir réinitialiser le formulaire ?')) {
 | ||
|         document.getElementById('school_year').value = '2025-2026';
 | ||
|         document.getElementById('default_grading_system').value = 'competences';
 | ||
|     }
 | ||
| }
 | ||
| </script>
 | ||
| {% endblock %} |