add article and pubications
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import flet as ft
|
||||
from pages.documents.ba import Documents
|
||||
from pages.publications.articles import Articles as ExpertArticlesPage
|
||||
from pages.settings.settings import Settings
|
||||
|
||||
class NavigationBA:
|
||||
@@ -13,8 +14,8 @@ class NavigationBA:
|
||||
label="Documente Custom",
|
||||
)
|
||||
self.articole_si_publicatii = ft.NavigationRailDestination(
|
||||
icon=ft.Icons.ARTICLE_OUTLINED,
|
||||
selected_icon=ft.Icons.ARTICLE,
|
||||
icon=ft.Icons.MENU_BOOK_OUTLINED, # Icon mai potrivit pentru articole/blog
|
||||
selected_icon=ft.Icons.MENU_BOOK,
|
||||
label="Articole si Publicatii",
|
||||
)
|
||||
self.comunicare = ft.NavigationRailDestination(
|
||||
@@ -61,12 +62,7 @@ class NavigationBA:
|
||||
def build(self):
|
||||
return [
|
||||
self.documente_juridice,
|
||||
# self.articole_si_publicatii,
|
||||
# self.comunicare,
|
||||
# self.consultanta,
|
||||
# self.convocator,
|
||||
# self.licitatii_si_lucrari,
|
||||
# self.profil,
|
||||
self.articole_si_publicatii,
|
||||
self.abonamente,
|
||||
self.setari,
|
||||
self.logout
|
||||
@@ -76,21 +72,31 @@ class NavigationBA:
|
||||
self.docs = Documents(self.page, self.home)
|
||||
return self.docs.build()
|
||||
|
||||
def build_articole_si_publicatii_expert(self):
|
||||
self.articles_page = ExpertArticlesPage(self.page, self.home)
|
||||
return self.articles_page.build()
|
||||
|
||||
def build_subscriptions(self):
|
||||
from pages.subscriptions.subscriptions import SubscriptionsPage
|
||||
self.subs_page = SubscriptionsPage(self.page)
|
||||
return self.subs_page.build()
|
||||
|
||||
async def on_nav_change(self, e):
|
||||
print( "Selected destination:", e.control.selected_index)
|
||||
if e.control.selected_index == 0:
|
||||
self.home.placeholder.content = self.build_documente_juridice()
|
||||
self.page.update()
|
||||
|
||||
if e.control.selected_index == 1:
|
||||
pass
|
||||
|
||||
if e.control.selected_index == 2:
|
||||
elif e.control.selected_index == 1: # Index for Articole si Publicatii
|
||||
self.home.placeholder.content = self.build_articole_si_publicatii_expert()
|
||||
self.page.update()
|
||||
elif e.control.selected_index == 2: # Abonamente
|
||||
self.home.placeholder.content = self.build_subscriptions()
|
||||
self.page.update()
|
||||
elif e.control.selected_index == 3: # Setari
|
||||
self.settings = Settings(self.page, self)
|
||||
self.home.placeholder.content = self.settings.build()
|
||||
self.page.update() # Actualizează întreaga pagină inclusiv overlay-ul
|
||||
|
||||
if e.control.selected_index == 3:
|
||||
elif e.control.selected_index == 4: # Logout
|
||||
await ft.SharedPreferences().clear()
|
||||
self.page.session.store.clear()
|
||||
self.page.go('/auth')
|
||||
@@ -1,5 +1,6 @@
|
||||
import flet as ft
|
||||
from pages.documents.home import DocumentsHome
|
||||
from pages.publications.articles import Articles as ClientArticlesPage
|
||||
|
||||
class NavigationUser:
|
||||
def __init__(self, page: ft.Page, home):
|
||||
@@ -12,8 +13,8 @@ class NavigationUser:
|
||||
label="Documente Juridice",
|
||||
)
|
||||
self.articole_si_publicatii = ft.NavigationRailDestination(
|
||||
icon=ft.Icons.ARTICLE_OUTLINED,
|
||||
selected_icon=ft.Icons.ARTICLE,
|
||||
icon=ft.Icons.MENU_BOOK_OUTLINED, # Icon mai potrivit pentru articole/blog
|
||||
selected_icon=ft.Icons.MENU_BOOK,
|
||||
label="Articole si Publicatii",
|
||||
)
|
||||
self.comunicare = ft.NavigationRailDestination(
|
||||
@@ -75,19 +76,23 @@ class NavigationUser:
|
||||
self.docs = DocumentsHome(self.page, self.home)
|
||||
return self.docs.build()
|
||||
|
||||
def build_articole_si_publicatii_client(self):
|
||||
self.articles_page = ClientArticlesPage(self.page, self.home)
|
||||
return self.articles_page.build()
|
||||
|
||||
async def on_nav_change(self, e):
|
||||
print( "Selected destination:", e.control.selected_index)
|
||||
if e.control.selected_index == 0:
|
||||
self.home.placeholder.content = self.build_documente_juridice()
|
||||
self.page.update()
|
||||
|
||||
if e.control.selected_index == 1:
|
||||
pass
|
||||
elif e.control.selected_index == 1: # Index for Articole si Publicatii
|
||||
self.home.placeholder.content = self.build_articole_si_publicatii_client()
|
||||
self.page.update()
|
||||
|
||||
if e.control.selected_index == 2:
|
||||
pass
|
||||
|
||||
if e.control.selected_index == 3:
|
||||
if e.control.selected_index == 9:
|
||||
await ft.SharedPreferences().clear()
|
||||
self.page.session.store.clear()
|
||||
self.page.go('/auth')
|
||||
Reference in New Issue
Block a user