101 lines
5.8 KiB
HTML
101 lines
5.8 KiB
HTML
{# Composant pour carte d'évaluation dans la liste #}
|
|
{% from 'components/common/macros.html' import progress_indicator %}
|
|
|
|
{% macro assessment_card(assessment) %}
|
|
{% set trimester_colors = {
|
|
1: {'bg': 'from-blue-500 to-blue-600', 'accent': 'blue', 'icon_bg': 'bg-blue-100', 'icon_text': 'text-blue-600'},
|
|
2: {'bg': 'from-green-500 to-green-600', 'accent': 'green', 'icon_bg': 'bg-green-100', 'icon_text': 'text-green-600'},
|
|
3: {'bg': 'from-orange-500 to-orange-600', 'accent': 'orange', 'icon_bg': 'bg-orange-100', 'icon_text': 'text-orange-600'}
|
|
} %}
|
|
{% set colors = trimester_colors[assessment.trimester] %}
|
|
|
|
<div class="bg-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 transform hover:scale-105 overflow-hidden">
|
|
<!-- Header avec gradient thématique -->
|
|
<div class="bg-gradient-to-r {{ colors.bg }} p-4 text-white">
|
|
<div class="flex items-center justify-between">
|
|
<div class="flex items-center space-x-3">
|
|
<div class="w-10 h-10 bg-white/20 rounded-full flex items-center justify-center">
|
|
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
|
<path d="M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"/>
|
|
<path fill-rule="evenodd" d="M4 5a2 2 0 012-2v1a1 1 0 102 0V3a2 2 0 012 2v6a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm2.5 2.5a.5.5 0 000 1h3a.5.5 0 000-1h-3z" clip-rule="evenodd"/>
|
|
</svg>
|
|
</div>
|
|
<div class="text-sm font-semibold">Trimestre {{ assessment.trimester }}</div>
|
|
</div>
|
|
<div class="text-xs opacity-75">{{ assessment.date.strftime('%d/%m/%Y') }}</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Contenu principal -->
|
|
<div class="p-6">
|
|
<h3 class="text-lg font-bold text-gray-900 mb-2 line-clamp-2">{{ assessment.title }}</h3>
|
|
|
|
<!-- Informations clés -->
|
|
<div class="space-y-3 mb-4">
|
|
<div class="flex items-center text-sm text-gray-600">
|
|
<svg class="w-4 h-4 mr-2 {{ colors.icon_text }}" fill="currentColor" viewBox="0 0 20 20">
|
|
<path d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
</svg>
|
|
<span class="font-medium">{{ assessment.class_group.name }}</span>
|
|
</div>
|
|
|
|
<div class="flex items-center justify-between">
|
|
<div class="flex items-center text-sm text-gray-600">
|
|
<svg class="w-4 h-4 mr-2 {{ colors.icon_text }}" fill="currentColor" viewBox="0 0 20 20">
|
|
<path d="M7 3a1 1 0 000 2h6a1 1 0 100-2H7zM4 7a1 1 0 011-1h10a1 1 0 110 2H5a1 1 0 01-1-1zM2 11a2 2 0 012-2h12a2 2 0 012 2v4a2 2 0 01-2 2H4a2 2 0 01-2-2v-4z"/>
|
|
</svg>
|
|
<span>{{ assessment.exercises|length }} exercice(s)</span>
|
|
</div>
|
|
|
|
<div class="bg-{{ colors.accent }}-100 text-{{ colors.accent }}-800 text-xs px-2 py-1 rounded-full font-medium">
|
|
Coeff. {{ assessment.coefficient }}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Indicateur de progression des notes -->
|
|
{% set progress = assessment.grading_progress %}
|
|
<div class="flex items-center justify-between pt-2 border-t border-gray-100">
|
|
{{ progress_indicator(progress, True, assessment.id) }}
|
|
|
|
<!-- Info détaillée -->
|
|
<div class="text-xs text-gray-500 text-right">
|
|
{{ progress.completed }}/{{ progress.total }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% if assessment.description %}
|
|
<p class="text-sm text-gray-600 mb-4 line-clamp-2">{{ assessment.description }}</p>
|
|
{% endif %}
|
|
|
|
<!-- Actions -->
|
|
<div class="flex space-x-2">
|
|
<a href="{{ url_for('assessments.detail', id=assessment.id) }}"
|
|
class="flex-1 bg-gray-50 hover:bg-gray-100 text-gray-700 hover:text-gray-900 px-3 py-2 rounded-lg text-xs font-medium transition-colors flex items-center justify-center">
|
|
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
|
|
<path d="M10 12a2 2 0 100-4 2 2 0 000 4z"/>
|
|
<path fill-rule="evenodd" d="M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z" clip-rule="evenodd"/>
|
|
</svg>
|
|
Détails
|
|
</a>
|
|
|
|
<a href="{{ url_for('grading.assessment_grading', assessment_id=assessment.id) }}"
|
|
class="flex-1 bg-{{ colors.accent }}-50 hover:bg-{{ colors.accent }}-100 text-{{ colors.accent }}-700 hover:text-{{ colors.accent }}-900 px-3 py-2 rounded-lg text-xs font-medium transition-colors flex items-center justify-center">
|
|
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
|
|
<path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"/>
|
|
</svg>
|
|
Noter
|
|
</a>
|
|
|
|
<a href="{{ url_for('assessments.edit', id=assessment.id) }}"
|
|
class="flex-1 bg-gray-50 hover:bg-gray-100 text-gray-700 hover:text-gray-900 px-3 py-2 rounded-lg text-xs font-medium transition-colors flex items-center justify-center">
|
|
<svg class="w-4 h-4 mr-1" fill="currentColor" viewBox="0 0 20 20">
|
|
<path d="M17.414 2.586a2 2 0 00-2.828 0L7 10.172V13h2.828l7.586-7.586a2 2 0 000-2.828z"/>
|
|
<path fill-rule="evenodd" d="M2 6a2 2 0 012-2h4a1 1 0 010 2H4v10h10v-4a1 1 0 112 0v4a2 2 0 01-2 2H4a2 2 0 01-2-2V6z" clip-rule="evenodd"/>
|
|
</svg>
|
|
Modifier
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endmacro %} |