Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
e8f1f6d5
Commit
e8f1f6d5
authored
May 20, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass both hat title and URI to template
parent
ca7adeed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
src/converse-message-view.js
src/converse-message-view.js
+1
-2
src/templates/message.html
src/templates/message.html
+1
-1
No files found.
src/converse-message-view.js
View file @
e8f1f6d5
...
...
@@ -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
'
)
||
[];
}
}
...
...
src/templates/message.html
View file @
e8f1f6d5
...
...
@@ -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>
{[ } ]}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment