Commit 8339923d59207bf7a614f3bbb6b3c3518ea5c3b2

Authored by Zambom
1 parent c7805dda

Chat adjusts

amadeus/static/css/base/amadeus.css
@@ -1409,11 +1409,30 @@ div.dataTables_wrapper div.dataTables_paginate { @@ -1409,11 +1409,30 @@ div.dataTables_wrapper div.dataTables_paginate {
1409 } 1409 }
1410 .talk-filter h4 { 1410 .talk-filter h4 {
1411 font-weight: 700; 1411 font-weight: 700;
  1412 + font-size: 14px;
1412 margin-bottom: 5px !important; 1413 margin-bottom: 5px !important;
1413 } 1414 }
1414 .talk-filter .checkbox { 1415 .talk-filter .checkbox {
1415 margin-right: 10px; 1416 margin-right: 10px;
1416 } 1417 }
  1418 +.talk-filter .checkbox .checkbox-material {
  1419 + top: 0px;
  1420 +}
  1421 +.talk-filter .checkbox .checkbox-material .check {
  1422 + width: 14px;
  1423 + height: 14px;
  1424 +}
  1425 +.talk-filter .checkbox .checkbox-material .check::before {
  1426 + margin-top: -8px;
  1427 + margin-left: 4px;
  1428 +}
  1429 +.talk-filter label {
  1430 + font-size: 14px;
  1431 +}
  1432 +
  1433 +#chat-filters .btn-sm {
  1434 + padding: 5px 10px;
  1435 +}
1417 1436
1418 .messages-container { 1437 .messages-container {
1419 height: 400px; 1438 height: 400px;
chat/templates/chat/_profile.html
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 <a class="user_{{ participant.id }}_status status {{ status }}" title="{{ status|status_text }}"></a> 17 <a class="user_{{ participant.id }}_status status {{ status }}" title="{{ status|status_text }}"></a>
18 <b>{{ participant }}</b> 18 <b>{{ participant }}</b>
19 </h4> 19 </h4>
20 - <a href="#" onclick="getModalInfo($(this), '{{ space }}', '{{ space_type }}'); return false;" data-url='{% url "chat:talk" participant.email %}' class="btn btn-raised btn-success btn-block">{% trans 'Send Message' %}</a> 20 + <a href="#" onclick="getModalInfo($(this), '{{ space }}', '{{ space_type }}'); return false;" data-url='{% url "chat:talk" participant.email %}' class="btn btn-raised btn-success btn-block" style="padding: 8px 15px">{% trans 'Send Message' %}</a>
21 </div> 21 </div>
22 <div class="col-md-8"> 22 <div class="col-md-8">
23 <div class="form-group"> 23 <div class="form-group">
@@ -49,7 +49,7 @@ class GeneralIndex(LoginRequiredMixin, LogMixin, generic.ListView): @@ -49,7 +49,7 @@ class GeneralIndex(LoginRequiredMixin, LogMixin, generic.ListView):
49 def get_queryset(self): 49 def get_queryset(self):
50 user = self.request.user 50 user = self.request.user
51 51
52 - conversations = Conversation.objects.filter((Q(user_one = user) | Q(user_two = user))) 52 + conversations = Conversation.objects.extra(select = {"most_recent": "select create_date from chat_talkmessages where chat_talkmessages.talk_id = chat_conversation.id order by create_date DESC LIMIT 1"}).filter((Q(user_one = user) | Q(user_two = user))).order_by('-most_recent')
53 53
54 return conversations 54 return conversations
55 55
@@ -189,10 +189,10 @@ class SubjectView(LoginRequiredMixin, LogMixin, generic.ListView): @@ -189,10 +189,10 @@ class SubjectView(LoginRequiredMixin, LogMixin, generic.ListView):
189 slug = self.kwargs.get('slug') 189 slug = self.kwargs.get('slug')
190 subject = get_object_or_404(Subject, slug = slug) 190 subject = get_object_or_404(Subject, slug = slug)
191 191
192 - conversations = Conversation.objects.filter((Q(user_one = user) & (Q(user_two__is_staff = True) | 192 + conversations = Conversation.objects.extra(select = {"most_recent": "select create_date from chat_talkmessages where chat_talkmessages.talk_id = chat_conversation.id order by create_date DESC LIMIT 1"}).filter((Q(user_one = user) & (Q(user_two__is_staff = True) |
193 Q(user_two__subject_student = subject) | Q(user_two__professors = subject) | Q(user_two__coordinators__subject_category = subject))) | 193 Q(user_two__subject_student = subject) | Q(user_two__professors = subject) | Q(user_two__coordinators__subject_category = subject))) |
194 (Q(user_two = user) & (Q(user_one__is_staff = True) | Q(user_one__subject_student = subject) | 194 (Q(user_two = user) & (Q(user_one__is_staff = True) | Q(user_one__subject_student = subject) |
195 - Q(user_one__professors = subject) | Q(user_one__coordinators__subject_category = subject)))).distinct() 195 + Q(user_one__professors = subject) | Q(user_one__coordinators__subject_category = subject)))).distinct().order_by('-most_recent')
196 196
197 return conversations 197 return conversations
198 198
@@ -4,7 +4,7 @@ from . import views @@ -4,7 +4,7 @@ from . import views
4 urlpatterns = [ 4 urlpatterns = [
5 url(r'^$', views.ListNewsView.as_view(), name='manage_news'), 5 url(r'^$', views.ListNewsView.as_view(), name='manage_news'),
6 url(r'^view/(?P<slug>[\w_-]+)/$', views.VisualizeNews.as_view(), name = 'view'), 6 url(r'^view/(?P<slug>[\w_-]+)/$', views.VisualizeNews.as_view(), name = 'view'),
7 - url(r'^create/$, views.CreateNewsView.as_view(), name='create'), 7 + url(r'^create/$', views.CreateNewsView.as_view(), name='create'),
8 url(r'^update/(?P<slug>[\w_-]+)/$', views.UpdateNewsView.as_view(), name = 'update'), 8 url(r'^update/(?P<slug>[\w_-]+)/$', views.UpdateNewsView.as_view(), name = 'update'),
9 9
10 ] 10 ]
users/forms.py
@@ -128,8 +128,8 @@ class ProfileForm(Validation): @@ -128,8 +128,8 @@ class ProfileForm(Validation):
128 y = self.cleaned_data.get('y') 128 y = self.cleaned_data.get('y')
129 w = self.cleaned_data.get('width') 129 w = self.cleaned_data.get('width')
130 h = self.cleaned_data.get('height') 130 h = self.cleaned_data.get('height')
131 -  
132 - if self.instance.image : 131 +
  132 + if self.instance.image:
133 image = Image.open(self.instance.image) 133 image = Image.open(self.instance.image)
134 cropped_image = image.crop((x, y, w+x, h+y)) 134 cropped_image = image.crop((x, y, w+x, h+y))
135 resized_image = cropped_image.resize((200, 200), Image.ANTIALIAS) 135 resized_image = cropped_image.resize((200, 200), Image.ANTIALIAS)