Skip to content

Commit

Permalink
Merge branch 'pdf-editor'
Browse files Browse the repository at this point in the history
  • Loading branch information
theinventor committed Feb 26, 2025
2 parents be0e913 + da3e27d commit de8ba55
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions app/javascript/controllers/field_placement_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ export default class extends Controller {

// Create text content with field type and page number
const textContent = document.createElement("div")
textContent.classList.add("text-sm")
textContent.classList.add("text-sm", "flex", "items-center")

// Get field type display name
let fieldTypeDisplay = ""
Expand All @@ -557,10 +557,22 @@ export default class extends Controller {
case "checkbox": fieldTypeDisplay = "Checkbox"; break
}

textContent.innerHTML = `
// Add color indicator if we have a signer ID
if (fieldData.document_signer_id) {
const signerIndex = this.getSignerIndexById(fieldData.document_signer_id);
if (signerIndex > 0) {
const colorIndicator = document.createElement("div");
colorIndicator.classList.add("w-3", "h-3", "rounded-full", "mr-2", `signer-color-${signerIndex}`);
textContent.appendChild(colorIndicator);
}
}

const textSpan = document.createElement("span");
textSpan.innerHTML = `
<span class="font-medium">${fieldTypeDisplay}</span>
<span class="text-gray-500 ml-2">Page ${fieldData.page_number}</span>
`
`;
textContent.appendChild(textSpan);

// Create delete button
const deleteButton = document.createElement("button")
Expand Down

0 comments on commit de8ba55

Please sign in to comment.