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

59 lines
2 KiB
Text
Raw Normal View History

2014-07-02 14:56:09 +00:00
aside.chat(
2014-07-21 11:19:13 +00:00
ng-controller="ChatController",
ng-if="!anonymous"
2014-07-02 14:56:09 +00:00
)
.messages(
2014-07-15 17:25:12 +00:00
infinite-scroll="loadMoreMessages()"
infinite-scroll-disabled="chat.loading || chat.atEnd || chat.errored"
2014-07-02 14:56:09 +00:00
infinite-scroll-initialize="ui.chatOpen"
2014-07-15 17:25:12 +00:00
infinite-scroll-upwards="true"
2014-07-16 09:52:06 +00:00
update-scroll-bottom-on="updateScrollPosition"
2014-07-02 14:56:09 +00:00
)
.infinite-scroll-inner
2014-07-15 17:25:12 +00:00
.loading(ng-show="chat.loading")
i.fa.fa-fw.fa-spin.fa-refresh
2014-07-31 16:07:43 +00:00
|   #{translate("loading")}...
2014-07-21 11:19:13 +00:00
.no-messages.text-center.small(ng-show='!chat.loading && chat.messages.length == 0')
2014-07-31 16:07:43 +00:00
| #{translate("no_messages")}
2014-07-21 11:19:13 +00:00
.first-message.text-center(ng-show='!chat.loading && chat.messages.length == 0')
2014-07-31 16:07:43 +00:00
| #{translate("send_first_message")}
2014-07-21 11:19:13 +00:00
br
i.fa.fa-arrow-down
2014-07-17 10:05:08 +00:00
ul.list-unstyled(
ng-click="resetUnreadMessages()"
)
2014-07-02 14:56:09 +00:00
li.message(
2014-07-15 17:25:12 +00:00
ng-repeat="message in chat.messages"
2014-07-02 14:56:09 +00:00
ng-controller="ChatMessageController"
ng-class="{'self': message.user.id == user.id }"
)
2014-08-07 12:56:04 +00: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 14:56:09 +00:00
span.avatar
2014-07-17 10:07:34 +00:00
img(ng-src="{{message.user.gravatar_url}}?d=mm&s=50")
2014-07-02 14:56:09 +00:00
div.message-wrapper
2015-02-05 13:05:57 +00: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 14:56:09 +00:00
.message(
ng-style="{\
2014-07-17 14:33:38 +00:00
'border-color': 'hsl({{ hue(message.user) }}, 70%, 70%)',\
2014-07-02 14:56:09 +00:00
'background-color': 'hsl({{ hue(message.user) }}, 60%, 97%)'\
}"
)
2014-07-17 14:33:38 +00:00
.arrow(ng-style="{'border-color': 'hsl({{ hue(message.user) }}, 70%, 70%)'}")
2014-07-17 12:23:43 +00:00
p(
mathjax,
ng-repeat="content in message.contents track by $index"
2015-02-07 16:15:33 +00:00
)
span(ng-bind-html="content | linky:'_blank' | wrapLongWords")
2014-07-02 14:56:09 +00:00
.new-message
2014-07-17 10:05:08 +00:00
textarea(
2014-08-20 12:47:45 +00:00
placeholder="#{translate('your_message')}...",
2014-07-17 10:05:08 +00:00
on-enter="sendMessage()",
ng-model="newMessageContent",
ng-click="resetUnreadMessages()"
)
2014-07-02 14:56:09 +00:00