{% macro render_inline(udoc, avatar=true, badge=true, modbadge=true, levelbadge=true, noLink=false, isModType=false, userProfile=false, trainingUdict=false, showDisplayName=true, usernameLimit=0) %} {% if udoc %} {% if avatar %} {% endif %} {% if noLink === false %} usernameLimit %} title="{{ udoc.uname }}" aria-label="{{ udoc.uname }}"{% endif %}>{% endif %} {% if userProfile %} {% elif noLink %} {% if isModType %} {% else %} {% endif %} {% else %} {% if udoc and udoc.hasPriv and udoc.hasPerm %} {% if udoc.hasPriv(PRIV.PRIV_MOD_BADGE) %} {% elif udoc.hasPerm(perm.PERM_MOD_BADGE) %} {% else %} {% endif %} {% else %} {% endif %} {% endif %} {% if showDisplayName and trainingUdict %} {{ udoc.displayName }} ({{ udoc.uname }}) {% elif showDisplayName and handler.user.hasPerm(perm.PERM_VIEW_DISPLAYNAME) and udoc.displayName and udoc.displayName != udoc.uname and noLink === false %} {% if userProfile %} {{ udoc.uname }} ({{ udoc.displayName }}) {% else %} {{ udoc.displayName }} ({{ udoc.uname }}) {% endif %} {% elif usernameLimit and udoc.uname|length > usernameLimit %} {{ udoc.uname|truncate(usernameLimit - 1, true, '…') }} {% else %} {{ udoc.uname }} {% endif %} {% if noLink === false %}{% endif %} {% if badge %} {% if udoc.badge %} {% set _badge = udoc.badge.split('#') %} {{ _badge[0] }} {% endif %} {% if modbadge %} {% if udoc.hasPriv(PRIV.PRIV_MOD_BADGE) %} SU {% elif udoc.hasPerm(perm.PERM_MOD_BADGE) %} MOD {% endif %} {% endif %} {% endif %} {% else %} {% if avatar %} {% endif %} {{ _('Unknown User') }} {% if badge %} LV 0 {% endif %} {% endif %} {% endmacro %}