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

40 lines
1.4 KiB
Text
Raw Normal View History

2014-07-02 10:56:09 -04:00
aside.chat(
ng-controller="ChatController"
)
.messages(
2014-07-15 13:25:12 -04:00
infinite-scroll="loadMoreMessages()"
2014-07-02 10:56:09 -04:00
infinite-scroll-disabled="chat.loading || chat.atEnd"
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
| Loading...
2014-07-02 10:56:09 -04:00
ul.list-unstyled
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-07-15 13:25:12 -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
img(ng-src="{{message.user.gravatar_url}}")
2014-07-02 10:56:09 -04:00
div.message-wrapper
.name(ng-if="message.user.id != user.id") {{ message.user.first_name }}
.message(
ng-style="{\
'border-color': 'hsl({{ hue(message.user) }}, 60%, 80%)',\
'background-color': 'hsl({{ hue(message.user) }}, 60%, 97%)'\
}"
)
.arrow(ng-style="{'border-color': 'hsl({{ hue(message.user) }}, 60%, 80%)'}")
2014-07-15 13:25:12 -04:00
p(ng-repeat="content in message.contents track by $index") {{ content }}
2014-07-02 10:56:09 -04:00
.new-message
textarea(placeholder="Your message...", on-enter="sendMessage()", ng-model="newMessageContent")
2014-07-02 10:56:09 -04:00