2014-07-02 10:56:09 -04:00
|
|
|
aside.chat(
|
2014-07-21 07:19:13 -04:00
|
|
|
ng-controller="ChatController",
|
|
|
|
ng-if="!anonymous"
|
2014-07-02 10:56:09 -04:00
|
|
|
)
|
|
|
|
.messages(
|
2014-07-15 13:25:12 -04:00
|
|
|
infinite-scroll="loadMoreMessages()"
|
2015-01-26 10:36:34 -05:00
|
|
|
infinite-scroll-disabled="chat.loading || chat.atEnd || chat.errored"
|
2014-07-02 10:56:09 -04:00
|
|
|
infinite-scroll-initialize="ui.chatOpen"
|
2014-07-15 13:25:12 -04:00
|
|
|
infinite-scroll-upwards="true"
|
2014-07-16 05:52:06 -04:00
|
|
|
update-scroll-bottom-on="updateScrollPosition"
|
2014-07-02 10:56:09 -04:00
|
|
|
)
|
|
|
|
.infinite-scroll-inner
|
2014-07-15 13:25:12 -04:00
|
|
|
.loading(ng-show="chat.loading")
|
|
|
|
i.fa.fa-fw.fa-spin.fa-refresh
|
2014-07-31 12:07:43 -04:00
|
|
|
| #{translate("loading")}...
|
2014-07-21 07:19:13 -04:00
|
|
|
.no-messages.text-center.small(ng-show='!chat.loading && chat.messages.length == 0')
|
2014-07-31 12:07:43 -04:00
|
|
|
| #{translate("no_messages")}
|
2014-07-21 07:19:13 -04:00
|
|
|
.first-message.text-center(ng-show='!chat.loading && chat.messages.length == 0')
|
2014-07-31 12:07:43 -04:00
|
|
|
| #{translate("send_first_message")}
|
2014-07-21 07:19:13 -04:00
|
|
|
br
|
|
|
|
i.fa.fa-arrow-down
|
2014-07-17 06:05:08 -04:00
|
|
|
ul.list-unstyled(
|
|
|
|
ng-click="resetUnreadMessages()"
|
|
|
|
)
|
2014-07-02 10:56:09 -04:00
|
|
|
li.message(
|
2014-07-15 13:25:12 -04:00
|
|
|
ng-repeat="message in chat.messages"
|
2014-07-02 10:56:09 -04:00
|
|
|
ng-controller="ChatMessageController"
|
|
|
|
ng-class="{'self': message.user.id == user.id }"
|
|
|
|
)
|
2014-08-07 08:56:04 -04:00
|
|
|
div.date(ng-if="$index == 0 || (message.timestamp - chat.messages[$index - 1].timestamp) > 5 * 60 * 1000") {{ message.timestamp | formatDate:'h:mm a' }} {{ message.timestamp | relativeDate }}
|
2014-07-02 10:56:09 -04:00
|
|
|
span.avatar
|
2014-07-17 06:07:34 -04:00
|
|
|
img(ng-src="{{message.user.gravatar_url}}?d=mm&s=50")
|
2014-07-02 10:56:09 -04:00
|
|
|
div.message-wrapper
|
2015-02-05 08:05:57 -05:00
|
|
|
.name(ng-if="message.user.id != user.id")
|
|
|
|
span(ng-if="message.user.first_name") {{ message.user.first_name }}
|
|
|
|
span(ng-if="!message.user.first_name") {{ message.user.email }}
|
2014-07-02 10:56:09 -04:00
|
|
|
.message(
|
2017-12-13 07:16:21 -05:00
|
|
|
ng-style="getMessageStyle(message.user);"
|
2014-07-02 10:56:09 -04:00
|
|
|
)
|
2017-12-13 07:16:21 -05:00
|
|
|
.arrow(ng-style="getArrowStyle(message.user)")
|
2016-08-22 11:12:29 -04:00
|
|
|
.message-content
|
|
|
|
p(
|
|
|
|
mathjax,
|
2019-03-18 07:59:46 -04:00
|
|
|
mathjax-allow-html="true",
|
2016-08-22 11:12:29 -04:00
|
|
|
ng-repeat="content in message.contents track by $index"
|
|
|
|
)
|
2019-01-29 05:10:03 -05:00
|
|
|
span(ng-bind-html="content | linky:'_blank':{rel: 'noreferrer noopener'}")
|
2014-07-02 10:56:09 -04:00
|
|
|
|
|
|
|
.new-message
|
2014-07-17 06:05:08 -04:00
|
|
|
textarea(
|
2017-01-31 09:57:22 -05:00
|
|
|
placeholder=translate('your_message')+"...",
|
2014-07-17 06:05:08 -04:00
|
|
|
on-enter="sendMessage()",
|
|
|
|
ng-model="newMessageContent",
|
|
|
|
ng-click="resetUnreadMessages()"
|
|
|
|
)
|
2014-07-02 10:56:09 -04:00
|
|
|
|
|
|
|
|