Skip to content
Snippets Groups Projects
Commit 7c1b1d4f authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Closes #2172; Accepts markdown for room topic.

parent cca5efa9
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@
{{#if editing 'roomTopic'}}
<input type="text" name="roomTopic" value="{{roomTopic}}" class="editing" /> <button type="button" class="button secondary cancel">{{_ "Cancel"}}</button> <button type="button" class="button primary save">{{_ "Save"}}</button>
{{else}}
<span>{{roomTopic}}{{#if canEdit}} <i class="octicon octicon-pencil" data-edit="roomTopic"></i>{{/if}}</span>
<span>{{{RocketChatMarkdown roomTopic}}}{{#if canEdit}} <i class="octicon octicon-pencil" data-edit="roomTopic"></i>{{/if}}</span>
{{/if}}
</div>
</li>
......
......@@ -80,24 +80,30 @@ Template.message.onCreated ->
@wasEdited = msg.editedAt? and not RocketChat.MessageTypes.isSystemMessage(msg)
@body = do ->
isSystemMessage = RocketChat.MessageTypes.isSystemMessage(msg)
messageType = RocketChat.MessageTypes.getType(msg)
if messageType?.render?
return messageType.render(msg)
msg = messageType.render(msg)
else if messageType?.template?
# render template
else if messageType?.message?
if messageType.data?(msg)?
return TAPi18n.__(messageType.message, messageType.data(msg))
msg = TAPi18n.__(messageType.message, messageType.data(msg))
else
return TAPi18n.__(messageType.message)
msg = TAPi18n.__(messageType.message)
else
if msg.u?.username is RocketChat.settings.get('Chatops_Username')
msg.html = msg.msg
message = RocketChat.callbacks.run 'renderMentions', msg
msg = RocketChat.callbacks.run 'renderMentions', msg
# console.log JSON.stringify message
return msg.html
msg = msg.html
else
msg = renderMessageBody msg
return renderMessageBody msg
if isSystemMessage
return RocketChat.Markdown msg
else
return msg
Template.message.onViewRendered = (context) ->
view = this
......
......@@ -14,7 +14,7 @@
{{/if}}
<i class="{{roomIcon}} status-{{userStatus}}"></i>
<span class="room-title">{{roomName}}</span>
<span class="room-topic">{{roomTopic}}</span>
<span class="room-topic">{{{RocketChatMarkdown roomTopic}}}</span>
</h2>
</header>
<div class="container-bars">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment