diff --git a/assets/css/main.css b/assets/css/main.css index 88fd7fb..02682d2 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -12,7 +12,7 @@ font-style: normal; } -@font-face { +@font-face { font-family: 'pfdintextcomppro-regular'; src: url('../fonts/PFDinTextCompPro-Regular/PFDinTextCompPro-Regular.eot?#iefix') format('embedded-opentype'), url('../fonts/PFDinTextCompPro-Regular/PFDinTextCompPro-Regular.woff') format('woff'), url('../fonts/PFDinTextCompPro-Regular/PFDinTextCompPro-Regular.ttf') format('truetype'), url('../fonts/PFDinTextCompPro-Regular/PFDinTextCompPro-Regular.svg#PFDinTextCompPro-Regular') format('svg'); font-weight: normal; @@ -177,7 +177,7 @@ a, a:hover, a:focus, a:active { padding: 30px 0px 27px 40px; font-family: 'pfbeausanspro-reg', sans-serif; } - + .reg, .reg:link, .reg:visited { color: #fb1818; font-size: 16px; @@ -791,7 +791,7 @@ footer:after { border-radius: 40px; font-size: 15px; font-family: 'Arial-MT-Regular', sans-serif; -} +} .valProject button:focus, .valProject button:active, @@ -804,7 +804,7 @@ footer:after { .valProject2 button span mark { background: none; - color: #ff2c2c; + color: #ff2c2c; } .valProject2 button > span { @@ -1248,7 +1248,7 @@ footer:after { .polsF1 .dropdown-menu li a:focus { outline: none !important; - background: none; + background: none; } /*.searchF1 { @@ -1397,9 +1397,9 @@ input[type="checkbox"] + span { .sro input[type="checkbox"] { opacity: 0; } - + input[type="checkbox"]:checked + span { - background-position: 0 -23px; + background-position: 0 -23px; } .sro p { @@ -1768,7 +1768,7 @@ input[type="checkbox"]:checked + span { } .divCol9 { - padding: 20px 0; + padding: 20px 0; } .nameUser, .cityUser, .navv { @@ -2024,7 +2024,7 @@ input[type="checkbox"]:checked + span { } .addWork a:link, .addWork a:visited, .addWork a { - color: #5a5a5a; + color: #5a5a5a; } .addWork:before { @@ -2785,7 +2785,7 @@ input[type="checkbox"]:checked + span { -webkit-transition: all 0.3s ease-out; -moz-transition: all 0.3s ease-out; transition: all 0.3s ease-out; - cursor: move; + cursor: move; } .compTable tr:hover { @@ -2987,7 +2987,7 @@ input[type="checkbox"]:checked + span { } .compTable tr td:nth-child(7) span { - color: #43b476; + color: #43b476; font-size: 14px; font-weight: bold; font-family: Arial, Verdana, Helvetica, sans-serif; @@ -3227,7 +3227,7 @@ input[type="checkbox"]:checked + span { position: relative; cursor: pointer; } - + .gallery-thumbs .swiper-slide.is-selected:after { content: ''; position: absolute; @@ -3464,8 +3464,8 @@ input[type="checkbox"]:checked + span { text-transform: uppercase; } -.textAreaBlock2 a:not(.cke_button, .cke_combo_button, .cke_path_item), -.textAreaBlock2 a:link:not(.cke_button, .cke_combo_button, .cke_path_item), +.textAreaBlock2 a:not(.cke_button, .cke_combo_button, .cke_path_item), +.textAreaBlock2 a:link:not(.cke_button, .cke_combo_button, .cke_path_item), .textAreaBlock2 a:visited:not(.cke_button, .cke_combo_button, .cke_path_item) { font-family: 'pfdintextcomppro-regular', sans-serif; letter-spacing: 2px; @@ -3671,7 +3671,7 @@ input[type="checkbox"]:checked + span { .startChat { float: left; margin: 0 0 0 0; -} +} .insetSC1 { width: 100%; @@ -4499,7 +4499,7 @@ label { display: block; position: relative; } - + input[type="checkbox"] + span { position: absolute; left: 0; @@ -4509,9 +4509,9 @@ input[type="checkbox"] + span { background: url('../img/check.png') no-repeat; cursor: pointer; } - + input[type="checkbox"]:checked + span { - background-position: 0 -23px; + background-position: 0 -23px; } .text-block { @@ -4932,9 +4932,9 @@ input[type="radio"] + span { .inset-mb input[type="radio"] { opacity: 0; } - + input[type="radio"]:checked + span { - background-position: 0 -23px; + background-position: 0 -23px; } .inset-mb p { @@ -5328,7 +5328,7 @@ input[type="radio"]:checked + span { .dog-new label { float: left; - margin: 14px 0 0 39px; + margin: 14px 0 0 39px; } .dog-new p { @@ -5338,7 +5338,7 @@ input[type="radio"]:checked + span { position: relative; color: #8a8989; font-style: italic; - margin: 16px 0 0 12px; + margin: 16px 0 0 12px; } .make-new label { @@ -5488,7 +5488,7 @@ input[type="radio"]:checked + span { .titleFFE { margin: 30px 0 -10px 0; -} +} .new-doubt { margin-bottom: 18px; @@ -5982,7 +5982,7 @@ a.linkS2[data-target="#withdraw-money"]{ margin-top: 0px; } .changeBlock { - min-height: 500px; + min-height: 450px; display: table; padding: 143px 20px 120px 20px; } @@ -6066,7 +6066,7 @@ input[type="radio"]{ margin: auto; } .menuUser ul:nth-child(3) li a{ - padding: 16px 0px 16px 0px !important; + padding: 16px 0px 16px 0px !important; text-align: center; } .addWork, .upload2, .documentsChat a{ diff --git a/chat/templates/chat_contractor.html b/chat/templates/chat_contractor.html index 9994ec0..60de835 100644 --- a/chat/templates/chat_contractor.html +++ b/chat/templates/chat_contractor.html @@ -177,14 +177,7 @@
-
-
-

ArturBaybulatov

- 2016-09-07 17:09:52 -
-

Приглашаю в группу http://proekton.com/users/teams/128/

- присоединиться -
+
diff --git a/common/middleware.py b/common/middleware.py index a603ac9..3124f39 100644 --- a/common/middleware.py +++ b/common/middleware.py @@ -1,12 +1,30 @@ +import datetime from django.utils.timezone import now from users.models import User +from ratings.models import HistoryRating class SetLastVisitMiddleware(object): def process_response(self, request, response): - if hasattr(request,'user'): + if hasattr(request, 'user'): if request.user.is_authenticated(): User.objects.filter(pk=request.user.pk).update(last_time_visit=now()) return response + +class SetRatingToUserEveryDay(object): + + def process_response(self, request, response): + if hasattr(request, 'user'): + today_date = datetime.datetime.now().date() + hs_last = HistoryRating.objects.filter(user=request.user, type='visit_site').order_by('-created').first() + if not hs_last or hs_last.created.date() != today_date: + hs_new = HistoryRating() + hs_new.type = 'visit_site' + hs_new.rating = 1 + hs_new.user = request.user + hs_new.description = 'Балл за вход на сайт' + hs_new.save() + return response + diff --git a/projects/templates/project_detail.html b/projects/templates/project_detail.html index 434bc3c..d503726 100644 --- a/projects/templates/project_detail.html +++ b/projects/templates/project_detail.html @@ -291,7 +291,7 @@ {% csrf_token %} - отказ + отказ
{% if project.order.contractor and project.order.contractor == answer.author %} @@ -673,7 +673,13 @@
{% csrf_token %} - + предложить проект
@@ -688,7 +694,11 @@
{% csrf_token %} - отказ + отказ
@@ -867,7 +877,12 @@
{% csrf_token %} - + предложить проект
@@ -882,7 +897,13 @@
{% csrf_token %} - отказ + отказ +
@@ -1011,7 +1032,12 @@
- {% ratings_widget answer.author.pk 'restList2' %} + {% if answer.author|class_name == 'User' %} + {% ratings_widget answer.author.pk 'restList2' %} + {% elif answer.author|class_name == 'Team'%} + {% ratings_team_widget answer.author.pk 'restList2' %} + {% endif %} + {% if answer.author|class_name == 'User' and answer.author.cro %}
@@ -1168,6 +1194,57 @@ $.cookie('projectAnswerFormVisible', 'true', {expires: new Date(new Date().getTime() + 300000)}) } } + + + $('.offer-order-contractor').on('click', function(e){ + e.preventDefault() + + var senderId = $(this).attr('data-sender-id') + var recipentId = $(this).attr('data-recipent-id') + var orderId = $(this).attr('data-order-id') + + var msg = 'Вас выбрали исполнителем для заказа ' + + socketMain.add_message({ + format_type: 'add_message_contact', + message_type: 'offer_order', + data: { + sender_id: String(senderId), + recipent_id: String(recipentId), + order_id: String(orderId), + chat_message: msg, + }, + }) + + $(this).closest('form').submit() + + + }) + + $('.reject-project-link').on('click', function(e){ + e.preventDefault(); + var projectId = $(this).attr('data-project-id') + var msg = 'Вам отказано по проекту " ' + $(this).attr("data-order-name") + '" Перейти' + var customerId = $(this).attr('data-sender-id') + var contractorId = $(this).attr('data-recipent-id') + socketMain.add_message({ + format_type: 'add_message_contact', + message_type: 'reject_order', + data: { + sender_id: String(customerId), + recipent_id: String(contractorId), + chat_message: msg, + }, + }) + $(this).closest('form').submit(); + + }) + + $('.reject-project-link-contractor').on('click', function(e){ + e.preventDefault(); + $(this).closest('form').submit(); + + }) window.toggleProjectAnswerForm = toggleProjectAnswerForm }()) diff --git a/users/models.py b/users/models.py index ab3263b..65871f5 100644 --- a/users/models.py +++ b/users/models.py @@ -170,7 +170,7 @@ class User(AbstractBaseUser, PermissionsMixin): return self.email def get_full_name(self): - full_name = self.first_name + ' ' + self.last_name + full_name = self.first_name + ' ' + self.last_name + ' ' + self.patronym return full_name or self.username def get_profile_image(self): diff --git a/users/templates/contractor_filter.html b/users/templates/contractor_filter.html index 96d13c9..4f83f33 100644 --- a/users/templates/contractor_filter.html +++ b/users/templates/contractor_filter.html @@ -459,7 +459,7 @@ if (project.order.team && project.order.team.id === teamId) { window.location.href = projectOrderChatUrl } else { - var msg = 'Вашей команде предлагается проект http://{{ request.get_host }}' + projectUrl +'' + var msg = 'Вашей команде предлагается проект Перейти к проекту' socketMain.add_message({ format_type: 'add_message_contact', @@ -480,7 +480,7 @@ if (project.order.contractor && project.order.contractor.id === contractorId) { window.location.href = projectOrderChatUrl } else { - var msg = 'Вам предлагается проект http://{{ request.get_host }}' + projectUrl +'' + var msg = 'Вам предлагается проект Перейти к проекту' socketMain.add_message({ format_type: 'add_message_contact', diff --git a/users/templates/contractor_office.html b/users/templates/contractor_office.html index ea74d44..abba5e7 100644 --- a/users/templates/contractor_office.html +++ b/users/templates/contractor_office.html @@ -389,7 +389,7 @@ data: { sender_id: '{{ contractor.pk }}', recipent_id: String(contractor2Id), - chat_message: 'Приглашаю в группу http://{{ request.get_host }}{% url 'users:accept-team-invitation' owner_id=contractor.pk %}', + chat_message: 'Приглашаю в группу "{{ contractor.team.name }}" Присоединиться', }, }) diff --git a/users/templates/contractor_profile.html b/users/templates/contractor_profile.html index 7324aaf..25b187c 100644 --- a/users/templates/contractor_profile.html +++ b/users/templates/contractor_profile.html @@ -738,11 +738,11 @@ if (res.status === 'success') { socketMain.add_message({ format_type: 'add_message_contact', - + message_type: 'invite_team', data: { sender_id: '{{ request.user.pk }}', recipent_id: '{{ contractor.pk }}', - chat_message: 'Приглашаю в группу http://{{ request.get_host }}{% url 'users:accept-team-invitation' owner_id=request.user.pk %}', + chat_message: 'Приглашаю в группу "{{ request.user.team.name }}" Присоединиться', }, }) @@ -794,11 +794,11 @@ if (project.order.contractor && project.order.contractor.id === contractorId) { window.location.href = projectOrderChatUrl } else { - var msg = 'Вам предлагается проект http://{{ request.get_host }}' + projectUrl + var msg = 'Вам предлагается проект Перейти к проекту' socketMain.add_message({ format_type: 'add_message_contact', - + message_type: 'invite_order', data: { sender_id: String(customerId), recipent_id: String(contractorId),