feat(backend): design the cli to look professional
This commit is contained in:
@@ -15,46 +15,71 @@ from .commands import (
|
||||
cmd_services_list,
|
||||
)
|
||||
|
||||
# ANSI color codes
|
||||
class Colors:
|
||||
RESET = '\033[0m'
|
||||
BOLD = '\033[1m'
|
||||
DIM = '\033[2m'
|
||||
BLUE = '\033[94m'
|
||||
GREEN = '\033[92m'
|
||||
YELLOW = '\033[93m'
|
||||
RED = '\033[91m'
|
||||
CYAN = '\033[96m'
|
||||
WHITE = '\033[97m'
|
||||
GREY = '\033[90m'
|
||||
BG_GREY = '\033[100m'
|
||||
|
||||
# Special combinations
|
||||
HEADER = '\033[1m\033[96m' # Bold Cyan
|
||||
SUCCESS = '\033[1m\033[92m' # Bold Green
|
||||
ERROR = '\033[1m\033[91m' # Bold Red
|
||||
WARNING = '\033[1m\033[93m' # Bold Yellow
|
||||
INPUT_BOX = '\033[90m' # Grey
|
||||
|
||||
|
||||
def create_input_box(prompt: str, width: int = 60) -> str:
|
||||
"""Create a grey box around input prompt."""
|
||||
box_top = f"{Colors.INPUT_BOX}┌" + "─" * (width - 2) + f"┐{Colors.RESET}"
|
||||
prompt_line = f"{Colors.INPUT_BOX}│{Colors.RESET} {prompt}"
|
||||
padding = width - len(prompt) - 3
|
||||
if padding > 0:
|
||||
prompt_line += " " * padding + f"{Colors.INPUT_BOX}│{Colors.RESET}"
|
||||
else:
|
||||
prompt_line += f" {Colors.INPUT_BOX}│{Colors.RESET}"
|
||||
box_bottom = f"{Colors.INPUT_BOX}└" + "─" * (width - 2) + f"┘{Colors.RESET}"
|
||||
|
||||
return f"\n{box_top}\n{prompt_line}\n{box_bottom}"
|
||||
|
||||
|
||||
def create_simple_input_box(prompt: str) -> str:
|
||||
"""Create a simple grey box around input prompt."""
|
||||
return f"\n{Colors.INPUT_BOX}┌─ {prompt} ─┐{Colors.RESET}"
|
||||
|
||||
|
||||
def clear_screen():
|
||||
"""Clear the terminal screen."""
|
||||
print("\033[2J\033[H")
|
||||
|
||||
|
||||
def load_ascii_art() -> str:
|
||||
"""Load ASCII art from file."""
|
||||
ascii_file = Path(__file__).parent / "ascii.txt"
|
||||
if ascii_file.exists():
|
||||
with open(ascii_file, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
# Use only the cloud portion (middle section) for better display
|
||||
lines = content.strip().split('\n')
|
||||
if len(lines) > 30:
|
||||
# Take a smaller portion of the cloud art
|
||||
start = len(lines) // 3
|
||||
end = start + 15
|
||||
return '\n'.join(lines[start:end])
|
||||
return content
|
||||
return "🎵 NimbusFlow 🎵" # Fallback if file doesn't exist
|
||||
|
||||
|
||||
def display_welcome():
|
||||
"""Display welcome screen with ASCII art."""
|
||||
"""Display welcome screen."""
|
||||
print("\033[2J\033[H") # Clear screen and move cursor to top
|
||||
|
||||
# Display the cloud ASCII art
|
||||
ascii_art = load_ascii_art()
|
||||
print(ascii_art)
|
||||
print()
|
||||
|
||||
# Add the NimbusFlow branding
|
||||
# NimbusFlow branding
|
||||
welcome_text = """
|
||||
╔═══════════════════════════════════════════════════════════════════════════════╗
|
||||
║ ║
|
||||
║ ███╗ ██╗██╗███╗ ███╗██████╗ ██╗ ██╗███████╗ ███████╗██╗ ██████╗ ██╗ ██╗ ║
|
||||
║ ████╗ ██║██║████╗ ████║██╔══██╗██║ ██║██╔════╝ ██╔════╝██║ ██╔═══██╗██║ ██║ ║
|
||||
║ ██╔██╗ ██║██║██╔████╔██║██████╔╝██║ ██║███████╗ █████╗ ██║ ██║ ██║██║ █╗ ██║ ║
|
||||
║ ██║╚██╗██║██║██║╚██╔╝██║██╔══██╗██║ ██║╚════██║ ██╔══╝ ██║ ██║ ██║██║███╗██║ ║
|
||||
║ ██║ ╚████║██║██║ ╚═╝ ██║██████╔╝╚██████╔╝███████║ ██║ ███████╗╚██████╔╝╚███╔███╔╝ ║
|
||||
║ ╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚══╝╚══╝ ║
|
||||
║ ║
|
||||
║ 🎵 Choir Scheduling System 🎵 ║
|
||||
╚═══════════════════════════════════════════════════════════════════════════════╝
|
||||
╔════════════════════════════════════════════════════════════════════════════════════════════╗
|
||||
║ ║
|
||||
║ ███╗ ██╗██╗███╗ ███╗██████╗ ██╗ ██╗███████╗ ███████╗██╗ ██████╗ ██╗ ██╗ ║
|
||||
║ ████╗ ██║██║████╗ ████║██╔══██╗██║ ██║██╔════╝ ██╔════╝██║ ██╔═══██╗██║ ██║ ║
|
||||
║ ██╔██╗ ██║██║██╔████╔██║██████╔╝██║ ██║███████╗ █████╗ ██║ ██║ ██║██║ █╗ ██║ ║
|
||||
║ ██║╚██╗██║██║██║╚██╔╝██║██╔══██╗██║ ██║╚════██║ ██╔══╝ ██║ ██║ ██║██║███╗██║ ║
|
||||
║ ██║ ╚████║██║██║ ╚═╝ ██║██████╔╝╚██████╔╝███████║ ██║ ███████╗╚██████╔╝╚███╔███╔╝ ║
|
||||
║ ╚═╝ ╚═══╝╚═╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚══════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚══╝╚══╝ ║
|
||||
║ ║
|
||||
║ 🎵 Scheduling System 🎵 ║
|
||||
╚════════════════════════════════════════════════════════════════════════════════════════════╝
|
||||
"""
|
||||
print(welcome_text)
|
||||
print()
|
||||
@@ -62,59 +87,55 @@ def display_welcome():
|
||||
|
||||
def display_main_menu():
|
||||
"""Display the main menu options."""
|
||||
print("🎯 " + "="*60)
|
||||
print(" MAIN MENU - What would you like to manage?")
|
||||
print("🎯 " + "="*60)
|
||||
print(f"{Colors.HEADER}Main Menu{Colors.RESET}")
|
||||
print(f"{Colors.GREY}─" * 50 + f"{Colors.RESET}")
|
||||
print()
|
||||
print(" 1️⃣ 👥 Members - Manage choir members")
|
||||
print(" 2️⃣ 📅 Schedules - View and manage schedules")
|
||||
print(" 3️⃣ 🎼 Services - Manage services and events")
|
||||
print(" 4️⃣ ❌ Exit - Close NimbusFlow CLI")
|
||||
print(f" {Colors.CYAN}1.{Colors.RESET} {Colors.BOLD}Members{Colors.RESET} Manage choir members")
|
||||
print(f" {Colors.CYAN}2.{Colors.RESET} {Colors.BOLD}Schedules{Colors.RESET} View and manage schedules")
|
||||
print(f" {Colors.CYAN}3.{Colors.RESET} {Colors.BOLD}Services{Colors.RESET} Manage services and events")
|
||||
print(f" {Colors.CYAN}4.{Colors.RESET} {Colors.BOLD}Exit{Colors.RESET} Close NimbusFlow CLI")
|
||||
print()
|
||||
|
||||
|
||||
def display_members_menu():
|
||||
"""Display members submenu."""
|
||||
print("\n👥 " + "="*50)
|
||||
print(" MEMBERS MENU")
|
||||
print("👥 " + "="*50)
|
||||
print(f"\n{Colors.HEADER}Members{Colors.RESET}")
|
||||
print(f"{Colors.GREY}─" * 50 + f"{Colors.RESET}")
|
||||
print()
|
||||
print(" 1️⃣ 📋 List all members")
|
||||
print(" 2️⃣ ✅ List active members only")
|
||||
print(" 3️⃣ 🎵 List by classification")
|
||||
print(" 4️⃣ 👤 Show member details")
|
||||
print(" 5️⃣ 🔙 Back to main menu")
|
||||
print(f" {Colors.CYAN}1.{Colors.RESET} List all members")
|
||||
print(f" {Colors.CYAN}2.{Colors.RESET} List active members only")
|
||||
print(f" {Colors.CYAN}3.{Colors.RESET} List by classification")
|
||||
print(f" {Colors.CYAN}4.{Colors.RESET} Show member details")
|
||||
print(f" {Colors.CYAN}5.{Colors.RESET} {Colors.DIM}Back to main menu{Colors.RESET}")
|
||||
print()
|
||||
|
||||
|
||||
def display_schedules_menu():
|
||||
"""Display schedules submenu."""
|
||||
print("\n📅 " + "="*50)
|
||||
print(" SCHEDULES MENU")
|
||||
print("📅 " + "="*50)
|
||||
print(f"\n{Colors.HEADER}Schedules{Colors.RESET}")
|
||||
print(f"{Colors.GREY}─" * 50 + f"{Colors.RESET}")
|
||||
print()
|
||||
print(" 1️⃣ 📋 List all schedules")
|
||||
print(" 2️⃣ ⏳ List pending schedules")
|
||||
print(" 3️⃣ ✅ List accepted schedules")
|
||||
print(" 4️⃣ ❌ List declined schedules")
|
||||
print(" 5️⃣ 👤 Show schedule details")
|
||||
print(" 6️⃣ ✨ Accept a schedule (interactive)")
|
||||
print(" 7️⃣ 🚫 Decline a schedule (interactive)")
|
||||
print(" 8️⃣ 📅 Schedule next member for service")
|
||||
print(" 9️⃣ 🔙 Back to main menu")
|
||||
print(f" {Colors.CYAN}1.{Colors.RESET} List all schedules")
|
||||
print(f" {Colors.CYAN}2.{Colors.RESET} List pending schedules")
|
||||
print(f" {Colors.CYAN}3.{Colors.RESET} List accepted schedules")
|
||||
print(f" {Colors.CYAN}4.{Colors.RESET} List declined schedules")
|
||||
print(f" {Colors.CYAN}5.{Colors.RESET} Show schedule details")
|
||||
print(f" {Colors.CYAN}6.{Colors.RESET} {Colors.GREEN}Accept a schedule{Colors.RESET}")
|
||||
print(f" {Colors.CYAN}7.{Colors.RESET} {Colors.RED}Decline a schedule{Colors.RESET}")
|
||||
print(f" {Colors.CYAN}8.{Colors.RESET} {Colors.YELLOW}Schedule next member for service{Colors.RESET}")
|
||||
print(f" {Colors.CYAN}9.{Colors.RESET} {Colors.DIM}Back to main menu{Colors.RESET}")
|
||||
print()
|
||||
|
||||
|
||||
def display_services_menu():
|
||||
"""Display services submenu."""
|
||||
print("\n🎼 " + "="*50)
|
||||
print(" SERVICES MENU")
|
||||
print("🎼 " + "="*50)
|
||||
print(f"\n{Colors.HEADER}Services{Colors.RESET}")
|
||||
print(f"{Colors.GREY}─" * 50 + f"{Colors.RESET}")
|
||||
print()
|
||||
print(" 1️⃣ 📋 List all services")
|
||||
print(" 2️⃣ 🔮 List upcoming services")
|
||||
print(" 3️⃣ 📅 List services by date")
|
||||
print(" 4️⃣ 🔙 Back to main menu")
|
||||
print(f" {Colors.CYAN}1.{Colors.RESET} List all services")
|
||||
print(f" {Colors.CYAN}2.{Colors.RESET} List upcoming services")
|
||||
print(f" {Colors.CYAN}3.{Colors.RESET} List services by date")
|
||||
print(f" {Colors.CYAN}4.{Colors.RESET} {Colors.DIM}Back to main menu{Colors.RESET}")
|
||||
print()
|
||||
|
||||
|
||||
@@ -122,18 +143,19 @@ def get_user_choice(max_options: int) -> int:
|
||||
"""Get user menu choice with validation."""
|
||||
while True:
|
||||
try:
|
||||
choice = input(f"🎯 Enter your choice (1-{max_options}): ").strip()
|
||||
print(create_simple_input_box(f"Enter your choice (1-{max_options})"))
|
||||
choice = input(f"{Colors.INPUT_BOX}└─> {Colors.RESET}").strip()
|
||||
if not choice:
|
||||
continue
|
||||
choice_int = int(choice)
|
||||
if 1 <= choice_int <= max_options:
|
||||
return choice_int
|
||||
else:
|
||||
print(f"❌ Please enter a number between 1 and {max_options}")
|
||||
print(f"{Colors.ERROR}Please enter a number between 1 and {max_options}{Colors.RESET}")
|
||||
except ValueError:
|
||||
print("❌ Please enter a valid number")
|
||||
print(f"{Colors.ERROR}Please enter a valid number{Colors.RESET}")
|
||||
except (KeyboardInterrupt, EOFError):
|
||||
print("\n🛑 Goodbye!")
|
||||
print(f"\n{Colors.WARNING}Goodbye!{Colors.RESET}")
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
@@ -141,12 +163,13 @@ def get_text_input(prompt: str, required: bool = True) -> str:
|
||||
"""Get text input from user."""
|
||||
while True:
|
||||
try:
|
||||
value = input(f"📝 {prompt}: ").strip()
|
||||
print(create_simple_input_box(prompt))
|
||||
value = input(f"{Colors.INPUT_BOX}└─> {Colors.RESET}").strip()
|
||||
if value or not required:
|
||||
return value
|
||||
print("❌ This field is required")
|
||||
print(f"{Colors.ERROR}This field is required{Colors.RESET}")
|
||||
except (KeyboardInterrupt, EOFError):
|
||||
print("\n🛑 Operation cancelled")
|
||||
print(f"\n{Colors.WARNING}Operation cancelled{Colors.RESET}")
|
||||
return ""
|
||||
|
||||
|
||||
@@ -154,18 +177,19 @@ def get_date_input(prompt: str = "Enter date (YYYY-MM-DD)") -> str:
|
||||
"""Get date input from user."""
|
||||
while True:
|
||||
try:
|
||||
date_str = input(f"📅 {prompt}: ").strip()
|
||||
print(create_simple_input_box(prompt))
|
||||
date_str = input(f"{Colors.INPUT_BOX}└─> {Colors.RESET}").strip()
|
||||
if not date_str:
|
||||
print("❌ Date is required")
|
||||
print(f"{Colors.ERROR}Date is required{Colors.RESET}")
|
||||
continue
|
||||
# Basic date format validation
|
||||
if len(date_str) == 10 and date_str.count('-') == 2:
|
||||
parts = date_str.split('-')
|
||||
if len(parts[0]) == 4 and len(parts[1]) == 2 and len(parts[2]) == 2:
|
||||
return date_str
|
||||
print("❌ Please use format YYYY-MM-DD (e.g., 2025-09-07)")
|
||||
print(f"{Colors.ERROR}Please use format YYYY-MM-DD (e.g., 2025-09-07){Colors.RESET}")
|
||||
except (KeyboardInterrupt, EOFError):
|
||||
print("\n🛑 Operation cancelled")
|
||||
print(f"\n{Colors.WARNING}Operation cancelled{Colors.RESET}")
|
||||
return ""
|
||||
|
||||
|
||||
@@ -179,34 +203,41 @@ class MockArgs:
|
||||
def handle_members_menu(cli: "NimbusFlowCLI"):
|
||||
"""Handle members menu interactions."""
|
||||
while True:
|
||||
clear_screen()
|
||||
display_members_menu()
|
||||
choice = get_user_choice(5)
|
||||
|
||||
if choice == 1: # List all members
|
||||
print("\n🔍 Listing all members...")
|
||||
clear_screen()
|
||||
print(f"{Colors.SUCCESS}Listing all members...{Colors.RESET}\n")
|
||||
cmd_members_list(cli, MockArgs(active=False, classification=None))
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 2: # List active members
|
||||
print("\n🔍 Listing active members...")
|
||||
clear_screen()
|
||||
print(f"{Colors.SUCCESS}Listing active members...{Colors.RESET}\n")
|
||||
cmd_members_list(cli, MockArgs(active=True, classification=None))
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 3: # List by classification
|
||||
clear_screen()
|
||||
classification = get_text_input("Enter classification (Soprano, Alto / Mezzo, Tenor, Baritone)", True)
|
||||
if classification:
|
||||
print(f"\n🔍 Listing {classification} members...")
|
||||
clear_screen()
|
||||
print(f"{Colors.SUCCESS}Listing {classification} members...{Colors.RESET}\n")
|
||||
cmd_members_list(cli, MockArgs(active=False, classification=classification))
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 4: # Show member details
|
||||
clear_screen()
|
||||
member_id = get_text_input("Enter member ID", True)
|
||||
if member_id.isdigit():
|
||||
print(f"\n🔍 Showing details for member {member_id}...")
|
||||
clear_screen()
|
||||
print(f"{Colors.SUCCESS}Showing details for member {member_id}...{Colors.RESET}\n")
|
||||
cmd_members_show(cli, MockArgs(member_id=int(member_id)))
|
||||
else:
|
||||
print("❌ Invalid member ID")
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
print(f"{Colors.ERROR}Invalid member ID{Colors.RESET}")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 5: # Back to main menu
|
||||
break
|
||||
@@ -215,59 +246,73 @@ def handle_members_menu(cli: "NimbusFlowCLI"):
|
||||
def handle_schedules_menu(cli: "NimbusFlowCLI"):
|
||||
"""Handle schedules menu interactions."""
|
||||
while True:
|
||||
clear_screen()
|
||||
display_schedules_menu()
|
||||
choice = get_user_choice(9)
|
||||
|
||||
if choice == 1: # List all schedules
|
||||
print("\n🔍 Listing all schedules...")
|
||||
clear_screen()
|
||||
print(f"{Colors.SUCCESS}Listing all schedules...{Colors.RESET}\n")
|
||||
cmd_schedules_list(cli, MockArgs(service_id=None, status=None))
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 2: # List pending schedules
|
||||
print("\n🔍 Listing pending schedules...")
|
||||
clear_screen()
|
||||
print(f"{Colors.WARNING}Listing pending schedules...{Colors.RESET}\n")
|
||||
cmd_schedules_list(cli, MockArgs(service_id=None, status="pending"))
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 3: # List accepted schedules
|
||||
print("\n🔍 Listing accepted schedules...")
|
||||
clear_screen()
|
||||
print(f"{Colors.SUCCESS}Listing accepted schedules...{Colors.RESET}\n")
|
||||
cmd_schedules_list(cli, MockArgs(service_id=None, status="accepted"))
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 4: # List declined schedules
|
||||
print("\n🔍 Listing declined schedules...")
|
||||
clear_screen()
|
||||
print(f"{Colors.ERROR}Listing declined schedules...{Colors.RESET}\n")
|
||||
cmd_schedules_list(cli, MockArgs(service_id=None, status="declined"))
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 5: # Show schedule details
|
||||
clear_screen()
|
||||
schedule_id = get_text_input("Enter schedule ID", True)
|
||||
if schedule_id.isdigit():
|
||||
print(f"\n🔍 Showing details for schedule {schedule_id}...")
|
||||
clear_screen()
|
||||
print(f"{Colors.SUCCESS}Showing details for schedule {schedule_id}...{Colors.RESET}\n")
|
||||
cmd_schedules_show(cli, MockArgs(schedule_id=int(schedule_id)))
|
||||
else:
|
||||
print("❌ Invalid schedule ID")
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
print(f"{Colors.ERROR}Invalid schedule ID{Colors.RESET}")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 6: # Accept schedule
|
||||
clear_screen()
|
||||
date = get_date_input("Enter date for interactive accept")
|
||||
if date:
|
||||
print(f"\n✨ Starting interactive accept for {date}...")
|
||||
clear_screen()
|
||||
print(f"{Colors.SUCCESS}Starting interactive accept for {date}...{Colors.RESET}\n")
|
||||
cmd_schedules_accept(cli, MockArgs(date=date, schedule_id=None))
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 7: # Decline schedule
|
||||
clear_screen()
|
||||
date = get_date_input("Enter date for interactive decline")
|
||||
if date:
|
||||
clear_screen()
|
||||
reason = get_text_input("Enter decline reason (optional)", False)
|
||||
print(f"\n🚫 Starting interactive decline for {date}...")
|
||||
clear_screen()
|
||||
print(f"{Colors.ERROR}Starting interactive decline for {date}...{Colors.RESET}\n")
|
||||
cmd_schedules_decline(cli, MockArgs(date=date, schedule_id=None, reason=reason))
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 8: # Schedule next member
|
||||
clear_screen()
|
||||
date = get_date_input("Enter date to schedule for")
|
||||
if date:
|
||||
print(f"\n📅 Starting scheduling for {date}...")
|
||||
clear_screen()
|
||||
print(f"{Colors.WARNING}Starting scheduling for {date}...{Colors.RESET}\n")
|
||||
cmd_schedules_schedule(cli, MockArgs(service_id=None, date=date, classifications=None))
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 9: # Back to main menu
|
||||
break
|
||||
@@ -276,25 +321,30 @@ def handle_schedules_menu(cli: "NimbusFlowCLI"):
|
||||
def handle_services_menu(cli: "NimbusFlowCLI"):
|
||||
"""Handle services menu interactions."""
|
||||
while True:
|
||||
clear_screen()
|
||||
display_services_menu()
|
||||
choice = get_user_choice(4)
|
||||
|
||||
if choice == 1: # List all services
|
||||
print("\n🔍 Listing all services...")
|
||||
clear_screen()
|
||||
print(f"{Colors.SUCCESS}Listing all services...{Colors.RESET}\n")
|
||||
cmd_services_list(cli, MockArgs(date=None, upcoming=False, limit=None))
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 2: # List upcoming services
|
||||
print("\n🔍 Listing upcoming services...")
|
||||
clear_screen()
|
||||
print(f"{Colors.WARNING}Listing upcoming services...{Colors.RESET}\n")
|
||||
cmd_services_list(cli, MockArgs(date=None, upcoming=True, limit=20))
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 3: # List by date
|
||||
clear_screen()
|
||||
date = get_date_input("Enter date to filter services")
|
||||
if date:
|
||||
print(f"\n🔍 Listing services for {date}...")
|
||||
clear_screen()
|
||||
print(f"{Colors.SUCCESS}Listing services for {date}...{Colors.RESET}\n")
|
||||
cmd_services_list(cli, MockArgs(date=date, upcoming=False, limit=None))
|
||||
input("\n⏸️ Press Enter to continue...")
|
||||
input(f"\n{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
elif choice == 4: # Back to main menu
|
||||
break
|
||||
@@ -304,13 +354,13 @@ def run_interactive_mode(cli: "NimbusFlowCLI"):
|
||||
"""Run the main interactive CLI mode."""
|
||||
display_welcome()
|
||||
|
||||
print("🎉 Welcome to the NimbusFlow Interactive CLI!")
|
||||
print(" Navigate through menus to manage your choir scheduling system.")
|
||||
print(f"{Colors.HEADER}Welcome to the NimbusFlow Interactive CLI{Colors.RESET}")
|
||||
print(f"{Colors.DIM}Navigate through menus to manage your choir scheduling system.{Colors.RESET}")
|
||||
print()
|
||||
input("⏸️ Press Enter to continue...")
|
||||
input(f"{Colors.DIM}Press Enter to continue...{Colors.RESET}")
|
||||
|
||||
while True:
|
||||
print("\033[2J\033[H") # Clear screen
|
||||
clear_screen() # Clear screen
|
||||
display_main_menu()
|
||||
|
||||
choice = get_user_choice(4)
|
||||
@@ -325,6 +375,7 @@ def run_interactive_mode(cli: "NimbusFlowCLI"):
|
||||
handle_services_menu(cli)
|
||||
|
||||
elif choice == 4: # Exit
|
||||
print("\n🎵 Thank you for using NimbusFlow!")
|
||||
print(" Have a wonderful day! 🌟")
|
||||
clear_screen()
|
||||
print(f"\n{Colors.SUCCESS}Thank you for using NimbusFlow!{Colors.RESET}")
|
||||
print(f"{Colors.DIM}Goodbye!{Colors.RESET}")
|
||||
break
|
||||
Reference in New Issue
Block a user