diff --git a/fet2020/blackboard/views.py b/fet2020/blackboard/views.py index c51eff0e..093728ef 100644 --- a/fet2020/blackboard/views.py +++ b/fet2020/blackboard/views.py @@ -4,11 +4,19 @@ from django.utils import timezone from datetime import timedelta from .models import JobPosting +from posts.models import Post def index(request): - jobPost_cutoff = timezone.now().date() - timedelta(30) # 30days from now + job_postings_cutoff = timezone.now().date() - timedelta(30) # 30days from now + job_postings = JobPosting.all_jobPosting.filter(publishDate__gt=job_postings_cutoff) + bb_info = Post.objects.filter(slug='blackboard').first() + bb_empty = Post.objects.filter(slug='blackboard-empty').first() + context = { - "jobPostings": JobPosting.all_jobPosting.filter(publishDate__gt=jobPost_cutoff), + "job_postings": job_postings, + "bb_info": bb_info, + "bb_empty": bb_empty, } + return render(request, 'blackboard/index.html', context) diff --git a/fet2020/templates/blackboard/index.html b/fet2020/templates/blackboard/index.html index 6ae266ac..670d9361 100644 --- a/fet2020/templates/blackboard/index.html +++ b/fet2020/templates/blackboard/index.html @@ -5,9 +5,17 @@