
from pathlib import Path

path = Path(
    "/home/skeversu/skever-portal-staging/templates/dashboard.html"
)

source = path.read_text(encoding="utf-8")
lines = source.splitlines()

needle = "no operational dashboard permissions"
matches = [
    i for i, line in enumerate(lines)
    if needle in line.lower()
]

print("TEMPLATE:", path)
print("MATCHES:", len(matches))

for match in matches:
    start = max(0, match - 8)
    end = min(len(lines), match + 9)
    print("\n--- NOTICE CONDITION ---")
    for number in range(start, end):
        print(f"{number + 1}: {lines[number]}")
