add about us

This commit is contained in:
2025-11-06 17:39:35 +02:00
parent d29b5e9015
commit b77aa0f0d7
14 changed files with 339 additions and 2 deletions

View File

@@ -0,0 +1,40 @@
import flet as ft
import json
class ConfidentialtyPolicy:
def __init__(self, page: ft.Page):
self.page = page
def load_data(self):
try:
with open('instance/policies.json', 'r', encoding='utf-8') as f:
data = json.load(f)
return data
except FileNotFoundError:
return {
'confidentialty_policy': '',
'delivery_policy': '',
'cancel_policy': '',
'gdpr': '',
'terms_and_conditions': ''
}
except json.JSONDecodeError:
self.page.snack_bar = ft.SnackBar(ft.Text('Eroare: fișierul policies.json este corupt.'))
self.page.snack_bar.open = True
self.page.update()
return None
except Exception as ex:
self.page.snack_bar = ft.SnackBar(ft.Text(f'Eroare la citirea politicilor: {ex}'))
self.page.snack_bar.open = True
self.page.update()
return None
def build(self):
return ft.Container(
content=ft.Column(
[
ft.Text("Termeni si conditii",size = 18, weight=ft.FontWeight.BOLD),
ft.Text(value=self.load_data()['confidentialty_policy'])
]
)
)