From 4a7bd5965fe4c1bd98753624b64a29711e128c18 Mon Sep 17 00:00:00 2001
From: Mukhtar
Date: Wed, 3 Aug 2016 19:12:10 +0300
Subject: [PATCH] #ARC-19 Fixes chat messages for team
---
archilance/settings/base.py | 20 +--
assets/css/extra.css | 52 ++++---
assets/index.js | 3 +
chat/models.py | 17 ++-
chat/templates/chat_contractor.html | 127 ++++++++++++++++--
chat/views.py | 4 +-
.../migrations/0009_auto_20160802_1226.py | 15 +--
.../migrations/0009_auto_20160802_1414.py | 1 +
.../migrations/0011_auto_20160802_1653.py | 13 +-
projects/migrations/0012_merge.py | 16 +++
projects/models.py | 2 +-
templates/partials/base.html | 23 ++++
users/models.py | 1 +
users/templates/contractor_profile.html | 17 ---
work_sell/views.py | 1 +
15 files changed, 233 insertions(+), 79 deletions(-)
create mode 100644 projects/migrations/0012_merge.py
diff --git a/archilance/settings/base.py b/archilance/settings/base.py
index 4327834..72aa5ba 100644
--- a/archilance/settings/base.py
+++ b/archilance/settings/base.py
@@ -43,16 +43,16 @@ THIRD_PARTY_APPS = [
]
LOCAL_APPS = [
- 'api',
- 'common',
- 'work_sell',
- 'archilance',
- 'projects',
- 'specializations',
- 'users',
- 'reviews',
- 'chat',
- 'wallets',
+ 'specializations',
+ 'api',
+ 'common',
+ 'work_sell',
+ 'archilance',
+ 'projects',
+ 'users',
+ 'reviews',
+ 'chat',
+ 'wallets',
]
INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS
diff --git a/assets/css/extra.css b/assets/css/extra.css
index 3a87ae4..c1aa855 100644
--- a/assets/css/extra.css
+++ b/assets/css/extra.css
@@ -4,11 +4,11 @@
border-radius: 40px;
font-size: 15px;
font-family: 'Arial-MT-Regular', sans-serif;
-}
+}
.btn-group.valProject2 a.btn span mark {
background: none;
- color: #ff2c2c;
+ color: #ff2c2c;
}
.btn-group.valProject2 a.btn > span {
@@ -34,32 +34,35 @@
* Simple fade transition,
*/
.mfp-fade.mfp-bg {
- opacity: 0;
- -webkit-transition: all 0.15s ease-out;
- -moz-transition: all 0.15s ease-out;
- transition: all 0.15s ease-out;
+ opacity: 0;
+ -webkit-transition: all 0.15s ease-out;
+ -moz-transition: all 0.15s ease-out;
+ transition: all 0.15s ease-out;
}
+
.mfp-fade.mfp-bg.mfp-ready {
- opacity: 0.8;
+ opacity: 0.8;
}
+
.mfp-fade.mfp-bg.mfp-removing {
- opacity: 0;
+ opacity: 0;
}
.mfp-fade.mfp-wrap .mfp-content {
- opacity: 0;
- -webkit-transition: all 0.15s ease-out;
- -moz-transition: all 0.15s ease-out;
- transition: all 0.15s ease-out;
+ opacity: 0;
+ -webkit-transition: all 0.15s ease-out;
+ -moz-transition: all 0.15s ease-out;
+ transition: all 0.15s ease-out;
}
+
.mfp-fade.mfp-wrap.mfp-ready .mfp-content {
- opacity: 1;
+ opacity: 1;
}
+
.mfp-fade.mfp-wrap.mfp-removing .mfp-content {
- opacity: 0;
+ opacity: 0;
}
-
#jGrowl .jGrowl-notification {
background-color: #00bb7b;
font-size: 17px;
@@ -69,16 +72,27 @@
margin: 0;
}
-
.stepssBlock ul li.reserved::before {
- background: rgba(0, 0, 0, 0) url("../img/reserved2.png") no-repeat scroll center center / cover ;
+ background: rgba(0, 0, 0, 0) url("../img/reserved2.png") no-repeat scroll center center / cover;
height: 16px;
width: 17px;
}
-
.stepssBlock ul li.unreserved::before {
- background: rgba(0, 0, 0, 0) url("../img/reserved.png") no-repeat scroll center center / cover ;
+ background: rgba(0, 0, 0, 0) url("../img/reserved.png") no-repeat scroll center center / cover;
height: 14px;
width: 13px;
}
+
+.chat-textarea {
+ width: 100%;
+ height: 110px;
+ border: 1px solid #cdcdcd;
+ resize: none;
+ padding: 10px 15px;
+ color: #3c1a06;
+ font-family: 'Arial-MT-Regular', sans-serif;
+ font-size: 14px;
+ float: left;
+ margin: 33px 0 0 0;
+}
diff --git a/assets/index.js b/assets/index.js
index 04d372e..7c2ac93 100644
--- a/assets/index.js
+++ b/assets/index.js
@@ -547,3 +547,6 @@ function getCookie(name) {
}
return cookieValue;
}
+
+
+
diff --git a/chat/models.py b/chat/models.py
index 2901f26..c82312e 100644
--- a/chat/models.py
+++ b/chat/models.py
@@ -36,6 +36,17 @@ class Notes(models.Model):
verbose_name = 'Заметка'
verbose_name_plural = 'Заметки'
-# class Channel(models.Model):
-# owner = models.ForeignKey(User, related_name='chanells')
-# companion = models.ForeignKey(User, related_name='companion_channels')
+
+class Documents(models.Model):
+ file = models.FileField(upload_to='chat/documents/')
+ order = models.ForeignKey(Order, related_name='order_documents',null=True, blank=True)
+ team = models.ForeignKey(Team, related_name='team_documents',null=True, blank=True)
+ sender = models.ForeignKey(User, related_name='sender_documents')
+ recipent = models.ForeignKey(User, related_name='recipent_documents')
+
+ def __str__(self):
+ return self.file.url
+
+ class Meta:
+ verbose_name = 'Входящие Документы'
+ verbose_name_plural = 'Входящие Документы'
diff --git a/chat/templates/chat_contractor.html b/chat/templates/chat_contractor.html
index f5888b4..6f1aef3 100644
--- a/chat/templates/chat_contractor.html
+++ b/chat/templates/chat_contractor.html
@@ -47,8 +47,7 @@
{% endthumbnail %}
-
- {{ contact.username }}{{ contact.username }}{{ contact.first_name }} {{ contact.last_name }}
+
Контакты
@@ -172,7 +171,7 @@
Заказы
{% for torder in team_orders %}
-
+
{{ torder }}
@@ -184,14 +183,16 @@
{% for tuser in torder.team.users.all %}
- - {{ tuser }}
+ - {{ tuser }}
{% endfor %}
Чаты:
{% for tuser in torder.team.users.all %}
+ {% if request.user.pk != tuser.pk %}
{{ tuser.username }},
+ {% endif %}
{% endfor %}
@@ -204,19 +205,21 @@