Page d'agenda
This commit is contained in:
parent
6c3a1e6ddc
commit
b58d85198a
10 changed files with 64 additions and 8 deletions
|
|
@ -37,6 +37,7 @@ class Migration(migrations.Migration):
|
|||
),
|
||||
),
|
||||
],
|
||||
options={'verbose_name': 'Agenda', 'verbose_name_plural': 'Agenda'},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="Document",
|
||||
|
|
|
|||
|
|
@ -50,6 +50,10 @@ class Agenda(models.Model):
|
|||
)
|
||||
)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Agenda"
|
||||
verbose_name_plural = "Agenda"
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.titre} {self.date_heure}"
|
||||
|
||||
|
|
|
|||
|
|
@ -73,3 +73,8 @@ nav {
|
|||
.left-red {
|
||||
border-left: 2px solid red;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,21 @@
|
|||
from datetime import date, timedelta
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.views.generic import ListView, TemplateView
|
||||
|
||||
from .models import Membre
|
||||
from .models import Agenda, Membre
|
||||
|
||||
|
||||
class AgendaView(ListView):
|
||||
model = Agenda
|
||||
template_name = "agenda.html"
|
||||
|
||||
def get_queryset(self):
|
||||
qs = Agenda.objects.filter(
|
||||
date_heure__gt=date.today() - timedelta(days=3),
|
||||
).order_by("date_heure")
|
||||
if not self.request.user.is_authenticated:
|
||||
qs = qs.filter(prive=False)
|
||||
return qs
|
||||
|
||||
|
||||
class EspaceMembresView(LoginRequiredMixin, TemplateView):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue