|
|
|
|
@ -115,6 +115,19 @@ |
|
|
|
|
<p class="textProIn"> |
|
|
|
|
{{ project.text|linebreaksbr }} |
|
|
|
|
</p> |
|
|
|
|
</div> br |
|
|
|
|
|
|
|
|
|
<div class="col-lg-10 col-lg-offset-1" style="margin-top: 15px;"> |
|
|
|
|
|
|
|
|
|
<p class="textProIn"> |
|
|
|
|
Приложенные файлы: |
|
|
|
|
|
|
|
|
|
{% for file in project.files.all %} |
|
|
|
|
<li class="existing-file-widget"> |
|
|
|
|
<a href="{{ file }}" class="file-upload-label">{{ file.file.name|basename }} {{ file.file.size|filesizeformat }}</a> |
|
|
|
|
</li> |
|
|
|
|
{% endfor %} |
|
|
|
|
</p> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="col-lg-10 col-lg-offset-1"> |
|
|
|
|
@ -757,7 +770,7 @@ |
|
|
|
|
{% csrf_token %} |
|
|
|
|
<input type="hidden" name="next" value="{% url 'projects:detail' pk=project.pk %}#new-answers"> |
|
|
|
|
|
|
|
|
|
<div><textarea name="text" class="fr_answer"></textarea></div> |
|
|
|
|
<div><textarea name="text" class="fr_answer" title="Текст сообщения"></textarea></div> |
|
|
|
|
<div><button type="submit" class="fr_answer_sen">Отправить</button></div> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
@ -887,11 +900,11 @@ |
|
|
|
|
</a> |
|
|
|
|
</form> |
|
|
|
|
{% else %} |
|
|
|
|
{% if answer.author|class_name == 'User' %} |
|
|
|
|
<a href="{% url 'chat:chat-user' %}?user_id={{ answer.author.pk }}" class="candLink candLink2">Перейти к обсуждению</a> |
|
|
|
|
{% elif answer.author|class_name == 'Team'%} |
|
|
|
|
<a href="{% url 'chat:chat-user' %}?user_id={{ answer.author.owner.pk }}" class="candLink candLink2">Перейти к обсуждению</a> |
|
|
|
|
{% endif %} |
|
|
|
|
{# {% if answer.author|class_name == 'User' %}#} |
|
|
|
|
{# <a href="{% url 'chat:chat-user' %}?user_id={{ answer.author.pk }}" class="candLink candLink2">Перейти к обсуждению</a>#} |
|
|
|
|
{# {% elif answer.author|class_name == 'Team'%}#} |
|
|
|
|
{# <a href="{% url 'chat:chat-user' %}?user_id={{ answer.author.owner.pk }}" class="candLink candLink2">Перейти к обсуждению</a>#} |
|
|
|
|
{# {% endif %}#} |
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
<form action="{% url 'projects:reject-project-answer' pk=answer.pk %}" method="POST" novalidate> |
|
|
|
|
@ -961,8 +974,7 @@ |
|
|
|
|
<form action="{% url 'projects:create-answer-message' pk=answer.pk %}" method="POST" novalidate> |
|
|
|
|
{% csrf_token %} |
|
|
|
|
<input type="hidden" name="next" value="{% url 'projects:detail' pk=project.pk %}#candidate-answers"> |
|
|
|
|
|
|
|
|
|
<div><textarea style="margin-left:0;" name="text" class="fr_answer"></textarea></div> |
|
|
|
|
<div><textarea style="margin-left:0;" name="text" class="fr_answer" title="Текст сообщения"></textarea></div> |
|
|
|
|
<div><button style="margin-left:0;" type="submit" class="fr_answer_sen">Отправить</button></div> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
@ -1151,59 +1163,55 @@ |
|
|
|
|
<script> |
|
|
|
|
// Persistent Bootstrap tabs -------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;(function() { |
|
|
|
|
var $allTabs = $('a[data-toggle="tab"]') |
|
|
|
|
var $allTabs = $('a[data-toggle="tab"]'); |
|
|
|
|
|
|
|
|
|
var $tab = $allTabs.filter('[href="' + window.location.hash + '"]').first() |
|
|
|
|
var $tab = $allTabs.filter('[href="' + window.location.hash + '"]').first(); |
|
|
|
|
|
|
|
|
|
if (_.isEmpty($tab)) |
|
|
|
|
$tab = $allTabs.first() |
|
|
|
|
$tab = $allTabs.first(); |
|
|
|
|
|
|
|
|
|
$tab.tab('show') |
|
|
|
|
$tab.addClass('active') |
|
|
|
|
$tab.tab('show'); |
|
|
|
|
$tab.addClass('active'); |
|
|
|
|
|
|
|
|
|
$allTabs.on('click', function($evt) { // Better handle "shown.bs.tab" event? |
|
|
|
|
var $tab = $(this) |
|
|
|
|
$allTabs.on('click', function() { // Better handle "shown.bs.tab" event? |
|
|
|
|
var $tab = $(this); |
|
|
|
|
|
|
|
|
|
$allTabs.removeClass('active') |
|
|
|
|
$tab.addClass('active') |
|
|
|
|
$allTabs.removeClass('active'); |
|
|
|
|
$tab.addClass('active'); |
|
|
|
|
window.location.hash = $tab.attr('href') |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}()) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Toggle project answer form ----------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;(function() { |
|
|
|
|
var $projectAnswerForm = $('.-project-answer-form').first() |
|
|
|
|
var $projectAnswerForm = $('.-project-answer-form').first(); |
|
|
|
|
|
|
|
|
|
if ($.cookie('projectAnswerFormVisible')) { |
|
|
|
|
$projectAnswerForm.show('slow') |
|
|
|
|
$projectAnswerForm.show('slow'); |
|
|
|
|
$.cookie('projectAnswerFormVisible', 'true', {expires: new Date(new Date().getTime() + 300000)}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function toggleProjectAnswerForm() { |
|
|
|
|
if ($.cookie('projectAnswerFormVisible')) { |
|
|
|
|
$projectAnswerForm.hide('slow') |
|
|
|
|
$projectAnswerForm.hide('slow'); |
|
|
|
|
$.cookie('projectAnswerFormVisible', '', {expires: new Date(new Date().getTime() + 300000)}) |
|
|
|
|
} else { |
|
|
|
|
$projectAnswerForm.show('slow') |
|
|
|
|
$projectAnswerForm.show('slow'); |
|
|
|
|
$.cookie('projectAnswerFormVisible', 'true', {expires: new Date(new Date().getTime() + 300000)}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('.offer-order-contractor').on('click', function(e){ |
|
|
|
|
e.preventDefault() |
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
|
|
var senderId = $(this).attr('data-sender-id') |
|
|
|
|
var recipentId = $(this).attr('data-recipent-id') |
|
|
|
|
var orderId = $(this).attr('data-order-id') |
|
|
|
|
var senderId = $(this).attr('data-sender-id'); |
|
|
|
|
var recipentId = $(this).attr('data-recipent-id'); |
|
|
|
|
var orderId = $(this).attr('data-order-id'); |
|
|
|
|
|
|
|
|
|
var msg = 'Вас выбрали исполнителем для заказа ' |
|
|
|
|
var msg = 'Вас выбрали исполнителем для заказа '; |
|
|
|
|
|
|
|
|
|
socketMain.add_message({ |
|
|
|
|
format_type: 'add_message_contact', |
|
|
|
|
@ -1212,42 +1220,42 @@ |
|
|
|
|
sender_id: String(senderId), |
|
|
|
|
recipent_id: String(recipentId), |
|
|
|
|
order_id: String(orderId), |
|
|
|
|
chat_message: msg, |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
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') |
|
|
|
|
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, |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
chat_message: msg |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$(this).closest('form').submit(); |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('.reject-project-link-contractor').on('click', function(e){ |
|
|
|
|
e.preventDefault(); |
|
|
|
|
$(this).closest('form').submit(); |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
window.toggleProjectAnswerForm = toggleProjectAnswerForm |
|
|
|
|
}()) |
|
|
|
|
}()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1257,6 +1265,6 @@ |
|
|
|
|
if (_.includes(window.location.hash, ['#new-answers','#candidate-answers','#rejected-answers'])) { |
|
|
|
|
$(window).scrollTop($('.-answers-scroll-to').first().offset().top) |
|
|
|
|
} |
|
|
|
|
}, 100) |
|
|
|
|
}, 400) |
|
|
|
|
</script> |
|
|
|
|
{% endblock %} |
|
|
|
|
|