generated from MinBZK/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
101 changed files
with
1,578 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[jinja2: **/templates/**.jinja] | ||
[jinja2: **/templates/**.j2] | ||
extensions=jinja2.ext.i18n | ||
silent=False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
from fastapi import APIRouter | ||
|
||
from tad.api.routes import health, pages, root, tasks | ||
from tad.api.routes import health, pages, project, projects, root, tasks | ||
|
||
api_router = APIRouter() | ||
api_router.include_router(root.router) | ||
api_router.include_router(health.router, prefix="/health", tags=["health"]) | ||
api_router.include_router(pages.router, prefix="/pages", tags=["pages"]) | ||
api_router.include_router(tasks.router, prefix="/tasks", tags=["tasks"]) | ||
api_router.include_router(projects.router, prefix="/projects", tags=["projects"]) | ||
api_router.include_router(project.router, prefix="/project", tags=["projects"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import logging | ||
from typing import Annotated | ||
|
||
from fastapi import APIRouter, Depends, Request | ||
from fastapi.responses import HTMLResponse | ||
|
||
from tad.api.deps import templates | ||
from tad.services.projects import ProjectsService | ||
from tad.services.statuses import StatusesService | ||
from tad.services.tasks import TasksService | ||
|
||
router = APIRouter() | ||
logger = logging.getLogger(__name__) | ||
|
||
|
||
@router.get("/{project_id}") | ||
async def get_root( | ||
request: Request, | ||
project_id: int, | ||
projects_service: Annotated[ProjectsService, Depends(ProjectsService)], | ||
status_service: Annotated[StatusesService, Depends(StatusesService)], | ||
tasks_service: Annotated[TasksService, Depends(TasksService)], | ||
) -> HTMLResponse: | ||
project = projects_service.get(project_id) | ||
|
||
context = { | ||
"tasks_service": tasks_service, | ||
"statuses_service": status_service, | ||
"project": project, | ||
} | ||
|
||
if not project: | ||
return templates.TemplateResponse(request, "pages/404.html.j2") | ||
|
||
return templates.TemplateResponse(request, "pages/index.html.j2", context) |
Oops, something went wrong.