more stuff

This commit is contained in:
2025-09-06 11:11:48 +02:00
parent bae1572d3f
commit a4bf07a3b6
13 changed files with 949 additions and 422 deletions

View File

@@ -25,6 +25,26 @@ class ActiveCustomerCard:
customer_label.set_halign(Gtk.Align.START)
card_vbox.pack_start(customer_label, False, False, 0)
# Customer services section
if self.customer.services:
services_label = Gtk.Label()
services_label.set_markup("<b>Cloud Services</b>")
services_label.set_halign(Gtk.Align.START)
services_label.set_margin_top(8)
card_vbox.pack_start(services_label, False, False, 0)
# Services box with indent
services_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=8)
services_box.set_margin_start(16)
services_box.set_margin_bottom(8)
card_vbox.pack_start(services_box, False, False, 0)
for service in self.customer.services:
service_btn = Gtk.Button(label=service.name)
service_btn.get_style_context().add_class("suggested-action")
service_btn.connect("clicked", lambda btn, s=service: self.callbacks['open_customer_service'](s))
services_box.pack_start(service_btn, False, False, 0)
# Locations section
for i, location in enumerate(self.customer.locations):
if i > 0: # Add separator between locations
@@ -60,6 +80,26 @@ class InactiveCustomerCard:
customer_label.set_halign(Gtk.Align.START)
card_vbox.pack_start(customer_label, False, False, 0)
# Customer services section - list format for inactive
if self.customer.services:
services_label = Gtk.Label()
services_label.set_markup("<span alpha='60%'><b>Cloud Services</b></span>")
services_label.set_halign(Gtk.Align.START)
services_label.set_margin_top(8)
card_vbox.pack_start(services_label, False, False, 0)
# Services list with indent
services_vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=2)
services_vbox.set_margin_start(16)
services_vbox.set_margin_bottom(8)
card_vbox.pack_start(services_vbox, False, False, 0)
for service in self.customer.services:
service_label = Gtk.Label()
service_label.set_markup(f"<span alpha='60%'><small>• {service.name} ({service.service_type})</small></span>")
service_label.set_halign(Gtk.Align.START)
services_vbox.pack_start(service_label, False, False, 0)
# Locations section
for i, location in enumerate(self.customer.locations):
if i > 0: # Add separator between locations

View File

@@ -132,13 +132,25 @@ class InactiveLocationCard:
details_label.set_halign(Gtk.Align.START)
info_vbox.pack_start(details_label, False, False, 0)
# Button box for multiple buttons
button_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=4)
location_hbox.pack_end(button_box, False, False, 0)
# Set as Current button
current_btn = Gtk.Button(label="Set as Current")
current_btn.connect("clicked", self._on_set_current_clicked)
button_box.pack_start(current_btn, False, False, 0)
# Activate button
activate_btn = Gtk.Button(label="Set Active")
activate_btn.get_style_context().add_class("suggested-action")
activate_btn.connect("clicked", self._on_activate_clicked)
location_hbox.pack_end(activate_btn, False, False, 0)
button_box.pack_start(activate_btn, False, False, 0)
return location_hbox
def _on_activate_clicked(self, button):
self.callbacks['set_location_active'](self.location, self.customer_name)
self.callbacks['set_location_active'](self.location, self.customer_name)
def _on_set_current_clicked(self, button):
self.callbacks['set_current_location'](self.location, self.customer_name)