|
|
|
|
@ -291,7 +291,7 @@ |
|
|
|
|
<form action="{% url 'projects:reject-project-answer' pk=answer.pk %}" method="POST" novalidate> |
|
|
|
|
{% csrf_token %} |
|
|
|
|
<input type="hidden" name="next" value="{{ request.path }}"> |
|
|
|
|
<a href="#" onclick="$(this).closest('form').submit(); return false" class="candLink candLink3" title="{{ answer.pk }}">отказ</a> |
|
|
|
|
<a href="#" class="candLink candLink3 reject-project-link-contractor" title="{{ answer.pk }}">отказ</a> |
|
|
|
|
</form> |
|
|
|
|
|
|
|
|
|
{% if project.order.contractor and project.order.contractor == answer.author %} |
|
|
|
|
@ -673,7 +673,13 @@ |
|
|
|
|
<form action="{% url 'projects:customer-offer-order' answer_id=answer.pk project_id=project.pk %}" method="POST" novalidate> |
|
|
|
|
{% csrf_token %} |
|
|
|
|
|
|
|
|
|
<a href="#" onclick="$(this).closest('form').submit(); return false" class="candLink candLink2"> |
|
|
|
|
<a href="#" |
|
|
|
|
data-sender-id="{{ request.user.pk }}" |
|
|
|
|
data-recipent-id="{% if answer.author|class_name == 'User' %}{{ answer.author.pk }}{% elif answer.author|class_name == 'Team'%}{{ answer.author.owner.pk }}{% endif %}" |
|
|
|
|
data-order-id="{{ project.order.id }}" |
|
|
|
|
data-order-name="{{ project.name }}" |
|
|
|
|
|
|
|
|
|
class="candLink candLink2 offer-order-contractor"> |
|
|
|
|
предложить проект |
|
|
|
|
</a> |
|
|
|
|
</form> |
|
|
|
|
@ -688,7 +694,11 @@ |
|
|
|
|
<form action="{% url 'projects:reject-project-answer' pk=answer.pk %}" method="POST" novalidate> |
|
|
|
|
{% csrf_token %} |
|
|
|
|
<input type="hidden" name="next" value="{{ request.path }}"> |
|
|
|
|
<a href="#" onclick="$(this).closest('form').submit(); return false" class="candLink candLink3" title="{{ answer.pk }}">отказ</a> |
|
|
|
|
<a href="#" data-sender-id="{{ request.user.pk }}" |
|
|
|
|
data-recipent-id="{% if answer.author|class_name == 'User' %}{{ answer.author.pk }}{% elif answer.author|class_name == 'Team'%}{{ answer.author.owner.pk }}{% endif %}" |
|
|
|
|
data-order-name="{{ project.name }}" |
|
|
|
|
data-project-id="{{ project.pk }}" |
|
|
|
|
class="candLink candLink3 reject-project-link" title="{{ answer.pk }}">отказ</a> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
@ -867,7 +877,12 @@ |
|
|
|
|
<form action="{% url 'projects:customer-offer-order' answer_id=answer.pk project_id=project.pk %}" method="POST" novalidate> |
|
|
|
|
{% csrf_token %} |
|
|
|
|
|
|
|
|
|
<a href="#" onclick="$(this).closest('form').submit(); return false" class="candLink candLink2"> |
|
|
|
|
<a href="#" |
|
|
|
|
data-sender-id="{{ request.user.pk }}" |
|
|
|
|
data-recipent-id="{% if answer.author|class_name == 'User' %}{{ answer.author.pk }}{% elif answer.author|class_name == 'Team'%}{{ answer.author.owner.pk }}{% endif %}" |
|
|
|
|
data-order-id="{{ project.order.id }}" |
|
|
|
|
data-order-name="{{ project.name }}" |
|
|
|
|
class="candLink candLink2 offer-order-contractor"> |
|
|
|
|
предложить проект |
|
|
|
|
</a> |
|
|
|
|
</form> |
|
|
|
|
@ -882,7 +897,13 @@ |
|
|
|
|
<form action="{% url 'projects:reject-project-answer' pk=answer.pk %}" method="POST" novalidate> |
|
|
|
|
{% csrf_token %} |
|
|
|
|
<input type="hidden" name="next" value="{{ request.path }}"> |
|
|
|
|
<a href="#" onclick="$(this).closest('form').submit(); return false" class="candLink candLink3" title="{{ answer.pk }}">отказ</a> |
|
|
|
|
<a href="#" |
|
|
|
|
data-sender-id="{{ request.user.pk }}" |
|
|
|
|
data-recipent-id="{% if answer.author|class_name == 'User' %}{{ answer.author.pk }}{% elif answer.author|class_name == 'Team'%}{{ answer.author.owner.pk }}{% endif %}" |
|
|
|
|
data-order-name="{{ project.name }}" |
|
|
|
|
data-project-id="{{ project.pk }}" |
|
|
|
|
class="candLink candLink3 reject-project-link" title="{{ answer.pk }}">отказ |
|
|
|
|
</a> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
@ -1011,7 +1032,12 @@ |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="col-lg-3 retts"> |
|
|
|
|
{% 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 %} |
|
|
|
|
<div class="sroUser sroExecutor"> |
|
|
|
|
@ -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") + '" <a class="message_connect" href="http://{{ request.get_host }}/projects/'+ projectId +'/" >Перейти</a>' |
|
|
|
|
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 |
|
|
|
|
}()) |
|
|
|
|
|