#!/usr/bin/env python3 """ Move time tracking section from right column to left column with inline quick-add """ # Read the file with open('app/modules/sag/templates/detail.html', 'r', encoding='utf-8') as f: lines = f.readlines() # Find the insertion point in left column (before that closes left column around line 2665) # and the section to remove in right column (around lines 2813-2865) # First, find where to insert (before the that closes left column) insert_index = None for i, line in enumerate(lines): if i >= 2660 and i <= 2670: if '' in line and 'col-lg-4' in lines[i+1]: insert_index = i break print(f"Found insert point at line {insert_index + 1}") # Find where to remove (the time card in right column) remove_start = None remove_end = None for i, line in enumerate(lines): if i >= 2810 and i <= 2820: if 'data-module="time"' in line: remove_start = i - 1 # Start from blank line before break if remove_start: # Find the end of this card for i in range(remove_start, min(remove_start + 100, len(lines))): if '' in lines[i] and i > remove_start + 50: # Make sure we've gone past the card content remove_end = i + 1 # Include the closing div break print(f"Found remove section from line {remove_start + 1} to {remove_end + 1}") # Create the new time tracking section with inline quick-add new_time_section = '''
| Dato | Beskrivelse | Bruger | Timer |
|---|---|---|---|
| {{ entry.worked_date }} | {{ entry.description or '-' }} | {{ entry.user_name }} | {{ entry.original_hours }} |
| Ingen tid registreret | |||