import sys
file_path = 'core/templates/core/view_signs.html'
with open(file_path, 'r') as f:
content = f.read()
header_old = '
Voters with Sign | '
header_new = header_old + '\n Sign Type | '
content = content.replace(header_old, header_new)
cell_old = '\n {% endfor %}\n \n '
cell_new = cell_old + '\n \n
{{ household.sign_types_display }}
\n | '
content = content.replace(cell_old, cell_new)
icon_old = "icon: 'http://maps.google.com/mapfiles/ms/icons/green-dot.png'"
icon_new = "icon: item.is_large ? 'http://maps.google.com/mapfiles/ms/icons/blue-dot.png' : 'http://maps.google.com/mapfiles/ms/icons/green-dot.png'"
content = content.replace(icon_old, icon_new)
info_old = "votersCount.textContent = 'Voters: ' + item.voters;"
info_new = info_old + "\n \n var typeDiv = document.createElement('div');\n typeDiv.className = 'mb-2 small fw-bold';\n typeDiv.textContent = 'Type: ' + (item.is_large ? 'Large Sign' : 'Yard Sign');\n container.appendChild(typeDiv);"
content = content.replace(info_old, info_new)
with open(file_path, 'w') as f:
f.write(content)