Ajout contenu page Media
This commit is contained in:
parent
b58d85198a
commit
daf7ca4ba0
6 changed files with 41 additions and 3 deletions
|
|
@ -72,4 +72,4 @@ class Document(models.Model):
|
|||
)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.titre} {self.date}"
|
||||
return f"{self.titre} {self.quand}"
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ nav {
|
|||
border-left: 2px solid red;
|
||||
}
|
||||
|
||||
.date_agenda { background-color: #ddd; }
|
||||
.prive {
|
||||
background-image: linear-gradient(45deg, #333333 41.67%, #6b0c0c 41.67%, #6b0c0c 50%, #333333 50%, #333333 91.67%, #6b0c0c 91.67%, #6b0c0c 100%);
|
||||
background-size: 33.94px 33.94px;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from datetime import date, timedelta
|
|||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.views.generic import ListView, TemplateView
|
||||
|
||||
from .models import Agenda, Membre
|
||||
from .models import Agenda, Document, Membre
|
||||
|
||||
|
||||
class AgendaView(ListView):
|
||||
|
|
@ -18,6 +18,19 @@ class AgendaView(ListView):
|
|||
return qs
|
||||
|
||||
|
||||
class MediaView(ListView):
|
||||
model = Document
|
||||
template_name = "media.html"
|
||||
|
||||
def get_queryset(self):
|
||||
qs = Document.objects.filter(
|
||||
date_heure__gt=date.today() - timedelta(days=3),
|
||||
).order_by("-quand")
|
||||
if not self.request.user.is_authenticated:
|
||||
qs = qs.filter(prive=False)
|
||||
return qs
|
||||
|
||||
|
||||
class EspaceMembresView(LoginRequiredMixin, TemplateView):
|
||||
template_name = "membres/index.html"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue