47 lines
1.5 KiB
Python
47 lines
1.5 KiB
Python
import flet as ft
|
|
import designer as ds
|
|
from views.content_users.response_page import ResponsePage
|
|
|
|
|
|
class ResponseView(ft.View):
|
|
def __init__(self, page: ft.Page, response_id: str):
|
|
url_key = page.session.store.get("url_key") or ""
|
|
|
|
back_btn = ft.IconButton(
|
|
icon=ft.Icons.ARROW_BACK,
|
|
icon_color=ds.clolors.ferst,
|
|
on_click=lambda _: page.go(f"/my_tests/{url_key}"),
|
|
)
|
|
|
|
self._content = ResponsePage(page, response_id)
|
|
|
|
super().__init__(
|
|
route=f"/response/{url_key}/{response_id}",
|
|
bgcolor=ds.clolors.background,
|
|
horizontal_alignment=ft.CrossAxisAlignment.STRETCH,
|
|
vertical_alignment=ft.MainAxisAlignment.START,
|
|
scroll=ft.ScrollMode.AUTO,
|
|
controls=[
|
|
ft.Column(
|
|
expand=True,
|
|
spacing=10,
|
|
controls=[
|
|
ft.Row(
|
|
controls=[
|
|
back_btn,
|
|
ds.CastomText(
|
|
text="Результаты теста",
|
|
size=22,
|
|
weight=ft.FontWeight.BOLD,
|
|
),
|
|
]
|
|
),
|
|
self._content,
|
|
],
|
|
)
|
|
],
|
|
)
|
|
|
|
async def load(self):
|
|
await self._content.load()
|