overleaf/services/web/app/views/project/editor/chat.pug

57 lines
1.9 KiB
Text
Raw Normal View History

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()"
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(
ng-style="getMessageStyle(message.user);"
2014-07-02 10:56:09 -04:00
)
.arrow(ng-style="getArrowStyle(message.user)")
.message-content
p(
mathjax,
ng-repeat="content in message.contents track by $index"
)
span(ng-bind-html="content | linky:'_blank'")
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