<% // Check to see if the card was created with at least minimum data, not just a peerID, which would indicate a server error. const loaded = !!ob.name; /* Disable the card if it is invalid and the controls should be shown, and it is not selected. This allow the user to de-select invalid cards. The view should prevent the invalid card from being selected again, disabling it is redundant but important visually. */ const isDisabled = (!ob.valid && !ob.controlsOnInvalid ) || (!ob.valid && ob.controlsOnInvalid && ob.cardState !== 'selected') || !loaded ? 'disabled' : ''; const style = ob.verified ? 'verified clrBrAlert2 clrBAlert2Grad' : ''; %>
<% if (ob.radioStyle) { %>
<% const act = ob.cardState === 'selected' ? 'active' : 'inactive'; %> <% // the card state may be set on render or set on the fly by the view %>
<% } %>
<% if (loaded) { %>
<%= ob.name %> <%= ob.handle ? `@${ob.handle}` : '' %>
<% if (ob.valid) { %>
<%=ob.moderatorInfo.description %>
<% if (ob.modLanguages && ob.modLanguages.length) { %>
<% if (ob.modLanguages.length > 1) { print(ob.polyT('moderatorCard.languages', { lang: ob.modLanguages[0], smart_count: ob.modLanguages.length -1 })); } else { %> <%= ob.modLanguages[0] %> <% } %>
<% } %>
<%= ob.parseEmojis('👍') %> XX<% // placeholder for reputation %>
<% var amount = ob.currencyMod.convertAndFormatCurrency(ob.moderatorInfo.fee.fixedFee.amount, ob.moderatorInfo.fee.fixedFee.currencyCode, ob.displayCurrency) %> <%= ob.polyT(`moderatorCard.${ob.moderatorInfo.fee.feeType}`, { amount: amount, percentage: ob.moderatorInfo.fee.percentage }) %>
<%= ob.parseEmojis('📍') %><%= ob.location || ob.polyT('userPage.noLocation') %>
<% } else { %> <%= ob.polyT('moderatorCard.invalid') %> <% } %>
<% } else { %>
<%= ob.peerID %> <%= ob.polyT('moderatorCard.failed') %>
<% } %>
<% if (ob.valid || ob.controlsOnInvalid) { %>
<% if (ob.valid) { %> <% } %> <% if (!ob.radioStyle) { %> <% } %>
<% } %>