forked from AFPy/afpy.org
fix: #79
This commit is contained in:
parent
b3267dc0c7
commit
10abe6b9b8
|
@ -8,6 +8,7 @@ from flask import render_template
|
|||
from flask import send_from_directory
|
||||
from peewee import DoesNotExist
|
||||
|
||||
from afpy.models.JobPost import JobPost
|
||||
from afpy.models.NewsEntry import NewsEntry
|
||||
from afpy import config
|
||||
|
||||
|
@ -49,6 +50,18 @@ def render_rest(name):
|
|||
return render_template("pages/rst.html", body_id=name, html=parts["body"], title=parts["title"])
|
||||
|
||||
|
||||
@home_bp.route("/status")
|
||||
def status():
|
||||
return {
|
||||
"actualites": {
|
||||
"waiting": NewsEntry.select().where(NewsEntry.state == "waiting").count(),
|
||||
},
|
||||
"emplois": {
|
||||
"waiting": JobPost.select().where(JobPost.state == "waiting").count(),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@home_bp.route("/posts/<int:post_id>")
|
||||
def post_render(post_id: int):
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue
Block a user