Commit e38b0106eb133d55f28817160b6655113567b3e5
Exists in
master
Merge branch 'refactoring'
Showing
4 changed files
with
8 additions
and
3 deletions
Show diff stats
amadeus/static/js/chat.js
@@ -287,6 +287,8 @@ function setChatFormSubmit() { | @@ -287,6 +287,8 @@ function setChatFormSubmit() { | ||
287 | var height = $(this)[0].scrollHeight; | 287 | var height = $(this)[0].scrollHeight; |
288 | 288 | ||
289 | $(this).animate({scrollTop: height}, 0); | 289 | $(this).animate({scrollTop: height}, 0); |
290 | + | ||
291 | + $(this).attr('data-url', data.load_msg_url); | ||
290 | }); | 292 | }); |
291 | 293 | ||
292 | if (typeof(new_msgs[data.talk_id]) == 'undefined') { | 294 | if (typeof(new_msgs[data.talk_id]) == 'undefined') { |
@@ -345,6 +347,8 @@ function setShortChatFormSubmit() { | @@ -345,6 +347,8 @@ function setShortChatFormSubmit() { | ||
345 | var height = $(this)[0].scrollHeight; | 347 | var height = $(this)[0].scrollHeight; |
346 | 348 | ||
347 | $(this).animate({scrollTop: height}, 0); | 349 | $(this).animate({scrollTop: height}, 0); |
350 | + | ||
351 | + $(this).attr('data-url', data.load_msg_url); | ||
348 | }); | 352 | }); |
349 | 353 | ||
350 | if (typeof(new_msgs[data.talk_id]) == 'undefined') { | 354 | if (typeof(new_msgs[data.talk_id]) == 'undefined') { |
chat/templates/chat/list.html
@@ -44,7 +44,7 @@ Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título | @@ -44,7 +44,7 @@ Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título | ||
44 | </form> | 44 | </form> |
45 | </div> | 45 | </div> |
46 | <div class="col-lg-4 col-md-4 col-sm-5 col-xs-12"> | 46 | <div class="col-lg-4 col-md-4 col-sm-5 col-xs-12"> |
47 | - <a href="{% url 'chat:participants_general' %}" class="pull-right btn btn-default btn-raised btn-md btn-mobile visible-xs-block visible-sm-block">{% trans 'List all participants' %}</a> | 47 | + <a href="{% url 'chat:participants_general' %}" class="pull-right btn btn-default btn-raised btn-md btn-mobile visible-xs-block visible-sm-block visible-md visible-lg">{% trans 'List all participants' %}</a> |
48 | </div> | 48 | </div> |
49 | </div> | 49 | </div> |
50 | </div> | 50 | </div> |
chat/templates/chat/list_participants.html
@@ -46,7 +46,7 @@ Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título | @@ -46,7 +46,7 @@ Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título | ||
46 | </form> | 46 | </form> |
47 | </div> | 47 | </div> |
48 | <div class="col-lg-4 col-md-4 col-sm-5 col-xs-12"> | 48 | <div class="col-lg-4 col-md-4 col-sm-5 col-xs-12"> |
49 | - <a href="{% url 'chat:participants_general' %}" class="pull-right btn btn-default btn-raised btn-md btn-mobile visible-xs-block visible-sm-block">{% trans 'List all participants' %}</a> | 49 | + <a href="{% url 'chat:participants_general' %}" class="pull-right btn btn-default btn-raised btn-md btn-mobile visible-xs-block visible-sm-block visible-md visible-lg">{% trans 'List all participants' %}</a> |
50 | </div> | 50 | </div> |
51 | </div> | 51 | </div> |
52 | </div> | 52 | </div> |
chat/views.py
@@ -422,10 +422,11 @@ def render_message(request, talk_msg, talk_id, space, space_type, email): | @@ -422,10 +422,11 @@ def render_message(request, talk_msg, talk_id, space, space_type, email): | ||
422 | context['talk_msg'] = msg | 422 | context['talk_msg'] = msg |
423 | 423 | ||
424 | form_url = reverse_lazy('chat:create', args = (), kwargs = {'email': email, 'talk_id': talk_id, 'space': space, 'space_type': space_type}) | 424 | form_url = reverse_lazy('chat:create', args = (), kwargs = {'email': email, 'talk_id': talk_id, 'space': space, 'space_type': space_type}) |
425 | + loading_msg = reverse_lazy('chat:load_messages', args = (msg.talk.id, )) | ||
425 | 426 | ||
426 | html = render_to_string("chat/_message.html", context, request) | 427 | html = render_to_string("chat/_message.html", context, request) |
427 | 428 | ||
428 | - return JsonResponse({'view': html, 'new_id': msg.id, 'talk_id': msg.talk.id, 'new_form_url': form_url}) | 429 | + return JsonResponse({'view': html, 'new_id': msg.id, 'talk_id': msg.talk.id, 'new_form_url': form_url, 'load_msg_url': loading_msg}) |
429 | 430 | ||
430 | @login_required | 431 | @login_required |
431 | def favorite(request, message): | 432 | def favorite(request, message): |