#ARC-14 (18, 23, 24)

remotes/origin/PR-39
ArturBaybulatov 9 years ago
parent 5205b388ed
commit d9b6897601
  1. 67
      projects/templates/project_detail.html

@ -109,7 +109,7 @@
<div class="col-lg-10 col-lg-offset-1">
{% if request.user.is_contractor and not answer %}
<a href="#" onclick="$('.-project-answer-form').toggle('slow'); return false" class="new-answer">
<a href="#" onclick="toggleProjectAnswerForm(); return false" class="new-answer">
Ответить на проект
</a>
@ -283,6 +283,18 @@
<input type="hidden" name="next" value="{{ request.path }}">
<a href="#" onclick="$(this).closest('form').submit(); return false" class="candLink candLink3" title="{{ answer.pk }}">отказ</a>
</form>
{% if project.order.contractor and project.order.contractor == answer.author %}
<a href="/chat/#order{{ project.order.pk }}" class="candLink candLink2">Перейти к обсуждению</a>
{% elif project.order.team and project.order.team == answer.author %}
<a href="/chat/#order{{ project.order.pk }}" class="candLink candLink2">Перейти к обсуждению</a>
{% 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 %}
{% endif %}
</div>
@ -361,7 +373,7 @@
</div>
</div>
{% else %}
<form action="{% url 'projects:detail' pk=project.pk %}" method="POST" enctype="multipart/form-data" novalidate class="proj_answ_form -project-answer-form" s--tyle="display: none">
<form action="{% url 'projects:detail' pk=project.pk %}" method="POST" enctype="multipart/form-data" novalidate class="proj_answ_form -project-answer-form" style="display: none">
{% csrf_token %}
<input type="hidden" name="next" value="{% url 'projects:detail' pk=project.pk %}">
<input type="hidden" name="answer_as_team" value="{% if answer_as_team %}on{% endif %}">
@ -655,6 +667,12 @@
предложить проект
</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 %}
{% endif %}
<form action="{% url 'projects:reject-project-answer' pk=answer.pk %}" method="POST" novalidate>
@ -843,6 +861,12 @@
предложить проект
</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 %}
{% endif %}
<form action="{% url 'projects:reject-project-answer' pk=answer.pk %}" method="POST" novalidate>
@ -1016,6 +1040,12 @@
<input type="hidden" name="next" value="{{ request.path }}">
<a href="#" onclick="$(this).closest('form').submit(); return false" class="candLink candLink1" title="{{ answer.pk }}">Восстановить</a>
</form>
{% 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 %}
</div>
<div class="col-xs-12">
@ -1083,9 +1113,10 @@
{% block js_block %}
<script>
(function() {
// Persistent Bootstrap tabs --------------------------------------
// Persistent Bootstrap tabs --------------------------------------
;(function() {
var $allTabs = $('a[data-toggle="tab"]')
var $tab = $allTabs.filter('[href="' + window.location.hash + '"]').first()
@ -1104,5 +1135,31 @@
window.location.hash = $tab.attr('href')
})
}())
// Toggle project answer form -----------------------------------
;(function() {
var $projectAnswerForm = $('.-project-answer-form').first()
if ($.cookie('projectAnswerFormVisible')) {
$projectAnswerForm.show('slow')
$.cookie('projectAnswerFormVisible', 'true', {expires: new Date(new Date().getTime() + 300000)})
}
function toggleProjectAnswerForm() {
if ($.cookie('projectAnswerFormVisible')) {
$projectAnswerForm.hide('slow')
$.cookie('projectAnswerFormVisible', '', {expires: new Date(new Date().getTime() + 300000)})
} else {
$projectAnswerForm.show('slow')
$.cookie('projectAnswerFormVisible', 'true', {expires: new Date(new Date().getTime() + 300000)})
}
}
window.toggleProjectAnswerForm = toggleProjectAnswerForm
}())
</script>
{% endblock %}

Loading…
Cancel
Save