from django.shortcuts import render
from django.views.generic import TemplateView, DetailView
from .models import Case

class IndexView(TemplateView):
    template_name = 'core/index.html'

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        context['cases'] = Case.objects.all().order_by('-created_at')
        return context

class ArticleDetailView(DetailView):
    template_name = 'core/article_detail.html'