2014-07-02 10:56:09 -04:00
|
|
|
aside.chat(
|
|
|
|
ng-controller="ChatController"
|
|
|
|
infinite-scroll="loadMore()"
|
|
|
|
infinite-scroll-disabled="chat.loading || chat.atEnd"
|
|
|
|
infinite-scroll-initialize="ui.chatOpen"
|
|
|
|
)
|
|
|
|
.messages(
|
|
|
|
infinite-scroll="loadMore()"
|
|
|
|
infinite-scroll-disabled="chat.loading || chat.atEnd"
|
|
|
|
infinite-scroll-initialize="ui.chatOpen"
|
|
|
|
)
|
|
|
|
.infinite-scroll-inner
|
|
|
|
ul.list-unstyled
|
|
|
|
li.message(
|
2014-07-04 10:46:21 -04:00
|
|
|
ng-repeat="message in chat.groupedMessages | orderBy:'timestamp':false"
|
2014-07-02 10:56:09 -04:00
|
|
|
ng-controller="ChatMessageController"
|
|
|
|
ng-class="{'self': message.user.id == user.id }"
|
|
|
|
)
|
2014-07-04 10:46:21 -04:00
|
|
|
div.date(ng-if="$index == 0 || (message.timestamp - chat.groupedMessages[$index - 1].timestamp) > 5 * 60 * 1000")
|
|
|
|
{{ message.timestamp | formatDate:'h:MMa' }} {{ message.timestamp | relativeDate }}
|
2014-07-02 10:56:09 -04:00
|
|
|
span.avatar
|
|
|
|
img(ng-src="{{gravatarUrl(message.user)}}")
|
|
|
|
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-04 10:46:21 -04:00
|
|
|
p(ng-repeat="content in message.contents") {{ content }}
|
2014-07-02 10:56:09 -04:00
|
|
|
|
|
|
|
.new-message
|
|
|
|
textarea(
|
|
|
|
placeholder="Your message..."
|
|
|
|
)
|
|
|
|
|
|
|
|
|