blackboard: add text as a post

This commit is contained in:
2020-12-30 13:52:05 +00:00
parent bf14174b28
commit d1c66f054c
5 changed files with 22 additions and 5 deletions

View File

@@ -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)

View File

@@ -35,6 +35,7 @@ def index(request):
return render(request, "posts/index.html", {"posts": posts, "tags_list": t})
def calendar(request):
events = deque(Post.objects.all_post_with_date().all())
return render(

View File

@@ -5,9 +5,17 @@
<div class="grid-container">
<h1>Blackboard</h1>
{% if bb_info %}
{{ bb_info.body|safe }}
{% endif %}
{% if bb_empty and not job_postings %}
{{ bb_empty.body|safe }}
{% endif %}
<div class="grid-x grid-margin-x">
{% for job in jobPostings %}
{% include 'blackboard/partials/_jobPosting.html' %}
{% for job in job_postings %}
{% include 'blackboard/partials/_show_job_posting.html' %}
{% endfor %}
</div>
</div>