Clarified distinction between Preferred and Ticketed Name.

This commit is contained in:
Pen Anderson 2026-03-10 15:37:34 -05:00
parent ad8c3a64b6
commit df5a41bae1
3 changed files with 22 additions and 10 deletions

View file

@ -19,6 +19,7 @@
let showAdd = $state(false) let showAdd = $state(false)
let adding = $state(false) let adding = $state(false)
let newName = $state('') let newName = $state('')
let newTicketedName = $state('')
let newEmail = $state('') let newEmail = $state('')
let newPhone = $state('') let newPhone = $state('')
let newPronouns = $state('') let newPronouns = $state('')
@ -27,6 +28,7 @@
// Edit participant // Edit participant
let editId = $state(null) let editId = $state(null)
let editName = $state('') let editName = $state('')
let editTicketedName = $state('')
let editEmail = $state('') let editEmail = $state('')
let editPhone = $state('') let editPhone = $state('')
let editPronouns = $state('') let editPronouns = $state('')
@ -151,12 +153,12 @@
adding = true; error = '' adding = true; error = ''
try { try {
const p = await api.participants.create({ const p = await api.participants.create({
preferred_name: newName, email: newEmail, phone: newPhone, preferred_name: newName, ticket_name: newTicketedName, email: newEmail,
pronouns: newPronouns, note: newNote, phone: newPhone, pronouns: newPronouns, note: newNote,
}) })
await db.participants.put(p) await db.participants.put(p)
showAdd = false showAdd = false
newName = newEmail = newPhone = newPronouns = newNote = '' newName = newTicketedName = newEmail = newPhone = newPronouns = newNote = ''
} catch (err) { } catch (err) {
error = err.message error = err.message
} finally { } finally {
@ -167,6 +169,7 @@
function startEdit(p) { function startEdit(p) {
editId = p.id editId = p.id
editName = p.preferred_name editName = p.preferred_name
editTicketedName = p.ticket_name || ''
editEmail = p.email editEmail = p.email
editPhone = p.phone editPhone = p.phone
editPronouns = p.pronouns editPronouns = p.pronouns
@ -178,8 +181,8 @@
saving = true; error = '' saving = true; error = ''
try { try {
const p = await api.participants.update(editId, { const p = await api.participants.update(editId, {
preferred_name: editName, email: editEmail, phone: editPhone, preferred_name: editName, ticket_name: editTicketedName, email: editEmail,
pronouns: editPronouns, note: editNote, phone: editPhone, pronouns: editPronouns, note: editNote,
}) })
await db.participants.put(p) await db.participants.put(p)
editId = null editId = null
@ -247,9 +250,13 @@
<form onsubmit={addParticipant}> <form onsubmit={addParticipant}>
<div class="form-grid" style="display:grid;grid-template-columns:1fr 1fr;gap:1rem"> <div class="form-grid" style="display:grid;grid-template-columns:1fr 1fr;gap:1rem">
<div class="form-group"> <div class="form-group">
<label for="p-name">Name</label> <label for="p-name">Preferred Name</label>
<input id="p-name" bind:value={newName} placeholder="Preferred name" /> <input id="p-name" bind:value={newName} placeholder="Preferred name" />
</div> </div>
<div class="form-group">
<label for="p-tname">Ticketed Name</label>
<input id="p-tname" bind:value={newTicketedName} placeholder="Legal/ticketed name" />
</div>
<div class="form-group"> <div class="form-group">
<label for="p-email">Email</label> <label for="p-email">Email</label>
<input id="p-email" type="email" bind:value={newEmail} placeholder="email@example.com" /> <input id="p-email" type="email" bind:value={newEmail} placeholder="email@example.com" />
@ -324,7 +331,7 @@
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Preferred Name</th>
<th>Email</th> <th>Email</th>
<th>Tickets</th> <th>Tickets</th>
<th>Status</th> <th>Status</th>
@ -344,6 +351,7 @@
<form class="participant-edit-form" onsubmit={saveEdit}> <form class="participant-edit-form" onsubmit={saveEdit}>
<div class="edit-fields"> <div class="edit-fields">
<input bind:value={editName} placeholder="Preferred name" /> <input bind:value={editName} placeholder="Preferred name" />
<input bind:value={editTicketedName} placeholder="Ticketed name" />
<input type="email" bind:value={editEmail} placeholder="Email" /> <input type="email" bind:value={editEmail} placeholder="Email" />
<input bind:value={editPhone} placeholder="Phone" /> <input bind:value={editPhone} placeholder="Phone" />
<input bind:value={editPronouns} placeholder="Pronouns" /> <input bind:value={editPronouns} placeholder="Pronouns" />

View file

@ -155,7 +155,7 @@
<input id="u-email" type="email" bind:value={newEmail} required placeholder="email@example.com" autocomplete="off" /> <input id="u-email" type="email" bind:value={newEmail} required placeholder="email@example.com" autocomplete="off" />
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="u-name">Name</label> <label for="u-name">Preferred Name</label>
<input id="u-name" bind:value={newName} placeholder="Preferred name" autocomplete="off" /> <input id="u-name" bind:value={newName} placeholder="Preferred name" autocomplete="off" />
</div> </div>
<div class="form-group"> <div class="form-group">
@ -214,7 +214,7 @@
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Preferred Name</th>
<th>Roles</th> <th>Roles</th>
<th>Departments</th> <th>Departments</th>
<th></th> <th></th>

View file

@ -256,7 +256,7 @@
<table> <table>
<thead> <thead>
<tr> <tr>
<th>Name</th> <th>Preferred Name</th>
<th>Department</th> <th>Department</th>
<th>Status</th> <th>Status</th>
<th></th> <th></th>
@ -297,6 +297,7 @@
</tr> </tr>
{:else} {:else}
<tr> <tr>
{@const participant = participantFor(v.participant_id)}
<td class="td-name"> <td class="td-name">
<strong>{v.name}</strong> <strong>{v.name}</strong>
{#if v.is_lead} {#if v.is_lead}
@ -307,6 +308,9 @@
{:else if !participantHasTickets(v.participant_id)} {:else if !participantHasTickets(v.participant_id)}
<span class="badge badge-partial" style="margin-left:0.4rem" title="No ticket on file">No ticket</span> <span class="badge badge-partial" style="margin-left:0.4rem" title="No ticket on file">No ticket</span>
{/if} {/if}
{#if participant?.ticket_name && participant.ticket_name !== v.name}
<div class="text-muted" style="font-size:0.78rem">Ticket: {participant.ticket_name}</div>
{/if}
{#if v.email} {#if v.email}
<div class="text-muted" style="font-size:0.78rem">{v.email}</div> <div class="text-muted" style="font-size:0.78rem">{v.email}</div>
{/if} {/if}