You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1262 lines
79 KiB
1262 lines
79 KiB
{% extends 'partials/base.html' %}
|
|
|
|
{% load humanize %}
|
|
{% load thumbnail %}
|
|
{% load specializtions_tags %}
|
|
{% load project_tags %}
|
|
|
|
|
|
{% block head_css %}
|
|
<style>
|
|
.-highlighted-message {
|
|
background-color: #E9FFF8;
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
|
|
{% block content %}
|
|
{% include 'partials/header.html' %}
|
|
|
|
<div class="container mainScore">
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<p class="titleScore">{{ project.name }}</p>
|
|
</div>
|
|
|
|
<div class="doneBlock new-done disTab">
|
|
<div class="triangle1"></div>
|
|
|
|
{% if request.user.is_contractor %}
|
|
<div class="col-lg-12 new-p">
|
|
<p>{{ project.budget|intcomma }} <i class="{% fa_currency_classes project.currency %}"></i></p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="col-lg-4">
|
|
<a href="{% url 'users:customer-profile-open-projects' project.customer.pk %}" class="aLinkExe">
|
|
<div class="imgExecutor">
|
|
{% if project.customer.avatar %}
|
|
{% thumbnail project.customer.avatar "125x125" crop="center" as im %}
|
|
<img src="{{ im.url }}" alt="execitor-image">
|
|
{% endthumbnail %}
|
|
{% else %}
|
|
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image">
|
|
{% endif %}
|
|
</div>
|
|
</a>
|
|
<p class="nameExecutor">
|
|
<a href="{% url 'users:customer-profile-open-projects' project.customer.pk %}">{{ project.customer.get_full_name }} [{{ project.customer.username }}]</a>
|
|
</p>
|
|
<p class="navv2">На сайте {{ project.created|naturaltime }}</p>
|
|
|
|
{% if not request.user.is_contractor %}
|
|
<ul class="rettList restList3">
|
|
<li>
|
|
<a href="javascript:void(0)">Отзывы:
|
|
<span> + 0</span>
|
|
<small> 0</small>
|
|
<mark> - 0</mark>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% if request.user.is_contractor %}
|
|
<div class="col-lg-3 retts">
|
|
<ul class="rettList restList2">
|
|
<li>Рейтинг: <span> 0</span></li>
|
|
<li>Безопасные сделки: <span> 0</span></li>
|
|
<li>
|
|
<a href="javascript:void(0)">Отзывы:
|
|
<span> + 0</span>
|
|
<small> 0</small>
|
|
<mark> - 0</mark>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="col-lg-3 retts new-list">
|
|
<ul class="desListPro">
|
|
<li>
|
|
{{ project.created }}
|
|
</li>
|
|
<li>
|
|
{{ project.get_work_type_display }}
|
|
</li>
|
|
</ul>
|
|
|
|
{% if project.cro %}
|
|
<div class="sroUser sroExecutor sroPro">
|
|
<div class="iconSRO"></div>
|
|
<p>Есть допуск СРО</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="infoProjectBlock info-new disTab">
|
|
<div class="triangle2"></div>
|
|
|
|
{% if project.realty %}
|
|
<div class="col-lg-10 col-lg-offset-1">
|
|
<ul class="listProjectIn">
|
|
<li><span>Местоположение:</span> {{ project.realty.location.name }}</li>
|
|
<li><span>Классификация здания:</span> {{ project.realty.building_classification.name }}</li>
|
|
<li><span>Вид строительства:</span> {{ project.realty.construction_type.name }}</li>
|
|
</ul>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="col-lg-10 col-lg-offset-1">
|
|
<p class="textProIn">
|
|
{{ project.text|linebreaksbr }}
|
|
</p>
|
|
</div>
|
|
|
|
<div class="col-lg-10 col-lg-offset-1">
|
|
{% if request.user.is_contractor and not answer %}
|
|
<a href="#" onclick="toggleProjectAnswerForm(); return false" class="new-answer">
|
|
Ответить на проект
|
|
</a>
|
|
|
|
{% if can_answer_as_team %}
|
|
<div class="polsF1 pols-new disTab">
|
|
<div class="col-lg-3">
|
|
<form action="{% url 'projects:detail' pk=project.pk %}" method="GET" novalidate>
|
|
<select name="answer_as_team" class="selectpicker" onchange="$(this).closest('form').submit()">
|
|
{% if answer_as_team %}
|
|
<option value="">От своего имени</option>
|
|
<option value="on" selected>От имени группы</option>
|
|
{% else %}
|
|
<option value="" selected>От своего имени</option>
|
|
<option value="on">От имени группы</option>
|
|
{% endif %}
|
|
</select>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% elif request.user.is_customer and request.user == project.customer %}
|
|
<a href="{% url 'projects:customer-project-edit' pk=project.pk %}?back={{ request.path }}" class="linkProIn linkProIn1">
|
|
Редактировать
|
|
</a>
|
|
|
|
{% if project.state == 'active' %}
|
|
<form action="{% url 'projects:customer-project-trash' pk=project.pk %}" method="POST">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="next" value="{{ request.path }}">
|
|
|
|
<a href="#" onclick="$(this).closest('form').submit(); return false" class="linkProIn linkProIn2">
|
|
Снять с публикации
|
|
</a>
|
|
</form>
|
|
{% elif project.state == 'trashed' %}
|
|
<form action="{% url 'projects:customer-project-restore' pk=project.pk %}" method="POST">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="next" value="{{ request.path }}">
|
|
|
|
<a href="#" onclick="$(this).closest('form').submit(); return false" class="linkProIn linkProIn2">
|
|
Восстановить из корзины
|
|
</a>
|
|
</form>
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% if request.user.is_contractor %}
|
|
{% if answer %}
|
|
<div class="candidateBlock disTab">
|
|
<div class="candidate can-new">
|
|
<div class="col-lg-4">
|
|
{% if answer.author|class_name == 'User' %}
|
|
<a href="{% url 'users:contractor-profile' pk=answer.author.pk %}" class="aLinkExe">
|
|
<div class="imgExecutor">
|
|
{% if answer.author.avatar %}
|
|
{% thumbnail answer.author.avatar "125x125" crop="center" as avatar %}
|
|
<img src="{{ avatar.url }}" alt="execitor-image">
|
|
{% endthumbnail %}
|
|
{% else %}
|
|
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image">
|
|
{% endif %}
|
|
</div>
|
|
</a>
|
|
|
|
<p class="nameExecutor">
|
|
<a href="{% url 'users:contractor-profile' pk=answer.author.pk %}">{{ answer.author.get_full_name }} [{{ answer.author.username }}]</a>
|
|
</p>
|
|
{% elif answer.author|class_name == 'Team' %}
|
|
<a href="{% url 'users:team-profile' pk=answer.author.pk %}" class="aLinkExe">
|
|
<div class="imgExecutor">
|
|
{% if answer.author.owner.avatar %}
|
|
{% thumbnail answer.author.owner.avatar "125x125" crop="center" as avatar %}
|
|
<img src="{{ avatar.url }}" alt="execitor-image">
|
|
{% endthumbnail %}
|
|
{% else %}
|
|
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image">
|
|
{% endif %}
|
|
</div>
|
|
</a>
|
|
|
|
<p class="nameExecutor">
|
|
<a href="{% url 'users:team-profile' pk=answer.author.pk %}">{{ answer.author.name }}</a>
|
|
</p>
|
|
{% endif %}
|
|
|
|
<p class="navv2">На сайте {{ answer.author.created }}</p>
|
|
|
|
{% if answer.author|class_name == 'User' %}
|
|
{% if answer.author.contractor_status == 'free' %}
|
|
<div class="statusUser">Свободен</div><!-- ............. -->
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
<div class="col-lg-3 retts">
|
|
<ul class="rettList restList2">
|
|
<li>Рейтинг: <span> 0</span></li>
|
|
<li>Безопасные сделки: <span> 0</span></li>
|
|
<li>
|
|
<a href="javascript:void(0)">Отзывы:
|
|
<span> + 0</span>
|
|
<small> 0</small>
|
|
<mark> - 0</mark>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
|
|
{% if answer.author|class_name == 'User' and answer.author.cro %}
|
|
<div class="sroUser sroExecutor">
|
|
<div class="iconSRO"></div>
|
|
<p>Есть допуск СРО</p>
|
|
</div>
|
|
{% elif answer.author|class_name == 'Team' %}
|
|
<!-- TODO -->
|
|
|
|
<div class="sroUser sroExecutor">
|
|
<div class="iconSRO"></div>
|
|
<p>Есть допуск СРО</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
<div class="col-lg-2 listCens">
|
|
<p>
|
|
Цена:
|
|
<span>{{ answer.budget|intcomma }}</span>
|
|
<i class="{% fa_currency_classes answer.currency %}"></i>
|
|
</p>
|
|
<p>
|
|
{% if answer.term_type == 'project' %}
|
|
Срок: <span>За проект</span>
|
|
{% else %}
|
|
Срок: <span>{% morph answer.term TERM_TYPE_MORPHS|get:answer.term_type %}</span>
|
|
{% endif %}
|
|
</p>
|
|
<p>Опубликован: {{ answer.created|date:'M d, Y' }}</p>
|
|
</div>
|
|
<div class="col-lg-3 retts">
|
|
<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="#" class="candLink candLink3 reject-project-link-contractor" 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>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="col-xs-12">
|
|
<ul>
|
|
{% for answer_file in answer.files.all %}
|
|
<li><a href="{{ answer_file.file.url }}">{{ answer_file.name }}</a> <span>{{ answer_file.file.size|filesizeformat }}</span></li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="gallMini disTab">
|
|
{% for portf in answer.portfolios.all %}
|
|
<div class="col-lg-3">
|
|
<div class="insetCol box-sizing disTab">
|
|
<div class="imgGal" style="background: url('{{ portf.photos.first.img.url }}') no-repeat center">
|
|
<div class="imgFigure"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="commBlock44 disTab">
|
|
{% for message in answer.messages.all %}
|
|
<div class="comm44 disTab">
|
|
<div class="col-lg-10 col-lg-offset-1 {% if not message.is_sender_customer %}-highlighted-message{% endif %}">
|
|
{% if message.is_sender_customer %}
|
|
<p class="nameComm">
|
|
{% firstof project.customer.get_full_name.strip project.customer.username %}
|
|
</p>
|
|
{% else %}
|
|
<p class="nameComm nameCommAct">
|
|
{% if answer.author|class_name == 'User' %}
|
|
{% firstof answer.author.get_full_name.strip answer.author.username %}
|
|
{% elif answer.author|class_name == 'Team' %}
|
|
{% firstof answer.author.name.strip answer.author.owner.username %}
|
|
{% endif %}
|
|
</p>
|
|
{% endif %}
|
|
|
|
<span class="dateComm44">
|
|
{{ message.created }}
|
|
</span>
|
|
|
|
<p class="textComm44">
|
|
{{ message.text|linebreaksbr }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
|
|
<div class="comm44 disTab">
|
|
<div class="col-lg-10 col-lg-offset-1">
|
|
<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 %}">
|
|
|
|
<div><textarea name="text" class="fr_answer"></textarea></div>
|
|
<div><button type="submit" class="fr_answer_sen">Отправить</button></div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</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" 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 %}">
|
|
|
|
<div class="polsF1 disTab">
|
|
<div class="col-xs-12" style="color: red">
|
|
{{ form.non_field_errors|safe }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="polsF1 disTab">
|
|
<div class="col-lg-4">
|
|
<div class="textAreaBlock2 text-nn box-sizing disTab">
|
|
<p class="titleResF1">Стоимость <span style="color: red">{{ form.budget.errors.as_text }}</span></p>
|
|
<input type="text" class="box-sizing" name="{{ form.budget.html_name }}" value="{{ form.budget.value }}">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-2">
|
|
<div class="textAreaBlock2 text-nn box-sizing disTab">
|
|
<p><span style="color: red">{{ form.currency.errors.as_text }}</span></p>
|
|
{{ form.currency }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-4">
|
|
<div class="textAreaBlock2 text-nn box-sizing disTab">
|
|
<p>Срок <span style="color: red">{{ form.term.errors.as_text }}</span></p>
|
|
<input type="text" class="box-sizing" name="{{ form.term.html_name }}" value="{{ form.term.value }}">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-2">
|
|
<div class="textAreaBlock2 text-nn box-sizing disTab">
|
|
<p><span style="color: red">{{ form.term_type.errors.as_text }}</span></p>
|
|
{{ form.term_type }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="polsF1 disTab searchF1">
|
|
<div class="col-lg-12">
|
|
<div class="textAreaBlock2 text-nn box-sizing disTab">
|
|
<p>Текст <span style="color: red">{{ form.text.errors.as_text }}</span></p>
|
|
<textarea name="{{ form.text.html_name }}" id="text-new">{{ form.text.value }}</textarea>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-3"></div>
|
|
</div>
|
|
|
|
<div id="answer-portfolio-photo-widget-container" class="polsF1 disTab searchF1">
|
|
<div class="col-lg-3 answer-portfolio-photo-widget" style="display: none">
|
|
<div class="insetCol box-sizing disTab">
|
|
<div class="imgGal answer-portfolio-photo-widget-photo-cont">
|
|
<div class="imgFigure"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="polsF1 disTab searchF1">
|
|
<div class="col-lg-12 port_add_bl">
|
|
<p>Портфолио <span style="color: red">{{ form.portfolios.errors.as_text }}</span></p>
|
|
|
|
<ul>
|
|
{% for p in form.portfolios.field.queryset.all %}
|
|
<li>
|
|
<label>
|
|
<input
|
|
type="checkbox"
|
|
name="{{ form.portfolios.html_name }}"
|
|
value="{{ p.pk }}"
|
|
{% if p.pk|str in form.portfolios.value %}checked{% endif %}
|
|
class="answer-portfolio-select">
|
|
|
|
<span></span>
|
|
</label>
|
|
|
|
<p>{{ p.name }}</p>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="polsF1 disTab searchF1">
|
|
<div class="col-lg-12">
|
|
<div id="fileUploadContainer">
|
|
<div>
|
|
<button type="button" id="fileUploadAddBtn">Добавить файл</button> Не более 10 файлов общим объемом до 500 Мб
|
|
</div>
|
|
|
|
<ul class="list-new-new">
|
|
<li class="file-upload-widget" style="display: none">
|
|
<input type="file" name="new_files" class="file-upload-input" style="position: absolute; top: -1000px; left: -1000px">
|
|
<span class="file-upload-label"></span>
|
|
<a href="#" onclick="return false" class="file-upload-remove-btn">×</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="polsF1 disTab searchF1">
|
|
<div class="col-lg-12">
|
|
<div class="check_bs">
|
|
<label>
|
|
{{ form.secure_deal_only }}
|
|
<span></span>
|
|
</label>
|
|
<p>{{ form.secure_deal_only.label }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="polsF1 disTab searchF1">
|
|
<div class="col-lg-12">
|
|
<div class="send_req_block">
|
|
<button type="submit">Опубликовать ответ</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="polsF1 disTab searchF1"></div>
|
|
</form>
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% elif request.user.is_customer and project in request.user.customer_projects.all %}
|
|
<div class="exBigBlock disTab -answers-scroll-to">
|
|
<div class="col-lg-12">
|
|
<p id="answers" class="titleEx">Исполнители</p>
|
|
</div>
|
|
<div class="col-lg-12 exButton">
|
|
<div class="btn-group" role="group">
|
|
<a href="#new-answers" data-toggle="tab" class="btn btn-default">
|
|
Новые <span>{{ project|get_new_answers|length }}</span>
|
|
</a>
|
|
<a href="#candidate-answers" data-toggle="tab" class="btn btn-default">
|
|
Кандидаты <span>{{ project|get_candidate_answers|length }}</span>
|
|
</a>
|
|
<a href="#rejected-answers" data-toggle="tab" class="btn btn-default">
|
|
Отказы <span>{{ project|get_rejected_answers|length }}</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
{% if project.answers.exists %}
|
|
{% if project.candidates.count > 1 %}
|
|
<div class="col-lg-12 compareBlock">
|
|
<div class="col-lg-2 col-lg-offset-5">
|
|
<p><a href="{% url 'projects:comparison' project.pk %}">Сравнить кандидатов</a></p>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="tab-content">
|
|
<div id="new-answers" class="tab-pane fade in active">
|
|
<div class="col-lg-12 exNew">
|
|
<p>Новые исполнители</p>
|
|
</div>
|
|
|
|
{% for answer in project|get_new_answers %}
|
|
<div class="candidateBlock disTab">
|
|
<div class="candidate">
|
|
<div class="col-lg-4">
|
|
{% if answer.author|class_name == 'User' %}
|
|
<a href="{% url 'users:contractor-profile' pk=answer.author.pk %}" class="aLinkExe">
|
|
<div class="imgExecutor">
|
|
{% if answer.author.avatar %}
|
|
{% thumbnail answer.author.avatar "125x125" crop="center" as avatar %}
|
|
<img src="{{ avatar.url }}" alt="execitor-image">
|
|
{% endthumbnail %}
|
|
{% else %}
|
|
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image">
|
|
{% endif %}
|
|
</div>
|
|
</a>
|
|
|
|
<p class="nameExecutor">
|
|
<a href="{% url 'users:contractor-profile' pk=answer.author.pk %}">{{ answer.author.get_full_name }} [{{ answer.author.username }}]</a>
|
|
</p>
|
|
{% elif answer.author|class_name == 'Team' %}
|
|
<a href="{% url 'users:team-profile' pk=answer.author.pk %}" class="aLinkExe">
|
|
<div class="imgExecutor">
|
|
{% if answer.author.owner.avatar %}
|
|
{% thumbnail answer.author.owner.avatar "125x125" crop="center" as avatar %}
|
|
<img src="{{ avatar.url }}" alt="execitor-image">
|
|
{% endthumbnail %}
|
|
{% else %}
|
|
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image">
|
|
{% endif %}
|
|
</div>
|
|
</a>
|
|
|
|
<p class="nameExecutor">
|
|
<a href="{% url 'users:team-profile' pk=answer.author.pk %}">{{ answer.author.name }}</a>
|
|
</p>
|
|
{% endif %}
|
|
|
|
<p class="navv2">На сайте {{ answer.author.created }}</p>
|
|
|
|
{% if answer.author|class_name == 'User' %}
|
|
{% if answer.author.contractor_status == 'free' %}
|
|
<div class="statusUser">Свободен</div><!-- ............. -->
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-lg-3 retts">
|
|
{% 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">
|
|
<div class="iconSRO"></div>
|
|
<p>Есть допуск СРО</p>
|
|
</div>
|
|
{% elif answer.author|class_name == 'Team' %}
|
|
<!-- TODO -->
|
|
|
|
<div class="sroUser sroExecutor">
|
|
<div class="iconSRO"></div>
|
|
<p>Есть допуск СРО</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-lg-2 listCens">
|
|
<p>
|
|
Цена:
|
|
<span>{{ answer.budget|intcomma }}</span>
|
|
<i class="{% fa_currency_classes answer.currency %}"></i>
|
|
</p>
|
|
<p>
|
|
{% if answer.term_type == 'project' %}
|
|
Срок: <span>За проект</span>
|
|
{% elif answer.term and answer.term_type %}
|
|
Срок: <span>{% morph answer.term TERM_TYPE_MORPHS|get:answer.term_type %}</span>
|
|
{% endif %}
|
|
</p>
|
|
<p>Опубликован: {{ answer.created|date:'M d, Y' }}</p>
|
|
</div>
|
|
|
|
<div class="col-lg-3 retts">
|
|
{% if answer.author not in project|get_candidates %}
|
|
<a href="{% url 'projects:add-candidate' answer_id=answer.pk project_id=project.pk %}" class="candLink candLink1">
|
|
Кандидат
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% 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>
|
|
{% elif not project.order.contractor and not project.order.team %}
|
|
<form action="{% url 'projects:customer-offer-order' answer_id=answer.pk project_id=project.pk %}" method="POST" novalidate>
|
|
{% csrf_token %}
|
|
|
|
<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>
|
|
{% 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>
|
|
{% csrf_token %}
|
|
<input type="hidden" name="next" value="{{ request.path }}">
|
|
<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>
|
|
|
|
<div class="col-xs-12">
|
|
<ul>
|
|
{% for answer_file in answer.files.all %}
|
|
<li><a href="{{ answer_file.file.url }}">{{ answer_file.name }}</a> <span>{{ answer_file.file.size|filesizeformat }}</span></li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="gallMini disTab">
|
|
{% for portf in answer.portfolios.all %}
|
|
<div class="col-lg-3">
|
|
<div class="insetCol box-sizing disTab">
|
|
<div class="imgGal" style="background: url('{{ portf.photos.first.img.url }}') no-repeat center">
|
|
<div class="imgFigure"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<div class="commBlock44 disTab">
|
|
{% for message in answer.messages.all %}
|
|
<div class="comm44 disTab">
|
|
<div class="col-lg-10 col-lg-offset-1 {% if message.is_sender_customer %}-highlighted-message{% endif %}">
|
|
{% if message.is_sender_customer %}
|
|
<p class="nameComm nameCommAct">
|
|
{% firstof project.customer.get_full_name.strip project.customer.username %}
|
|
</p>
|
|
{% else %}
|
|
<p class="nameComm">
|
|
{% if answer.author|class_name == 'User' %}
|
|
{% firstof answer.author.get_full_name.strip answer.author.username %}
|
|
{% elif answer.author|class_name == 'Team' %}
|
|
{% firstof answer.author.name.strip answer.author.owner.username %}
|
|
{% endif %}
|
|
</p>
|
|
{% endif %}
|
|
|
|
<span class="dateComm44">
|
|
{{ message.created }}
|
|
</span>
|
|
|
|
<p class="textComm44">
|
|
{{ message.text|linebreaksbr }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
|
|
<div class="comm44 disTab">
|
|
<div class="col-lg-10 col-lg-offset-1">
|
|
<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 %}">
|
|
|
|
<div><textarea name="text" class="fr_answer"></textarea></div>
|
|
<div><button type="submit" class="fr_answer_sen">Отправить</button></div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div id="candidate-answers" class="tab-pane fade">
|
|
<div class="col-lg-12 exNew">
|
|
<p>Кандидаты</p>
|
|
</div>
|
|
|
|
{% for answer in project|get_candidate_answers %}
|
|
<div class="candidateBlock disTab">
|
|
<div class="candidate">
|
|
<div class="col-lg-4">
|
|
{% if answer.author|class_name == 'User' %}
|
|
<a href="{% url 'users:contractor-profile' pk=answer.author.pk %}" class="aLinkExe">
|
|
<div class="imgExecutor">
|
|
{% if answer.author.avatar %}
|
|
{% thumbnail answer.author.avatar "125x125" crop="center" as avatar %}
|
|
<img src="{{ avatar.url }}" alt="execitor-image">
|
|
{% endthumbnail %}
|
|
{% else %}
|
|
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image">
|
|
{% endif %}
|
|
</div>
|
|
</a>
|
|
|
|
<p class="nameExecutor">
|
|
<a href="{% url 'users:contractor-profile' pk=answer.author.pk %}">{{ answer.author.get_full_name }} [{{ answer.author.username }}]</a>
|
|
</p>
|
|
{% elif answer.author|class_name == 'Team' %}
|
|
<a href="{% url 'users:team-profile' pk=answer.author.pk %}" class="aLinkExe">
|
|
<div class="imgExecutor">
|
|
{% if answer.author.owner.avatar %}
|
|
{% thumbnail answer.author.owner.avatar "125x125" crop="center" as avatar %}
|
|
<img src="{{ avatar.url }}" alt="execitor-image">
|
|
{% endthumbnail %}
|
|
{% else %}
|
|
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image">
|
|
{% endif %}
|
|
</div>
|
|
</a>
|
|
|
|
<p class="nameExecutor">
|
|
<a href="{% url 'users:team-profile' pk=answer.author.pk %}">{{ answer.author.name }}</a>
|
|
</p>
|
|
{% endif %}
|
|
|
|
<p class="navv2">На сайте {{ answer.author.created }}</p>
|
|
|
|
{% if answer.author|class_name == 'User' %}
|
|
{% if answer.author.contractor_status == 'free' %}
|
|
<div class="statusUser">Свободен</div><!-- ............. -->
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-lg-3 retts">
|
|
{% 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">
|
|
<div class="iconSRO"></div>
|
|
<p>Есть допуск СРО</p>
|
|
</div>
|
|
{% elif answer.author|class_name == 'Team' %}
|
|
<!-- TODO -->
|
|
|
|
<div class="sroUser sroExecutor">
|
|
<div class="iconSRO"></div>
|
|
<p>Есть допуск СРО</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-lg-2 listCens">
|
|
<p>
|
|
Цена:
|
|
<span>{{ answer.budget|intcomma }}</span>
|
|
<i class="{% fa_currency_classes answer.currency %}"></i>
|
|
</p>
|
|
<p>
|
|
{% if answer.term_type == 'project' %}
|
|
Срок: <span>За проект</span>
|
|
{% else %}
|
|
Срок: <span>{% morph answer.term TERM_TYPE_MORPHS|get:answer.term_type %}</span>
|
|
{% endif %}
|
|
</p>
|
|
<p>Опубликован: {{ answer.created|date:'M d, Y' }}</p>
|
|
</div>
|
|
|
|
<div class="col-lg-3 retts">
|
|
{% if TESTING %}
|
|
<a href="{% url 'projects:add-candidate' answer_id=answer.pk project_id=project.pk %}" class="candLink candLink1">
|
|
Кандидат
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% 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>
|
|
{% elif not project.order.contractor and not project.order.team %}
|
|
<form action="{% url 'projects:customer-offer-order' answer_id=answer.pk project_id=project.pk %}" method="POST" novalidate>
|
|
{% csrf_token %}
|
|
|
|
<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>
|
|
{% 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>
|
|
{% csrf_token %}
|
|
<input type="hidden" name="next" value="{{ request.path }}">
|
|
<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>
|
|
|
|
<div class="col-xs-12">
|
|
<ul>
|
|
{% for answer_file in answer.files.all %}
|
|
<li><a href="{{ answer_file.file.url }}">{{ answer_file.name }}</a> <span>{{ answer_file.file.size|filesizeformat }}</span></li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="gallMini disTab">
|
|
{% for portf in answer.portfolios.all %}
|
|
<div class="col-lg-3">
|
|
<div class="insetCol box-sizing disTab">
|
|
<div class="imgGal" style="background: url('{{ portf.photos.first.img.url }}') no-repeat center">
|
|
<div class="imgFigure"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<div class="commBlock44 disTab">
|
|
{% for message in answer.messages.all %}
|
|
<div class="comm44 disTab">
|
|
<div class="col-lg-10 col-lg-offset-1 {% if message.is_sender_customer %}-highlighted-message{% endif %}">
|
|
{% if message.is_sender_customer %}
|
|
<p class="nameComm nameCommAct">
|
|
{% firstof project.customer.get_full_name.strip project.customer.username %}
|
|
</p>
|
|
{% else %}
|
|
<p class="nameComm">
|
|
{% if answer.author|class_name == 'User' %}
|
|
{% firstof answer.author.get_full_name.strip answer.author.username %}
|
|
{% elif answer.author|class_name == 'Team' %}
|
|
{% firstof answer.author.name.strip answer.author.owner.username %}
|
|
{% endif %}
|
|
</p>
|
|
{% endif %}
|
|
|
|
<span class="dateComm44">
|
|
{{ message.created }}
|
|
</span>
|
|
|
|
<p class="textComm44">
|
|
{{ message.text|linebreaksbr }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
|
|
<div class="comm44 disTab">
|
|
<div class="col-lg-10 col-lg-offset-1" style="padding:0;">
|
|
<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 %}">
|
|
|
|
<div><textarea style="margin-left:0;" name="text" class="fr_answer"></textarea></div>
|
|
<div><button style="margin-left:0;" type="submit" class="fr_answer_sen">Отправить</button></div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div id="rejected-answers" class="tab-pane fade">
|
|
<div class="col-lg-12 exNew">
|
|
<p>Отказы</p>
|
|
</div>
|
|
|
|
|
|
|
|
{% for answer in project|get_rejected_answers %}
|
|
<div class="candidateBlock disTab">
|
|
<div class="candidate">
|
|
<div class="col-lg-4">
|
|
{% if answer.author|class_name == 'User' %}
|
|
<a href="{% url 'users:contractor-profile' pk=answer.author.pk %}" class="aLinkExe">
|
|
<div class="imgExecutor">
|
|
{% if answer.author.avatar %}
|
|
{% thumbnail answer.author.avatar "125x125" crop="center" as avatar %}
|
|
<img src="{{ avatar.url }}" alt="execitor-image">
|
|
{% endthumbnail %}
|
|
{% else %}
|
|
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image">
|
|
{% endif %}
|
|
</div>
|
|
</a>
|
|
|
|
<p class="nameExecutor">
|
|
<a href="{% url 'users:contractor-profile' pk=answer.author.pk %}">{{ answer.author.get_full_name }} [{{ answer.author.username }}]</a>
|
|
</p>
|
|
{% elif answer.author|class_name == 'Team' %}
|
|
<a href="{% url 'users:team-profile' pk=answer.author.pk %}" class="aLinkExe">
|
|
<div class="imgExecutor">
|
|
{% if answer.author.owner.avatar %}
|
|
{% thumbnail answer.author.owner.avatar "125x125" crop="center" as avatar %}
|
|
<img src="{{ avatar.url }}" alt="execitor-image">
|
|
{% endthumbnail %}
|
|
{% else %}
|
|
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image">
|
|
{% endif %}
|
|
</div>
|
|
</a>
|
|
|
|
<p class="nameExecutor">
|
|
<a href="{% url 'users:team-profile' pk=answer.author.pk %}">{{ answer.author.name }}</a>
|
|
</p>
|
|
{% endif %}
|
|
|
|
<p class="navv2">На сайте {{ answer.author.created }}</p>
|
|
|
|
{% if answer.author|class_name == 'User' %}
|
|
{% if answer.author.contractor_status == 'free' %}
|
|
<div class="statusUser">Свободен</div><!-- ............. -->
|
|
{% endif %}
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-lg-3 retts">
|
|
{% 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">
|
|
<div class="iconSRO"></div>
|
|
<p>Есть допуск СРО</p>
|
|
</div>
|
|
{% elif answer.author|class_name == 'Team' %}
|
|
<!-- TODO -->
|
|
|
|
<div class="sroUser sroExecutor">
|
|
<div class="iconSRO"></div>
|
|
<p>Есть допуск СРО</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-lg-2 listCens">
|
|
<p>
|
|
Цена:
|
|
<span>{{ answer.budget|intcomma }}</span>
|
|
<i class="{% fa_currency_classes answer.currency %}"></i>
|
|
</p>
|
|
<p>
|
|
{% if answer.term_type == 'project' %}
|
|
Срок: <span>За проект</span>
|
|
{% else %}
|
|
Срок: <span>{% morph answer.term TERM_TYPE_MORPHS|get:answer.term_type %}</span>
|
|
{% endif %}
|
|
</p>
|
|
<p>Опубликован: {{ answer.created|date:'M d, Y' }}</p>
|
|
</div>
|
|
|
|
<div class="col-lg-3 retts">
|
|
<form action="{% url 'projects:restore-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 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">
|
|
<ul>
|
|
{% for answer_file in answer.files.all %}
|
|
<li><a href="{{ answer_file.file.url }}">{{ answer_file.name }}</a> <span>{{ answer_file.file.size|filesizeformat }}</span></li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="gallMini disTab">
|
|
{% for portf in answer.portfolios.all %}
|
|
<div class="col-lg-3">
|
|
<div class="insetCol box-sizing disTab">
|
|
<div class="imgGal" style="background: url('{{ portf.photos.first.img.url }}') no-repeat center">
|
|
<div class="imgFigure"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<div class="commBlock44 disTab">
|
|
{% for message in answer.messages.all %}
|
|
<div class="comm44 disTab">
|
|
<div class="col-lg-10 col-lg-offset-1 {% if message.is_sender_customer %}-highlighted-message{% endif %}">
|
|
{% if message.is_sender_customer %}
|
|
<p class="nameComm nameCommAct">
|
|
{% firstof project.customer.get_full_name.strip project.customer.username %}
|
|
</p>
|
|
{% else %}
|
|
<p class="nameComm">
|
|
{% if answer.author|class_name == 'User' %}
|
|
{% firstof answer.author.get_full_name.strip answer.author.username %}
|
|
{% elif answer.author|class_name == 'Team' %}
|
|
{% firstof answer.author.name.strip answer.author.owner.username %}
|
|
{% endif %}
|
|
</p>
|
|
{% endif %}
|
|
|
|
<span class="dateComm44">
|
|
{{ message.created }}
|
|
</span>
|
|
|
|
<p class="textComm44">
|
|
{{ message.text|linebreaksbr }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% include 'partials/footer.html' %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
|
|
{% block js_block %}
|
|
<script>
|
|
// Persistent Bootstrap tabs --------------------------------------
|
|
|
|
|
|
;(function() {
|
|
var $allTabs = $('a[data-toggle="tab"]')
|
|
|
|
var $tab = $allTabs.filter('[href="' + window.location.hash + '"]').first()
|
|
|
|
if (_.isEmpty($tab))
|
|
$tab = $allTabs.first()
|
|
|
|
$tab.tab('show')
|
|
$tab.addClass('active')
|
|
|
|
$allTabs.on('click', function($evt) { // Better handle "shown.bs.tab" event?
|
|
var $tab = $(this)
|
|
|
|
$allTabs.removeClass('active')
|
|
$tab.addClass('active')
|
|
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)})
|
|
}
|
|
}
|
|
|
|
|
|
$('.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
|
|
}())
|
|
|
|
|
|
|
|
// Scroll to answers -------------------------------------
|
|
|
|
setTimeout(function() {
|
|
if (_.includes(window.location.hash, ['#new-answers','#candidate-answers','#rejected-answers'])) {
|
|
$(window).scrollTop($('.-answers-scroll-to').first().offset().top)
|
|
}
|
|
}, 100)
|
|
</script>
|
|
{% endblock %}
|
|
|