feat: Update UI components with logo integration and styling enhancements
This commit enhances the Layout, Dashboard, Login, and PendingPhotos components by integrating a logo with fallback support and updating various UI styles for improved aesthetics. The Dashboard section's background gradient is replaced with a linear gradient, and text colors are adjusted for better visibility. Additionally, the PendingPhotos component's confirmation messages are clarified, and the cleanup functionality is refined to specify which records are affected. Documentation has been updated to reflect these changes.
This commit is contained in:
@@ -531,13 +531,13 @@ def cleanup_shared_files(
|
||||
@router.post("/cleanup-database", response_model=CleanupResponse)
|
||||
def cleanup_pending_photos_database(
|
||||
current_admin: dict = Depends(get_current_admin_user),
|
||||
status_filter: Optional[str] = Query(None, description="Filter by status: 'approved', 'rejected', or None for all"),
|
||||
status_filter: Optional[str] = Query(None, description="Filter by status: 'approved', 'rejected', or None for approved+rejected (excludes pending)"),
|
||||
auth_db: Session = Depends(get_auth_db),
|
||||
) -> CleanupResponse:
|
||||
"""Delete records from pending_photos table.
|
||||
|
||||
Args:
|
||||
status_filter: Optional filter - 'approved', 'rejected', or None for all records
|
||||
status_filter: Optional filter - 'approved', 'rejected', or None for approved+rejected (excludes pending)
|
||||
"""
|
||||
deleted_records = 0
|
||||
errors = []
|
||||
@@ -545,9 +545,18 @@ def cleanup_pending_photos_database(
|
||||
|
||||
try:
|
||||
# First check if table exists and has records
|
||||
check_result = auth_db.execute(text("""
|
||||
SELECT COUNT(*) as count FROM pending_photos
|
||||
"""))
|
||||
if status_filter:
|
||||
# Check count for specific status
|
||||
check_result = auth_db.execute(text("""
|
||||
SELECT COUNT(*) as count FROM pending_photos
|
||||
WHERE status = :status_filter
|
||||
"""), {"status_filter": status_filter})
|
||||
else:
|
||||
# Check count for approved and rejected (exclude pending)
|
||||
check_result = auth_db.execute(text("""
|
||||
SELECT COUNT(*) as count FROM pending_photos
|
||||
WHERE status IN ('approved', 'rejected')
|
||||
"""))
|
||||
total_count = check_result.fetchone().count if check_result else 0
|
||||
|
||||
if total_count == 0:
|
||||
@@ -566,8 +575,10 @@ def cleanup_pending_photos_database(
|
||||
WHERE status = :status_filter
|
||||
"""), {"status_filter": status_filter})
|
||||
else:
|
||||
# Default behavior: delete only approved and rejected, exclude pending
|
||||
result = auth_db.execute(text("""
|
||||
DELETE FROM pending_photos
|
||||
WHERE status IN ('approved', 'rejected')
|
||||
"""))
|
||||
|
||||
deleted_records = result.rowcount if hasattr(result, 'rowcount') else 0
|
||||
|
||||
Reference in New Issue
Block a user