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-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-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
|
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
|
|
|
|
.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
|
2014-07-17 06:05:08 -04:00
|
|
|
textarea(
|
|
|
|
placeholder="Your message...",
|
|
|
|
on-enter="sendMessage()",
|
|
|
|
ng-model="newMessageContent",
|
|
|
|
ng-click="resetUnreadMessages()"
|
|
|
|
)
|
2014-07-02 10:56:09 -04:00
|
|
|
|
|
|
|
|