|
|
|
|
@ -18,7 +18,13 @@ |
|
|
|
|
<img src="{{ im.url }}" alt="profile-image"> |
|
|
|
|
{% endthumbnail %} |
|
|
|
|
{% else %} |
|
|
|
|
<img src="{% static 'img/profile.jpg' %}" alt="profile-image"> |
|
|
|
|
{% if contractor.gender == "female" %} |
|
|
|
|
<img src="{% static 'img/avatars/avatar-female.jpg' %}" |
|
|
|
|
alt="profile-image"> |
|
|
|
|
{% else %} |
|
|
|
|
<img src="{% static 'img/avatars/avatar-male.jpg' %}" |
|
|
|
|
alt="profile-image"> |
|
|
|
|
{% endif %} |
|
|
|
|
{% endif %} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
@ -54,12 +60,12 @@ |
|
|
|
|
{% if request.user.is_customer %} |
|
|
|
|
<li class="icon_um4"> |
|
|
|
|
<a |
|
|
|
|
href="#" |
|
|
|
|
onclick="return false" |
|
|
|
|
data-contractor-id="{{ contractor.pk }}" |
|
|
|
|
data-toggle="modal" |
|
|
|
|
data-target="#projectSelectionModal"> |
|
|
|
|
предложить заказ |
|
|
|
|
href="#" |
|
|
|
|
onclick="return false" |
|
|
|
|
data-contractor-id="{{ contractor.pk }}" |
|
|
|
|
data-toggle="modal" |
|
|
|
|
data-target="#projectSelectionModal"> |
|
|
|
|
предложить заказ |
|
|
|
|
</a> |
|
|
|
|
<span></span> |
|
|
|
|
</li> |
|
|
|
|
@ -71,7 +77,9 @@ |
|
|
|
|
|
|
|
|
|
<ul> |
|
|
|
|
{% for team in contractor.teams.all %} |
|
|
|
|
<li><a href="{% url 'users:team-profile' pk=team.pk %}">{{ team.name }}</a><span></span></li> |
|
|
|
|
<li> |
|
|
|
|
<a href="{% url 'users:team-profile' pk=team.pk %}">{{ team.name }}</a><span></span> |
|
|
|
|
</li> |
|
|
|
|
{% endfor %} |
|
|
|
|
</ul> |
|
|
|
|
{% endif %} |
|
|
|
|
@ -84,16 +92,17 @@ |
|
|
|
|
</p> |
|
|
|
|
|
|
|
|
|
<p class="cityUser">{{ contractor.get_location }}</p> |
|
|
|
|
<p class="navv">На сайте c {{ contractor.created|date:"d M Y"}}</p> |
|
|
|
|
<p class="navv">На сайте c {{ contractor.created|date:"d M Y" }}</p> |
|
|
|
|
|
|
|
|
|
{% if contractor.contractor_status == 'free' %} |
|
|
|
|
<div class="statusUser">Свободен</div> |
|
|
|
|
{% else %} |
|
|
|
|
<div class="statusUser busy">Занят</div> |
|
|
|
|
<div class="statusUser busy">Занят</div> |
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
{% if request.user.is_authenticated %} |
|
|
|
|
<a href="#" data-toggle="modal" data-target="#contact-contactor-modal" class="showCon">показать контакты</a> |
|
|
|
|
<a href="#" data-toggle="modal" data-target="#contact-contactor-modal" class="showCon">показать |
|
|
|
|
контакты</a> |
|
|
|
|
{% endif %} |
|
|
|
|
</div> |
|
|
|
|
<div class="col-lg-4"> |
|
|
|
|
@ -115,7 +124,8 @@ |
|
|
|
|
<div class="modal-dialog"> |
|
|
|
|
<div class="modal-content"> |
|
|
|
|
<div class="modal-header"> |
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
|
|
|
|
<button type="button" class="close" data-dismiss="modal" |
|
|
|
|
aria-hidden="true">×</button> |
|
|
|
|
<h4 class="modal-title">Контакты владельца </h4> |
|
|
|
|
</div> |
|
|
|
|
<div class="modal-body"> |
|
|
|
|
@ -167,23 +177,6 @@ |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="tab-content"> |
|
|
|
|
<div id="tab11" class="tab-pane fade in active"> |
|
|
|
|
{% if contractor.pk == request.user.pk %} |
|
|
|
|
@ -197,7 +190,8 @@ |
|
|
|
|
<div class="modal-dialog" style="width:900px;"> |
|
|
|
|
<div class="modal-content"> |
|
|
|
|
<div class="modal-header"> |
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
|
|
|
|
<button type="button" class="close" data-dismiss="modal" |
|
|
|
|
aria-hidden="true">×</button> |
|
|
|
|
<h4 class="modal-title">Добавить портфолио</h4> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
@ -211,8 +205,12 @@ |
|
|
|
|
<script type="text/x-template" class="-portfolio-item-templ"> |
|
|
|
|
<div class="col-lg-4"> |
|
|
|
|
<div class="insetCol box-sizing disTab"> |
|
|
|
|
<div class="imgGal" style="background:rgba(0, 0, 0, 0) url('<%- portfolio.photos[0] && portfolio.photos[0].img %>') no-repeat scroll center center / cover"> |
|
|
|
|
<a class="open-modal-image" href="<%- portfolio.photos[0] && portfolio.photos[0].img %>"><div class="imgFigure"></div></a> |
|
|
|
|
<div class="imgGal" |
|
|
|
|
style="background:rgba(0, 0, 0, 0) url('<%- portfolio.photos[0] && portfolio.photos[0].img %>') no-repeat scroll center center / cover"> |
|
|
|
|
<a class="open-modal-image" |
|
|
|
|
href="<%- portfolio.photos[0] && portfolio.photos[0].img %>"> |
|
|
|
|
<div class="imgFigure"></div> |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
@ -220,20 +218,22 @@ |
|
|
|
|
<a href="<%- portfAbsUrl %>"><%- trunc({length: 50}, portfolio.name) %></a> |
|
|
|
|
|
|
|
|
|
<% if (authedContractorId === contractorId) { %> |
|
|
|
|
<div class="buttonsImg" disTab> |
|
|
|
|
<a href="<%- portfEditUrl %>"> |
|
|
|
|
<div class="insetBI insetBI1"> |
|
|
|
|
<i class="fa fa-pencil"></i> |
|
|
|
|
</div> |
|
|
|
|
</a> |
|
|
|
|
<div class="insetBI insetBI2"> |
|
|
|
|
<form action="<%- portfTrashUrl %>" method="POST" novalidate> |
|
|
|
|
{% csrf_token %} |
|
|
|
|
<input type="hidden" name="next" value="{{ request.path }}"> |
|
|
|
|
<a href="#" onclick="$(this).closest('form').submit(); return false"><i class="fa fa-times"></i></a> |
|
|
|
|
</form> |
|
|
|
|
<div class="buttonsImg" disTab> |
|
|
|
|
<a href="<%- portfEditUrl %>"> |
|
|
|
|
<div class="insetBI insetBI1"> |
|
|
|
|
<i class="fa fa-pencil"></i> |
|
|
|
|
</div> |
|
|
|
|
</a> |
|
|
|
|
<div class="insetBI insetBI2"> |
|
|
|
|
<form action="<%- portfTrashUrl %>" method="POST" novalidate> |
|
|
|
|
{% csrf_token %} |
|
|
|
|
<input type="hidden" name="next" value="{{ request.path }}"> |
|
|
|
|
<a href="#" |
|
|
|
|
onclick="$(this).closest('form').submit(); return false"><i |
|
|
|
|
class="fa fa-times"></i></a> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<% } %> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
@ -242,7 +242,8 @@ |
|
|
|
|
|
|
|
|
|
<div class="col-lg-9 col-lg-offset-3 -more-portfolios-btn"> |
|
|
|
|
<div class="linkElse"> |
|
|
|
|
<a href="#" onclick="loadMorePortfolios(); return false" class="showElse">показать еще</a> |
|
|
|
|
<a href="#" onclick="loadMorePortfolios(); return false" class="showElse">показать |
|
|
|
|
еще</a> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
@ -251,21 +252,21 @@ |
|
|
|
|
{% if contractor.pk == request.user.pk %} |
|
|
|
|
<div class="col-lg-9"> |
|
|
|
|
<p class="addWork"> |
|
|
|
|
<a href="{% url 'work_sell:create'%}">Добавить проект</a> |
|
|
|
|
<a href="{% url 'work_sell:create' %}">Добавить проект</a> |
|
|
|
|
</p> |
|
|
|
|
</div> |
|
|
|
|
{# <div id="worksell-modal" class="modal fade">#} |
|
|
|
|
{# <div class="modal-dialog" style="width: 900px;">#} |
|
|
|
|
{# <div class="modal-content">#} |
|
|
|
|
{# <div class="modal-header">#} |
|
|
|
|
{# <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>#} |
|
|
|
|
{# <h4 class="modal-title">Добавить готовую работу</h4>#} |
|
|
|
|
{# </div>#} |
|
|
|
|
{##} |
|
|
|
|
{# {% include 'worksell_create_form.html' %}#} |
|
|
|
|
{# </div>#} |
|
|
|
|
{# </div>#} |
|
|
|
|
{# </div>#} |
|
|
|
|
{# <div id="worksell-modal" class="modal fade">#} |
|
|
|
|
{# <div class="modal-dialog" style="width: 900px;">#} |
|
|
|
|
{# <div class="modal-content">#} |
|
|
|
|
{# <div class="modal-header">#} |
|
|
|
|
{# <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>#} |
|
|
|
|
{# <h4 class="modal-title">Добавить готовую работу</h4>#} |
|
|
|
|
{# </div>#} |
|
|
|
|
{##} |
|
|
|
|
{# {% include 'worksell_create_form.html' %}#} |
|
|
|
|
{# </div>#} |
|
|
|
|
{# </div>#} |
|
|
|
|
{# </div>#} |
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
<div class="galleryWork2 disTab -work-sells-container"> |
|
|
|
|
@ -273,8 +274,12 @@ |
|
|
|
|
<div class="col-lg-4"> |
|
|
|
|
<div class="insetCol box-sizing disTab"> |
|
|
|
|
<a href="#"> |
|
|
|
|
<div class="imgGal" style="background:rgba(0, 0, 0, 0) url('<%- workSell.photos[0] && workSell.photos[0].img %>') no-repeat scroll center center / cover"> |
|
|
|
|
<a class="open-modal-image" href="<%- workSell.photos[0] && workSell.photos[0].img %>"><div class="imgFigure"></div></a> |
|
|
|
|
<div class="imgGal" |
|
|
|
|
style="background:rgba(0, 0, 0, 0) url('<%- workSell.photos[0] && workSell.photos[0].img %>') no-repeat scroll center center / cover"> |
|
|
|
|
<a class="open-modal-image" |
|
|
|
|
href="<%- workSell.photos[0] && workSell.photos[0].img %>"> |
|
|
|
|
<div class="imgFigure"></div> |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
</a> |
|
|
|
|
|
|
|
|
|
@ -289,20 +294,22 @@ |
|
|
|
|
<a href="<%- workSellAbsUrl %>"><%- trunc({length: 50}, workSell.name) %></a> |
|
|
|
|
|
|
|
|
|
<% if (authedContractorId === contractorId) { %> |
|
|
|
|
<div class="buttonsImg" disTab> |
|
|
|
|
<div class="insetBI insetBI1"> |
|
|
|
|
<a href="<%- workSellEditUrl %>"> |
|
|
|
|
<i class="fa fa-pencil"></i> |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
<div class="insetBI insetBI2"> |
|
|
|
|
<form action="<%- workSellTrashUrl %>" method="POST" novalidate> |
|
|
|
|
{% csrf_token %} |
|
|
|
|
<input type="hidden" name="next" value="{{ request.path }}"> |
|
|
|
|
<a href="#" onclick="$(this).closest('form').submit(); return false"><i class="fa fa-times"></i></a> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
<div class="buttonsImg" disTab> |
|
|
|
|
<div class="insetBI insetBI1"> |
|
|
|
|
<a href="<%- workSellEditUrl %>"> |
|
|
|
|
<i class="fa fa-pencil"></i> |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
<div class="insetBI insetBI2"> |
|
|
|
|
<form action="<%- workSellTrashUrl %>" method="POST" novalidate> |
|
|
|
|
{% csrf_token %} |
|
|
|
|
<input type="hidden" name="next" value="{{ request.path }}"> |
|
|
|
|
<a href="#" |
|
|
|
|
onclick="$(this).closest('form').submit(); return false"><i |
|
|
|
|
class="fa fa-times"></i></a> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<% } %> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
@ -311,27 +318,13 @@ |
|
|
|
|
|
|
|
|
|
<div class="col-lg-9 col-lg-offset-3 -more-work-sells-btn"> |
|
|
|
|
<div class="linkElse"> |
|
|
|
|
<a href="#" onclick="loadMoreWorkSells(); return false" class="showElse">показать еще</a> |
|
|
|
|
<a href="#" onclick="loadMoreWorkSells(); return false" class="showElse">показать |
|
|
|
|
еще</a> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="tab13" class="tab-pane fade"> |
|
|
|
|
<div class="col-lg-9"> |
|
|
|
|
{% if contractor == request.user %} |
|
|
|
|
@ -344,7 +337,8 @@ |
|
|
|
|
<p>Загрузить резюме</p> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="upload2 up-l2" id="remove-resume-file" style="display:{% if contractor.contractor_resume.resume_file %}block;{% else %}none;{% endif %}"> |
|
|
|
|
<div class="upload2 up-l2" id="remove-resume-file" |
|
|
|
|
style="display:{% if contractor.contractor_resume.resume_file %}block;{% else %}none;{% endif %}"> |
|
|
|
|
<p style="margin:0;">Удалить резюме</p> |
|
|
|
|
</div> |
|
|
|
|
</form> |
|
|
|
|
@ -366,8 +360,9 @@ |
|
|
|
|
|
|
|
|
|
{% if contractor.contractor_resume.resume_file %} |
|
|
|
|
<a style="display:block;" |
|
|
|
|
href="{{ contractor.contractor_resume.resume_file.url }}" class="download-summ"> |
|
|
|
|
скачать резюме |
|
|
|
|
href="{{ contractor.contractor_resume.resume_file.url }}" |
|
|
|
|
class="download-summ"> |
|
|
|
|
скачать резюме |
|
|
|
|
</a> |
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
@ -403,7 +398,8 @@ |
|
|
|
|
</div> |
|
|
|
|
<div class="col-lg-12 wr-inset-pluss"> |
|
|
|
|
{% if contractor.pk == request.user.pk %} |
|
|
|
|
<a href="#" data-toggle="modal" data-target="#resume-text-edit" style="float: left; margin-right: 10px;"> |
|
|
|
|
<a href="#" data-toggle="modal" data-target="#resume-text-edit" |
|
|
|
|
style="float: left; margin-right: 10px;"> |
|
|
|
|
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span> |
|
|
|
|
</a> |
|
|
|
|
{% endif %} |
|
|
|
|
@ -418,18 +414,21 @@ |
|
|
|
|
<div class="modal-dialog" style="width:900px;"> |
|
|
|
|
<div class="modal-content"> |
|
|
|
|
<div class="modal-header"> |
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
|
|
|
|
<button type="button" class="close" data-dismiss="modal" |
|
|
|
|
aria-hidden="true">×</button> |
|
|
|
|
<h4 class="modal-title">Редактировать текст резюме</h4> |
|
|
|
|
</div> |
|
|
|
|
<div class="modal-body"> |
|
|
|
|
<div style="height: 180px;"> |
|
|
|
|
<form id="resume-edit-form"> |
|
|
|
|
<div class="textAreaBlock2 text-nn box-sizing disTab"> |
|
|
|
|
<textarea name="text" id="text-new" class="-ckeditor">{{ contractor.contractor_resume.text }}</textarea> |
|
|
|
|
<textarea name="text" id="text-new" |
|
|
|
|
class="-ckeditor">{{ contractor.contractor_resume.text }}</textarea> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="searchF1 polsF1 polsFF links-filter"> |
|
|
|
|
<input class="btn-submit-link" type="submit" value="Сохранить"> |
|
|
|
|
<input class="btn-submit-link" type="submit" |
|
|
|
|
value="Сохранить"> |
|
|
|
|
</div> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
@ -458,8 +457,9 @@ |
|
|
|
|
{% thumbnail diplom.img "210x334" crop="center" as im %} |
|
|
|
|
<div class="imgGal" |
|
|
|
|
style="background: url('{{ im.url }}') no-repeat center;"> |
|
|
|
|
<a href="{{ diplom.img.url }}" class='open-modal-image'> |
|
|
|
|
<div class="imgFigure"></div> |
|
|
|
|
<a href="{{ diplom.img.url }}" |
|
|
|
|
class='open-modal-image'> |
|
|
|
|
<div class="imgFigure"></div> |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
{% endthumbnail %} |
|
|
|
|
@ -471,7 +471,8 @@ |
|
|
|
|
|
|
|
|
|
{% if contractor.pk == request.user.pk %} |
|
|
|
|
<div class="buttonsImg" distab=""> |
|
|
|
|
<div class="insetBI insetBI2 delete-resume-file" data-id="{{ diplom.pk }}"> |
|
|
|
|
<div class="insetBI insetBI2 delete-resume-file" |
|
|
|
|
data-id="{{ diplom.pk }}"> |
|
|
|
|
<i class="fa fa-times"></i> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
@ -498,8 +499,9 @@ |
|
|
|
|
{% thumbnail cro.img "210x334" crop="center" as im %} |
|
|
|
|
<div class="imgGal" |
|
|
|
|
style="background: url('{{ im.url }}') no-repeat center;"> |
|
|
|
|
<a href="{{ cro.img.url }}" class='open-modal-image'> |
|
|
|
|
<div class="imgFigure"></div> |
|
|
|
|
<a href="{{ cro.img.url }}" |
|
|
|
|
class='open-modal-image'> |
|
|
|
|
<div class="imgFigure"></div> |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
{% endthumbnail %} |
|
|
|
|
@ -511,7 +513,8 @@ |
|
|
|
|
|
|
|
|
|
{% if contractor.pk == request.user.pk %} |
|
|
|
|
<div class="buttonsImg" distab=""> |
|
|
|
|
<div class="insetBI insetBI2 delete-resume-file" data-id="{{ cro.pk }}"> |
|
|
|
|
<div class="insetBI insetBI2 delete-resume-file" |
|
|
|
|
data-id="{{ cro.pk }}"> |
|
|
|
|
<i class="fa fa-times"></i> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
@ -548,9 +551,9 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{% empty %} |
|
|
|
|
<div class="new-comm-44"> |
|
|
|
|
<p style="text-align: center;">Отзывов пока нет</p> |
|
|
|
|
</div> |
|
|
|
|
<div class="new-comm-44"> |
|
|
|
|
<p style="text-align: center;">Отзывов пока нет</p> |
|
|
|
|
</div> |
|
|
|
|
{% endfor %} |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
@ -569,7 +572,8 @@ |
|
|
|
|
<script src='{% static "lib/ckeditor/adapters/jquery.js" %}'></script> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
;(function() { |
|
|
|
|
; |
|
|
|
|
(function () { |
|
|
|
|
// Pagination --------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -587,8 +591,10 @@ |
|
|
|
|
var workSellEditUrl = '/work_sell/%id%/edit/' |
|
|
|
|
var workSellTrashUrl = '/work_sell/%id%/trash/' |
|
|
|
|
|
|
|
|
|
var contractorId = {{ contractor.pk }} |
|
|
|
|
var authedContractorId{% if request.user.is_authenticated %} = {{ request.user.pk }}{% endif %} |
|
|
|
|
var contractorId = |
|
|
|
|
{{ contractor.pk }} |
|
|
|
|
var authedContractorId{% if request.user.is_authenticated %} = |
|
|
|
|
{{ request.user.pk }}{% endif %} |
|
|
|
|
|
|
|
|
|
var portfUrl = new URI('/api/portfolios/') |
|
|
|
|
var workSellUrl = new URI('/api/work-sells/') |
|
|
|
|
@ -602,26 +608,26 @@ |
|
|
|
|
portfUrl.setQuery('page', query.page ? Number(query.page) + 1 : 1) |
|
|
|
|
|
|
|
|
|
$.get(portfUrl.href()) |
|
|
|
|
.then(function(res) { |
|
|
|
|
_.each(function(portfolio) { |
|
|
|
|
$portfoliosContainer.append(portfolioItemTempl({ |
|
|
|
|
portfolio: portfolio, |
|
|
|
|
portfAbsUrl: _.replace('%id%', portfolio.id, portfAbsUrl), |
|
|
|
|
portfEditUrl: _.replace('%id%', portfolio.id, portfEditUrl), |
|
|
|
|
portfTrashUrl: _.replace('%id%', portfolio.id, portfTrashUrl), |
|
|
|
|
contractorId: contractorId, |
|
|
|
|
authedContractorId: authedContractorId, |
|
|
|
|
trunc: _.truncate, |
|
|
|
|
})) |
|
|
|
|
}, res.results) |
|
|
|
|
|
|
|
|
|
if (!res.next) |
|
|
|
|
$morePortfBtn.css('display', 'none') |
|
|
|
|
}) |
|
|
|
|
.then(function (res) { |
|
|
|
|
_.each(function (portfolio) { |
|
|
|
|
$portfoliosContainer.append(portfolioItemTempl({ |
|
|
|
|
portfolio: portfolio, |
|
|
|
|
portfAbsUrl: _.replace('%id%', portfolio.id, portfAbsUrl), |
|
|
|
|
portfEditUrl: _.replace('%id%', portfolio.id, portfEditUrl), |
|
|
|
|
portfTrashUrl: _.replace('%id%', portfolio.id, portfTrashUrl), |
|
|
|
|
contractorId: contractorId, |
|
|
|
|
authedContractorId: authedContractorId, |
|
|
|
|
trunc: _.truncate, |
|
|
|
|
})) |
|
|
|
|
}, res.results) |
|
|
|
|
|
|
|
|
|
if (!res.next) |
|
|
|
|
$morePortfBtn.css('display', 'none') |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
.then(function() { |
|
|
|
|
$('.open-modal-image').magnificPopup({type: 'image'}) |
|
|
|
|
}) |
|
|
|
|
.then(function () { |
|
|
|
|
$('.open-modal-image').magnificPopup({type: 'image'}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function loadMoreWorkSells() { |
|
|
|
|
@ -632,26 +638,26 @@ |
|
|
|
|
workSellUrl.setQuery('page', query.page ? Number(query.page) + 1 : 1) |
|
|
|
|
|
|
|
|
|
$.get(workSellUrl.href()) |
|
|
|
|
.then(function(res) { |
|
|
|
|
_.each(function(ws) { |
|
|
|
|
$workSellsContainer.append(workSellItemTempl({ |
|
|
|
|
workSell: ws, |
|
|
|
|
workSellAbsUrl: _.replace('%id%', ws.id, workSellAbsUrl), |
|
|
|
|
workSellEditUrl: _.replace('%id%', ws.id, workSellEditUrl), |
|
|
|
|
workSellTrashUrl: _.replace('%id%', ws.id, workSellTrashUrl), |
|
|
|
|
contractorId: contractorId, |
|
|
|
|
authedContractorId: authedContractorId, |
|
|
|
|
trunc: _.truncate, |
|
|
|
|
})) |
|
|
|
|
}, res.results) |
|
|
|
|
|
|
|
|
|
if (!res.next) |
|
|
|
|
$moreWorkSellsfBtn.css('display', 'none') |
|
|
|
|
}) |
|
|
|
|
.then(function (res) { |
|
|
|
|
_.each(function (ws) { |
|
|
|
|
$workSellsContainer.append(workSellItemTempl({ |
|
|
|
|
workSell: ws, |
|
|
|
|
workSellAbsUrl: _.replace('%id%', ws.id, workSellAbsUrl), |
|
|
|
|
workSellEditUrl: _.replace('%id%', ws.id, workSellEditUrl), |
|
|
|
|
workSellTrashUrl: _.replace('%id%', ws.id, workSellTrashUrl), |
|
|
|
|
contractorId: contractorId, |
|
|
|
|
authedContractorId: authedContractorId, |
|
|
|
|
trunc: _.truncate, |
|
|
|
|
})) |
|
|
|
|
}, res.results) |
|
|
|
|
|
|
|
|
|
if (!res.next) |
|
|
|
|
$moreWorkSellsfBtn.css('display', 'none') |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
.then(function() { |
|
|
|
|
$('.open-modal-image').magnificPopup({type: 'image'}) |
|
|
|
|
}) |
|
|
|
|
.then(function () { |
|
|
|
|
$('.open-modal-image').magnificPopup({type: 'image'}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
window.loadMorePortfolios = loadMorePortfolios |
|
|
|
|
@ -661,35 +667,32 @@ |
|
|
|
|
loadMoreWorkSells() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Persistent Bootstrap tabs -------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('a[data-toggle="tab"][href="' + window.location.hash + '"]').tab('show') |
|
|
|
|
|
|
|
|
|
$('a[data-toggle="tab"]').on('click', function($evt) { // Better handle "shown.bs.tab" event? |
|
|
|
|
$('a[data-toggle="tab"]').on('click', function ($evt) { // Better handle "shown.bs.tab" event? |
|
|
|
|
window.location.hash = $(this).attr('href') |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// A wysiwyg editor ---------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('textarea.-ckeditor').first().ckeditor() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Team invitation ----------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% if contractor.pk != request.user.pk and request.user.is_contractor and request.user.has_team %} |
|
|
|
|
var createTeamInvitationUrl = format('/users/create-team-invitation/%s/', {{ contractor.pk }}) |
|
|
|
|
|
|
|
|
|
$('.-team-invitation').first().on('click', function($evt) { |
|
|
|
|
$('.-team-invitation').first().on('click', function ($evt) { |
|
|
|
|
var $inviteBtn = $(this) |
|
|
|
|
|
|
|
|
|
$.post(createTeamInvitationUrl).then(function(res) { |
|
|
|
|
$.post(createTeamInvitationUrl).then(function (res) { |
|
|
|
|
if (res.status === 'success') { |
|
|
|
|
socketMain.add_message({ |
|
|
|
|
format_type: 'add_message_contact', |
|
|
|
|
@ -724,7 +727,7 @@ |
|
|
|
|
var projectOrderChatUrl_ = '/chat/#order%orderId%' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$projectSelectionModal.on('shown.bs.modal', function($evt) { |
|
|
|
|
$projectSelectionModal.on('shown.bs.modal', function ($evt) { |
|
|
|
|
var $that = $(this) |
|
|
|
|
|
|
|
|
|
var $modalOpenButton = $($evt.relatedTarget) |
|
|
|
|
@ -736,7 +739,7 @@ |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$projectSelectionModal.find('.-action-button').first().on('click', function($evt) { |
|
|
|
|
$projectSelectionModal.find('.-action-button').first().on('click', function ($evt) { |
|
|
|
|
var $projectSelect = $projectSelectionModal.find('.-project-select').first() |
|
|
|
|
var $modalOpenButton = $projectSelectionModal.data('modalOpenButton') |
|
|
|
|
var contractorId = $modalOpenButton.data('contractorId') |
|
|
|
|
@ -749,7 +752,7 @@ |
|
|
|
|
if (project.order.contractor && project.order.contractor.id === contractorId) { |
|
|
|
|
window.location.href = projectOrderChatUrl |
|
|
|
|
} else { |
|
|
|
|
var msg = 'Вам предлагается проект <a class="message_connect" href="http://{{ request.get_host }}' + projectUrl +'">Перейти к проекту</a>' |
|
|
|
|
var msg = 'Вам предлагается проект <a class="message_connect" href="http://{{ request.get_host }}' + projectUrl + '">Перейти к проекту</a>' |
|
|
|
|
|
|
|
|
|
socketMain.add_message({ |
|
|
|
|
format_type: 'add_message_contact', |
|
|
|
|
@ -767,7 +770,7 @@ |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$projectSelectionModal.on('hidden.bs.modal', function($evt) { |
|
|
|
|
$projectSelectionModal.on('hidden.bs.modal', function ($evt) { |
|
|
|
|
$(this).find('.-project-select').first().select2('destroy') |
|
|
|
|
}) |
|
|
|
|
{% endif %} |
|
|
|
|
@ -816,22 +819,22 @@ |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#diplom-cro-gallery").on('click', '.delete-resume-file',function(e){ |
|
|
|
|
e.preventDefault(); |
|
|
|
|
$("#diplom-cro-gallery").on('click', '.delete-resume-file', function (e) { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
|
|
var _this = $(this); |
|
|
|
|
var deleteResumeUrl = '/api/contractorresumefiles/' + $(this).attr('data-id') + '/'; |
|
|
|
|
$.ajax({ |
|
|
|
|
url:deleteResumeUrl, |
|
|
|
|
url: deleteResumeUrl, |
|
|
|
|
type: 'DELETE', |
|
|
|
|
beforeSend: function (xhr) { |
|
|
|
|
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) |
|
|
|
|
}, |
|
|
|
|
success: function(json){ |
|
|
|
|
success: function (json) { |
|
|
|
|
_this.parent().parent().parent().remove(); |
|
|
|
|
console.log(json); |
|
|
|
|
}, |
|
|
|
|
error: function(jqXHR, e){ |
|
|
|
|
error: function (jqXHR, e) { |
|
|
|
|
console.log(jqXHR.statusCode); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
@ -895,70 +898,70 @@ |
|
|
|
|
var url = '/work_sell/basic/'; |
|
|
|
|
var csrftoken = $.cookie('csrftoken'); |
|
|
|
|
|
|
|
|
|
$("body").on("click","#remove-resume-file", function(e) { |
|
|
|
|
$("body").on("click", "#remove-resume-file", function (e) { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
var _this = $(this); |
|
|
|
|
$.ajax({ |
|
|
|
|
url:'/api/contractorresume/{{ contractor.contractor_resume.pk }}/', |
|
|
|
|
method:'PUT', |
|
|
|
|
beforeSend: function (xhr) { |
|
|
|
|
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); |
|
|
|
|
}, |
|
|
|
|
data: {resume_file: null}, |
|
|
|
|
cache: false, |
|
|
|
|
dataType: 'json', |
|
|
|
|
success: function(data){ |
|
|
|
|
$("#resume-success").html("Файл для резюме удален!"); |
|
|
|
|
$(_this).css('display','none'); |
|
|
|
|
$('.download-summ').css('display','none'); |
|
|
|
|
|
|
|
|
|
console.log(data); |
|
|
|
|
}, |
|
|
|
|
error: function(jqXHR){ |
|
|
|
|
console.log(jqXHR); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
url: '/api/contractorresume/{{ contractor.contractor_resume.pk }}/', |
|
|
|
|
method: 'PUT', |
|
|
|
|
beforeSend: function (xhr) { |
|
|
|
|
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); |
|
|
|
|
}, |
|
|
|
|
data: {resume_file: null}, |
|
|
|
|
cache: false, |
|
|
|
|
dataType: 'json', |
|
|
|
|
success: function (data) { |
|
|
|
|
$("#resume-success").html("Файл для резюме удален!"); |
|
|
|
|
$(_this).css('display', 'none'); |
|
|
|
|
$('.download-summ').css('display', 'none'); |
|
|
|
|
|
|
|
|
|
console.log(data); |
|
|
|
|
}, |
|
|
|
|
error: function (jqXHR) { |
|
|
|
|
console.log(jqXHR); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$("#upload-resume").on('change',function(e){ |
|
|
|
|
$("#resume-success").html(""); |
|
|
|
|
var formData = new FormData(); |
|
|
|
|
formData.append('resume_file', e.target.files[0]); |
|
|
|
|
$("#upload-resume").on('change', function (e) { |
|
|
|
|
$("#resume-success").html(""); |
|
|
|
|
var formData = new FormData(); |
|
|
|
|
formData.append('resume_file', e.target.files[0]); |
|
|
|
|
|
|
|
|
|
var file = e.target.files[0] |
|
|
|
|
var allowedExts = ['.pdf','.doc','.docx','.xml','.odt','.uot','.dot','.rtf','.txt','.uop','.pptx','.odp','.html','.jpg','.jpeg','.tiff','.png'] |
|
|
|
|
var file = e.target.files[0] |
|
|
|
|
var allowedExts = ['.pdf', '.doc', '.docx', '.xml', '.odt', '.uot', '.dot', '.rtf', '.txt', '.uop', '.pptx', '.odp', '.html', '.jpg', '.jpeg', '.tiff', '.png'] |
|
|
|
|
|
|
|
|
|
if (!_.includes(path.extname(file.name), allowedExts)) { |
|
|
|
|
alert('Файл не подходит. Выберите документ') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if (!_.includes(path.extname(file.name), allowedExts)) { |
|
|
|
|
alert('Файл не подходит. Выберите документ') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
url:'/api/contractorresume/{{ contractor.contractor_resume.pk }}/', |
|
|
|
|
method:'PUT', |
|
|
|
|
beforeSend: function (xhr) { |
|
|
|
|
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); |
|
|
|
|
}, |
|
|
|
|
data: formData, |
|
|
|
|
cache: false, |
|
|
|
|
dataType: 'json', |
|
|
|
|
processData: false, |
|
|
|
|
contentType: false, |
|
|
|
|
success: function(data){ |
|
|
|
|
$("#resume-success").html("Файл для резюме успешно загружен!"); |
|
|
|
|
var downloadSumm = $(".download-summ"); |
|
|
|
|
if(downloadSumm.length>0){ |
|
|
|
|
downloadSumm.css('display','block').attr('href',data.resume_file); |
|
|
|
|
}else { |
|
|
|
|
$('<a href="' + data.resume_file +'" class="download-summ">скачать резюме</a>').insertAfter('#resume-success'); |
|
|
|
|
} |
|
|
|
|
$("#remove-resume-file").show(); |
|
|
|
|
console.log(data); |
|
|
|
|
}, |
|
|
|
|
error: function(jqXHR){ |
|
|
|
|
console.log(jqXHR); |
|
|
|
|
$.ajax({ |
|
|
|
|
url: '/api/contractorresume/{{ contractor.contractor_resume.pk }}/', |
|
|
|
|
method: 'PUT', |
|
|
|
|
beforeSend: function (xhr) { |
|
|
|
|
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); |
|
|
|
|
}, |
|
|
|
|
data: formData, |
|
|
|
|
cache: false, |
|
|
|
|
dataType: 'json', |
|
|
|
|
processData: false, |
|
|
|
|
contentType: false, |
|
|
|
|
success: function (data) { |
|
|
|
|
$("#resume-success").html("Файл для резюме успешно загружен!"); |
|
|
|
|
var downloadSumm = $(".download-summ"); |
|
|
|
|
if (downloadSumm.length > 0) { |
|
|
|
|
downloadSumm.css('display', 'block').attr('href', data.resume_file); |
|
|
|
|
} else { |
|
|
|
|
$('<a href="' + data.resume_file + '" class="download-summ">скачать резюме</a>').insertAfter('#resume-success'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
$("#remove-resume-file").show(); |
|
|
|
|
console.log(data); |
|
|
|
|
}, |
|
|
|
|
error: function (jqXHR) { |
|
|
|
|
console.log(jqXHR); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('#fileupload').fileupload({ |
|
|
|
|
@ -1032,34 +1035,35 @@ |
|
|
|
|
.parent().addClass($.support.fileInput ? undefined : 'disabled'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function add_resume_file(resumeType, imgUrl,imgPk, galleryId){ |
|
|
|
|
$.ajax({ |
|
|
|
|
url: '/users/contractorsresumefiles/create/', |
|
|
|
|
method: 'POST', |
|
|
|
|
beforeSend: function (xhr) { |
|
|
|
|
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) |
|
|
|
|
}, |
|
|
|
|
data: 'type='+ resumeType+'&img_id=' + imgPk + '&resume={{ contractor.contractor_resume.pk }}', |
|
|
|
|
dataType: 'json', |
|
|
|
|
success: function (data) { |
|
|
|
|
if (data.status == 'ok') { |
|
|
|
|
var htmlImg = '<div class="col-lg-4"><div class="insetCol box-sizing disTab"><div class="imgGal" style="background: url(' + imgUrl +') no-repeat center;"><div class="imgFigure"></div></div></div> ' + |
|
|
|
|
'<div class="insetCol2 box-sizing disTab"><div class="buttonsImg" distab="">' + |
|
|
|
|
'<div class="insetBI insetBI2 delete-resume-file" data-id="' + data.pk +'"><i class="fa fa-times"></i></div></div></div></div>'; |
|
|
|
|
|
|
|
|
|
var img = $(htmlImg).appendTo(galleryId); |
|
|
|
|
} else if (data.status == 'no') { |
|
|
|
|
$.each(data.form_errors, function (k, v) { |
|
|
|
|
$('.error-' + k).html(v).show(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
error: function (jqXHR, exception) { |
|
|
|
|
console.log(jqXHR); |
|
|
|
|
console.log(jqXHR.statusCode); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
function add_resume_file(resumeType, imgUrl, imgPk, galleryId) { |
|
|
|
|
$.ajax({ |
|
|
|
|
url: '/users/contractorsresumefiles/create/', |
|
|
|
|
method: 'POST', |
|
|
|
|
beforeSend: function (xhr) { |
|
|
|
|
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')) |
|
|
|
|
}, |
|
|
|
|
data: 'type=' + resumeType + '&img_id=' + imgPk + '&resume={{ contractor.contractor_resume.pk }}', |
|
|
|
|
dataType: 'json', |
|
|
|
|
success: function (data) { |
|
|
|
|
if (data.status == 'ok') { |
|
|
|
|
var htmlImg = '<div class="col-lg-4"><div class="insetCol box-sizing disTab"><div class="imgGal" style="background: url(' + imgUrl + ') no-repeat center;"><div class="imgFigure"></div></div></div> ' + |
|
|
|
|
'<div class="insetCol2 box-sizing disTab"><div class="buttonsImg" distab="">' + |
|
|
|
|
'<div class="insetBI insetBI2 delete-resume-file" data-id="' + data.pk + '"><i class="fa fa-times"></i></div></div></div></div>'; |
|
|
|
|
|
|
|
|
|
var img = $(htmlImg).appendTo(galleryId); |
|
|
|
|
} else if (data.status == 'no') { |
|
|
|
|
$.each(data.form_errors, function (k, v) { |
|
|
|
|
$('.error-' + k).html(v).show(); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
error: function (jqXHR, exception) { |
|
|
|
|
console.log(jqXHR); |
|
|
|
|
console.log(jqXHR.statusCode); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$('#diplom-upload').fileupload({ |
|
|
|
|
url: url, |
|
|
|
|
crossDomain: false, |
|
|
|
|
@ -1075,7 +1079,7 @@ |
|
|
|
|
dataType: 'json', |
|
|
|
|
done: function (e, data) { |
|
|
|
|
$.each(data.result.files, function (index, file) { |
|
|
|
|
add_resume_file('diplom', file.url,file.id, '#diplom-gallery'); |
|
|
|
|
add_resume_file('diplom', file.url, file.id, '#diplom-gallery'); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
progressall: function (e, data) { |
|
|
|
|
@ -1103,7 +1107,7 @@ |
|
|
|
|
dataType: 'json', |
|
|
|
|
done: function (e, data) { |
|
|
|
|
$.each(data.result.files, function (index, file) { |
|
|
|
|
add_resume_file('cro', file.url, file.id,'#cro-gallery'); |
|
|
|
|
add_resume_file('cro', file.url, file.id, '#cro-gallery'); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
progressall: function (e, data) { |
|
|
|
|
|