diff --git a/home/urls.py b/home/urls.py index a1ea3c1..7aa620c 100644 --- a/home/urls.py +++ b/home/urls.py @@ -4,5 +4,4 @@ from . import views app_name = 'home' urlpatterns = [ path('', views.home, name='home'), - path('premium/', views.premium, name='premium'), ] \ No newline at end of file diff --git a/home/views.py b/home/views.py index 5bd3838..f4650f4 100644 --- a/home/views.py +++ b/home/views.py @@ -1,11 +1,6 @@ -from django.shortcuts import render, get_object_or_404 +from django.shortcuts import render from courses.models import Course def home(request): courses = Course.objects.order_by('-created_at')[:6] return render(request, 'home.html', {'courses': courses}) - -def premium(request, course_id): - """Landing page présentant les avantages du Premium.""" - course = get_object_or_404(Course, pk=course_id) - return render(request, 'premium.html', {'course': course}) diff --git a/static/css/app.css b/static/css/app.css index 29ea0cc..8a5d52d 100644 --- a/static/css/app.css +++ b/static/css/app.css @@ -9,7 +9,7 @@ --muted: #5e88a0; --primary: #4e9ed6; --primary-contrast: #06121b; - --accent: #a79228; + --accent: #ffa500; --border: #4f6f8f; --card: #13293d; --elev: rgba(15,31,46,0.6); @@ -206,36 +206,6 @@ margin-left: 8px; font-size: 12px; } - -/* Petit badge "PREMIUM" affiché dans la TOC des cours */ -.premium-tag { - display: inline-flex; - align-items: center; - gap: 6px; - padding: 2px 8px; - margin-left: 8px; - border-radius: 999px; - background: var(--accent); - color: var(--warning-contrast); - font-size: 11px; - font-weight: 800; - letter-spacing: .3px; - line-height: 1.2; - vertical-align: middle; - text-transform: uppercase; - white-space: nowrap; -} - -.courseToc .tocLink.disabled { - color: var(--text-muted); - background: transparent; - border-color: transparent; - cursor: not-allowed; - opacity: 0.6; - pointer-events: none; - font-weight: 500; -} - [data-theme='light'] { /* Palette: plus nuancé, moins "blanc" */ --bg: #eef3f7; /* fond légèrement teinté bleu-gris */ @@ -1902,7 +1872,6 @@ input[type="text"], input[type="email"], input[type="password"], textarea { .btn-primary:hover, .button-primary:hover { background-color: var(--link-hover); border-color: var(--link-hover); - color: var(--primary-contrast); } .btn-secondary, .button-secondary { diff --git a/templates/courses/partials/_course_toc.html b/templates/courses/partials/_course_toc.html index fb3923d..3feeea3 100644 --- a/templates/courses/partials/_course_toc.html +++ b/templates/courses/partials/_course_toc.html @@ -11,41 +11,15 @@
    {% for item in group.list %}
  1. - - {{ item.name }} {% if item.is_premium %}PREMIUM{% endif %} + + {{ item.name }} {% if lesson and lesson.id == item.id %}(cours actuel){% endif %} {% if lesson and lesson.id == item.id %}
    -
    +
    {% if lesson.video_id %} - {% if not lesson.is_premium %} - VIDEO {{ lesson.video_id }}
    - {% else %} - - {% if not user.profile.is_premium %} -
    -
    - -
    -

    Contenu réservé aux membres Premium

    - {% if user.is_authenticated %} -

    Devenez membre Premium pour accéder à la vidéo de ce cours.

    - - {% else %} -

    Connectez-vous ou devenez membre Premium pour accéder à la vidéo.

    - - {% endif %} -
    -
    -
    - {% endif %} - {% endif %} + VIDEO {{ lesson.video_id }}
    {% endif %} {{ lesson.content|safe }}
    diff --git a/templates/premium.html b/templates/premium.html deleted file mode 100644 index 614c108..0000000 --- a/templates/premium.html +++ /dev/null @@ -1,78 +0,0 @@ -{% extends 'layout.html' %} - -{% block content %} -
    -
    -
    -
    - -
    - - {% if course %} -

    Débloquez le cours "{{ course.name }}"

    -

    Ce contenu est réservé aux membres Premium. Rejoignez-nous pour accéder immédiatement à ce projet et aux sources.

    - {% else %} -

    Passez à la vitesse supérieure

    -

    Accédez aux cours complets, aux projets concrets et aux corrections détaillées pour progresser plus vite.

    - {% endif %} - -
    - {% if course %} - - Débloquer ce cours maintenant - - {% else %} - - Voir le catalogue - - {% endif %} - - Retourner à l'accueil -
    - - -
    - -
    - -{% if course %} -
    -
    -
    - {{ course.name }} -
    -
    -

    Ce que vous allez apprendre

    -
      -
    • Créer une application complète de A à Z
    • -
    • Les bonnes pratiques professionnelles
    • -
    • Accès au code source complet
    • -
    -
    -
    -
    -{% endif %} - -
    -
    -
    -

    Parcours complets

    -

    Des modules structurés du niveau débutant à avancé.

    -
    -
    -
    -

    Projets de A à Z

    -

    Construisez des applications réelles et apprenez les bonnes pratiques.

    -
    -
    -
    -

    Corrections détaillées

    -

    Vidéos explicatives pas-à-pas et ressources téléchargeables.

    -
    -
    - -{% endblock %} \ No newline at end of file diff --git a/users/admin.py b/users/admin.py index 0567ce1..8c38f3f 100644 --- a/users/admin.py +++ b/users/admin.py @@ -1,24 +1,3 @@ from django.contrib import admin -from .models import Profile - -@admin.register(Profile) -class ProfileAdmin(admin.ModelAdmin): - list_display = ( - 'user', - 'first_name', - 'last_name', - 'is_premium', - 'birth_date', - ) - search_fields = ( - 'user__username', - 'first_name', - 'last_name', - 'biography', - ) - list_filter = ( - 'is_premium', - 'birth_date', - ) - autocomplete_fields = ('user',) +# Register your models here. diff --git a/users/migrations/0003_profile_is_premium.py b/users/migrations/0003_profile_is_premium.py deleted file mode 100644 index b8c04d0..0000000 --- a/users/migrations/0003_profile_is_premium.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 6.0 on 2025-12-10 21:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('users', '0002_alter_profile_avatar'), - ] - - operations = [ - migrations.AddField( - model_name='profile', - name='is_premium', - field=models.BooleanField(default=False), - ), - ] diff --git a/users/models.py b/users/models.py index f946dc0..f46640d 100644 --- a/users/models.py +++ b/users/models.py @@ -11,7 +11,6 @@ class Profile(models.Model): last_name = models.CharField(max_length=64, blank=True) birth_date = models.DateField(null=True, blank=True) biography = models.TextField(blank=True) - is_premium = models.BooleanField(default=False) def __str__(self): return self.user.username \ No newline at end of file