49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
import flet as ft
|
|
import designer as ds
|
|
from info import AuthService
|
|
from views.content_users.main_page import MainPageUser
|
|
|
|
|
|
class UserView(ft.View):
|
|
def __init__(self, page: ft.Page):
|
|
self._auth = AuthService(page)
|
|
url_key = page.session.store.get("url_key") or ""
|
|
|
|
profile_btn = ft.IconButton(
|
|
icon=ft.Icons.ACCOUNT_CIRCLE,
|
|
icon_color=ds.colors.primary,
|
|
icon_size=ds.s(30),
|
|
tooltip="Профиль",
|
|
on_click=lambda _: page.go(f"/profile/{url_key}"),
|
|
)
|
|
|
|
super().__init__(
|
|
route=f"/user/{url_key}",
|
|
bgcolor=ds.colors.background,
|
|
horizontal_alignment=ft.CrossAxisAlignment.STRETCH,
|
|
vertical_alignment=ft.MainAxisAlignment.START,
|
|
padding=ft.padding.symmetric(horizontal=ds.s(12), vertical=ds.s(8)),
|
|
scroll=ft.ScrollMode.AUTO,
|
|
)
|
|
self.controls = [
|
|
ft.Column(
|
|
spacing=ds.s(12),
|
|
controls=[
|
|
ft.Row(
|
|
alignment=ft.MainAxisAlignment.SPACE_BETWEEN,
|
|
controls=[
|
|
ft.Text(
|
|
"Добро пожаловать в ЦОПП!",
|
|
color=ds.colors.primary,
|
|
size=ds.s(20),
|
|
weight=ft.FontWeight.BOLD,
|
|
expand=True,
|
|
),
|
|
profile_btn,
|
|
]
|
|
),
|
|
MainPageUser(page),
|
|
]
|
|
)
|
|
]
|