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()"
|
2015-01-26 10:36:34 -05:00
|
|
|
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
|
|
|
|
.name(ng-if="message.user.id != user.id") {{ message.user.first_name }}
|
|
|
|
.message(
|
|
|
|
ng-style="{\
|
2014-07-17 10:33:38 -04:00
|
|
|
'border-color': 'hsl({{ hue(message.user) }}, 70%, 70%)',\
|
2014-07-02 10:56:09 -04:00
|
|
|
'background-color': 'hsl({{ hue(message.user) }}, 60%, 97%)'\
|
|
|
|
}"
|
|
|
|
)
|
2014-07-17 10:33:38 -04:00
|
|
|
.arrow(ng-style="{'border-color': 'hsl({{ hue(message.user) }}, 70%, 70%)'}")
|
2014-07-17 08:23:43 -04:00
|
|
|
p(
|
|
|
|
mathjax,
|
|
|
|
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(
|
2014-08-20 08:47:45 -04: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
|
|
|
|
|
|
|
|