|
4 | 4 | <% if (role === 'admin') { %> |
5 | 5 | <% if (!vars.disableFieldEditing.includes('status')) { %> |
6 | 6 | <div class="inputField active" id="status"> |
7 | | - <h3><%= tenant.customText && tenant.customText.labelStatus ? tenant.customText.labelStatus : 'Status' %>*</h3> |
8 | | - <p><%= tenant.customText && tenant.customText.labelStatusDescription ? tenant.customText.labelStatusDescription : 'Required: Commission status.' %></p> |
| 7 | + <h3><%= tenant.customText?.labelStatus %>*</h3> |
| 8 | + <p><%= tenant.customText?.labelStatusDescription %></p> |
9 | 9 | <select id="statusSelect"> |
10 | 10 | <% vars.possibleStatuses.forEach(option => { %> |
11 | 11 | <option value="<%= option.value %>" <%= (option.value === commission.status) ? 'selected' : '' %>><%= option.label %></option> |
|
15 | 15 | <% } %> |
16 | 16 | <% if (!vars.disableFieldEditing.includes('owner')) { %> |
17 | 17 | <div class="inputField active" id="owner"> |
18 | | - <h3><%= tenant.customText && tenant.customText.labelOwner ? tenant.customText.labelOwner : 'Owner' %>*</h3> |
19 | | - <p><%= tenant.customText && tenant.customText.labelOwnerDescription ? tenant.customText.labelOwnerDescription : 'Required: Commission owner.' %></p> |
| 18 | + <h3><%= tenant.customText?.labelOwner %>*</h3> |
| 19 | + <p><%= tenant.customText?.labelOwnerDescription %></p> |
20 | 20 | <% if ((vars.users || []).filter(user => getUserRole(user) === 'user').length) { %> |
21 | 21 | <select id="ownerSelect"> |
22 | 22 | <option value="">None</option> |
|
31 | 31 | <% } %> |
32 | 32 | <% if (!vars.disableFieldEditing.includes('amount')) { %> |
33 | 33 | <div class="inputField active" id="amount"> |
34 | | - <h3><%= tenant.customText && tenant.customText.labelAmount ? tenant.customText.labelAmount : 'Amount' %></h3> |
35 | | - <p><%= tenant.customText && tenant.customText.labelAmountDescription ? tenant.customText.labelAmountDescription : 'Optional: Commission amount.' %></p> |
| 34 | + <h3><%= tenant.customText?.labelAmount %></h3> |
| 35 | + <p><%= tenant.customText?.labelAmountDescription %></p> |
36 | 36 | <input id="amountInput" type="number" step="0.01" placeholder="<%= (commission.amount !== null) ? commission.amount : '' %>" value="<%= (commission.amount !== null) ? commission.amount : '' %>"> |
37 | 37 | </div> |
38 | 38 | <% } %> |
39 | 39 | <% if (!vars.disableFieldEditing.includes('currency')) { %> |
40 | 40 | <div class="inputField active" id="currency"> |
41 | | - <h3><%= tenant.customText && tenant.customText.labelCurrency ? tenant.customText.labelCurrency : 'Currency' %></h3> |
42 | | - <p><%= tenant.customText && tenant.customText.labelCurrencyDescription ? tenant.customText.labelCurrencyDescription : 'Optional: Commission currency.' %></p> |
| 41 | + <h3><%= tenant.customText?.labelCurrency %></h3> |
| 42 | + <p><%= tenant.customText?.labelCurrencyDescription %></p> |
43 | 43 | <input id="currencyInput" type="text" placeholder="<%= (commission.currency !== null) ? commission.currency : '' %>" value="<%= (commission.currency !== null) ? commission.currency : '' %>"> |
44 | 44 | </div> |
45 | 45 | <% } %> |
46 | 46 | <% if (!vars.disableFieldEditing.includes('date')) { %> |
47 | 47 | <div class="inputField active" id="date"> |
48 | | - <h3><%= tenant.customText && tenant.customText.labelDate ? tenant.customText.labelDate : 'Date' %></h3> |
49 | | - <p><%= tenant.customText && tenant.customText.labelDateDescription ? tenant.customText.labelDateDescription : 'Optional: Commission creation date.' %></p> |
| 48 | + <h3><%= tenant.customText?.labelDate %></h3> |
| 49 | + <p><%= tenant.customText?.labelDateDescription %></p> |
50 | 50 | <input id="dateInput" type="datetime-local" placeholder="<%= (commission.date !== null) ? new Date(commission.date).toISOString().slice(0,16) : '' %>" value="<%= (commission.date !== null) ? new Date(commission.date).toISOString().slice(0,16) : '' %>"> |
51 | 51 | </div> |
52 | 52 | <% } %> |
53 | 53 | <% if (!vars.disableFieldEditing.includes('locked')) { %> |
54 | 54 | <div class="inputField active" id="locked"> |
55 | | - <h3><%= tenant.customText && tenant.customText.labelLocked ? tenant.customText.labelLocked : 'Locked' %></h3> |
56 | | - <p><%= tenant.customText && tenant.customText.labelLockedDescription ? tenant.customText.labelLockedDescription : 'Optional: Whether or not the commission is locked from user editing.' %></p> |
| 55 | + <h3><%= tenant.customText?.labelLocked %></h3> |
| 56 | + <p><%= tenant.customText?.labelLockedDescription %></p> |
57 | 57 | <input id="lockedInput" type="checkbox" class="hidden" <%= commission.locked ? 'checked' : '' %>> |
58 | 58 | <div class="checkbox">|||</div> |
59 | 59 | </div> |
60 | 60 | <% } %> |
61 | 61 | <% if (!vars.disableFieldEditing.includes('assignedTo')) { %> |
62 | 62 | <div class="inputField active" id="assignedTo"> |
63 | | - <h3><%= tenant.customText && tenant.customText.labelAssignedTo ? tenant.customText.labelAssignedTo : 'Assigned To' %></h3> |
64 | | - <p><%= tenant.customText && tenant.customText.labelAssignedToDescription ? tenant.customText.labelAssignedToDescription : 'Optional: The developer to assign this commission to.' %></p> |
| 63 | + <h3><%= tenant.customText?.labelAssignedTo %></h3> |
| 64 | + <p><%= tenant.customText?.labelAssignedToDescription %></p> |
65 | 65 | <% if ((vars.users || []).filter(user => getUserRole(user) !== 'user').length) { %> |
66 | 66 | <select id="assignedToSelect" multiple> |
67 | 67 | <option value="">None</option> |
|
120 | 120 | <tbody> |
121 | 121 | <tr> |
122 | 122 | <th> |
123 | | - <h3><%= tenant.customText && tenant.customText.labelTasks ? tenant.customText.labelTasks : 'Tasks' %></h3> |
| 123 | + <h3><%= tenant.customText?.labelTasks %></h3> |
124 | 124 | </th> |
125 | 125 | </tr> |
126 | 126 | <% commission.tasks.forEach(task => { %> |
|
131 | 131 | <% }) %> |
132 | 132 | <tr> |
133 | 133 | <th> |
134 | | - <div id="addTask" class="button"><%= tenant.customText && tenant.customText.newTaskLabel ? tenant.customText.newTaskLabel : 'New Task' %></div> |
| 134 | + <div id="addTask" class="button"><%= tenant.customText?.newTaskLabel %></div> |
135 | 135 | </th> |
136 | 136 | </tr> |
137 | 137 | </tbody> |
138 | 138 | </table> |
139 | 139 | <div class="inputField active" id="sendEmail"> |
140 | | - <h3><%= tenant.customText && tenant.customText.labelSendEmail ? tenant.customText.labelSendEmail : 'Send Email' %></h3> |
141 | | - <p><%= tenant.customText && tenant.customText.labelSendEmailDescription ? tenant.customText.labelSendEmailDescription : 'Optional: Send an email to the user regarding this update.' %></p> |
| 140 | + <h3><%= tenant.customText?.labelSendEmail %></h3> |
| 141 | + <p><%= tenant.customText?.labelSendEmailDescription %></p> |
142 | 142 | <input id="sendEmailInput" type="checkbox" class="hidden"> |
143 | 143 | <div class="checkbox">|||</div> |
144 | 144 | </div> |
145 | 145 | <% } %> |
146 | 146 | <div class="buttons"> |
147 | | - <% if (!commission.locked || (role !== 'user')) { %><div id="save" class="button"><%= tenant.customText && tenant.customText.saveLabel ? tenant.customText.saveLabel : 'Save' %></div><% } %> |
148 | | - <a id="error" class="button active hidden" href="<%= tenant.domain %><%= tenant.path %>/<%= commission.id %>/edit"><%= tenant.customText && tenant.customText.restartLabel ? tenant.customText.restartLabel : 'Restart' %></a> |
| 147 | + <% if (!commission.locked || (role !== 'user')) { %><div id="save" class="button"><%= tenant.customText?.saveLabel %></div><% } %> |
| 148 | + <a id="error" class="button active hidden" href="<%= tenant.domain %><%= tenant.path %>/<%= commission.id %>/edit"><%= tenant.customText?.restartLabel %></a> |
149 | 149 | </div> |
150 | 150 | <script> |
151 | 151 | const commissionId = '<%= commission.id %>'; |
|
0 commit comments