Commit e8f1f6d5 authored by JC Brand's avatar JC Brand

Pass both hat title and URI to template

parent ca7adeed
......@@ -254,8 +254,7 @@ converse.plugins.add('converse-message-view', {
const role = this.model.vcard ? this.model.vcard.get('role') : null;
hats = role ? role.split(',') : [];
} else {
const o = this.model.occupant;
hats = o && o.get('hats').map(h => h.title).filter(h => h) || [];
hats = this.model.occupant?.get('hats') || [];
}
}
......
......@@ -11,7 +11,7 @@
{[ if (o.is_me_message) { ]}<time timestamp="{{{o.isodate}}}" class="chat-msg__time">{{{o.pretty_time}}}</time>{[ } ]}
<span class="chat-msg__author">{[ if (o.is_me_message) { ]}**{[ }; ]}{{{o.username}}}</span>
{[ if (!o.is_me_message) { ]}
{[o.hats.forEach(function (hat) { ]} <span class="badge badge-secondary">{{{hat}}}</span> {[ }); ]}
{[o.hats.forEach(function (hat) { ]} <span class="badge badge-secondary">{{{hat.title}}}</span> {[ }); ]}
<time timestamp="{{{o.isodate}}}" class="chat-msg__time">{{{o.pretty_time}}}</time>
{[ } ]}
{[ if (o.is_encrypted) { ]}<span class="fa fa-lock"></span>{[ } ]}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment