PR-14-mod Модификация шапки аккаунт Исполнителя (доработка)

Исправлены визуальные недоработки
Реализованы М/Ж иконки аватаров по умолчанию
remotes/origin/PR-58
booblegum 9 years ago
parent 02898366b3
commit 5813749813
  1. 40
      assets/css/main.css
  2. BIN
      assets/img/avatars/avatar-female.jpg
  3. BIN
      assets/img/avatars/avatar-male.jpg
  4. 7
      assets/js/chat.js
  5. 6
      chat/templates/inc-contact-card.html
  6. 54
      projects/templates/project_detail.html
  7. 32
      templates/partials/header.html
  8. 14
      templates/partials/trash/header.html
  9. 12
      users/templates/contractor_filter.html
  10. 33
      users/templates/contractor_office.html
  11. 494
      users/templates/contractor_profile.html
  12. 6
      users/templates/partials/inc-customer_profile-info.html
  13. 94
      users/templates/team_profile.html
  14. 6
      users/templates/trash/customer_profile_info_block.html
  15. 6
      users/templates/user_financial_info_edit.html
  16. 6
      users/templates/user_profile_edit.html
  17. 6
      users/templates/user_profile_edit_old.html

@ -355,46 +355,6 @@ a, a:hover, a:focus, a:active {
background-color: rgb(255,0,39); background-color: rgb(255,0,39);
} }
.rating {
width: 46px;
height: 46px;
float: right;
border-radius: 100%;
background-color: #4D4D4D;
margin: 15px 0 0 10px;
position: relative;
}
.ratingInset {
width: 46px;
height: 46px;
border-radius: 100%;
background-color: #FF0027;
position: absolute;
/*left:-1.859px;*/
/*bottom: 3px;*/
clip: rect(0, 22px, 50px, 0);
transform: rotate(-90deg);
}
.iconRating {
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
background: url('../img/button12.png') no-repeat center;
}
.ratingPer {
color: #ff2c2c;
font-size: 18px;
font-family: 'pfdintextcomppro-regular', sans-serif;
float: right;
margin: 28px 0 0 9px;
cursor: pointer;
}
.mainScore { .mainScore {
position: relative; position: relative;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

@ -121,7 +121,10 @@ function updateCounts() {
} }
$(function () { $(function () {
function dialog (message, yesCallback, notCallback) { window.onhashchange = function (e) {
$('a[data-toggle="tab"][href="#'+location.hash.slice(1)+'"]').trigger("click");
};
function dialog(message, yesCallback, notCallback) {
$("#dialog_delete .modal-title").html(message); $("#dialog_delete .modal-title").html(message);
$("#dialog_delete").modal('show'); $("#dialog_delete").modal('show');
$("#btnYes").click(function (e) { $("#btnYes").click(function (e) {
@ -138,6 +141,7 @@ function dialog (message, yesCallback, notCallback) {
var currentHash = URI(location.href).hash(); var currentHash = URI(location.href).hash();
$('a[data-toggle="tab"]').on('show.bs.tab', function (e) { $('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
console.log("TAB!");
var activeTab = $(this).attr('href').substring(1); var activeTab = $(this).attr('href').substring(1);
var liveHash = URI(location.href).hash(); var liveHash = URI(location.href).hash();
@ -155,7 +159,6 @@ function dialog (message, yesCallback, notCallback) {
case 'tab2': case 'tab2':
console.log("tab2"); console.log("tab2");
// /api/message?recipent__id=5
updateCounts(); updateCounts();
setTimeout(function () { setTimeout(function () {
if (liveHash.indexOf("#order") == 0) { if (liveHash.indexOf("#order") == 0) {

@ -28,7 +28,11 @@
<img src="{{ im.url }}" alt="mess-image"> <img src="{{ im.url }}" alt="mess-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="mess-image"> {% if contact.gender == "female" %}
<img src="{% static 'img/avatars/avatar-female.jpg' %}" alt="mess-image">
{% else %}
<img src="{% static 'img/avatars/avatar-male.jpg' %}" alt="mess-image">
{% endif %}
{% endif %} {% endif %}
</div> </div>
<p class="nameMess"> <p class="nameMess">

@ -41,7 +41,11 @@
<img src="{{ im.url }}" alt="execitor-image"> <img src="{{ im.url }}" alt="execitor-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image"> {% if project.customer.gender == "female" %}
<img src="{% static 'img/avatars/avatar-female.jpg' %}" alt="execitor-image">
{% else %}
<img src="{% static 'img/avatars/avatar-male.jpg' %}" alt="execitor-image">
{% endif %}
{% endif %} {% endif %}
</div> </div>
</a> </a>
@ -235,7 +239,11 @@
<img src="{{ avatar.url }}" alt="execitor-image"> <img src="{{ avatar.url }}" alt="execitor-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image"> {% if answer.author.gender == "female" %}
<img src="{% static 'img/avatars/avatar-female.jpg' %}" alt="mess-image">
{% else %}
<img src="{% static 'img/avatars/avatar-male.jpg' %}" alt="mess-image">
{% endif %}
{% endif %} {% endif %}
</div> </div>
</a> </a>
@ -252,7 +260,11 @@
<img src="{{ avatar.url }}" alt="execitor-image"> <img src="{{ avatar.url }}" alt="execitor-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image"> {% if answer.author.owner.gender == "female" %}
<img src="{% static 'img/avatars/avatar-female.jpg' %}" alt="mess-image">
{% else %}
<img src="{% static 'img/avatars/avatar-male.jpg' %}" alt="mess-image">
{% endif %}
{% endif %} {% endif %}
</div> </div>
</a> </a>
@ -613,7 +625,11 @@
<img src="{{ avatar.url }}" alt="execitor-image"> <img src="{{ avatar.url }}" alt="execitor-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image"> {% if answer.author.gender == "female" %}
<img src="{% static 'img/avatars/avatar-female.jpg' %}" alt="mess-image">
{% else %}
<img src="{% static 'img/avatars/avatar-male.jpg' %}" alt="mess-image">
{% endif %}
{% endif %} {% endif %}
</div> </div>
</a> </a>
@ -630,7 +646,11 @@
<img src="{{ avatar.url }}" alt="execitor-image"> <img src="{{ avatar.url }}" alt="execitor-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image"> {% if answer.author.owner.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 %} {% endif %}
</div> </div>
</a> </a>
@ -827,7 +847,11 @@
<img src="{{ avatar.url }}" alt="execitor-image"> <img src="{{ avatar.url }}" alt="execitor-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image"> {% if answer.author.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 %} {% endif %}
</div> </div>
</a> </a>
@ -844,7 +868,11 @@
<img src="{{ avatar.url }}" alt="execitor-image"> <img src="{{ avatar.url }}" alt="execitor-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image"> {% if answer.author.owner.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 %} {% endif %}
</div> </div>
</a> </a>
@ -1044,7 +1072,11 @@
<img src="{{ avatar.url }}" alt="execitor-image"> <img src="{{ avatar.url }}" alt="execitor-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image"> {% if answer.author.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 %} {% endif %}
</div> </div>
</a> </a>
@ -1061,7 +1093,11 @@
<img src="{{ avatar.url }}" alt="execitor-image"> <img src="{{ avatar.url }}" alt="execitor-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="execitor-image"> {% if answer.author.owner.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 %} {% endif %}
</div> </div>
</a> </a>

@ -27,7 +27,7 @@
<div class="user-info"> <div class="user-info">
<a href="{% url 'wallets:score-detail' pk=request.user.pk %}" <a href="{% url 'wallets:score-detail' pk=request.user.pk %}"
class="cash">{{ user_balance|floatformat:2 }}р</a> class="cash">{{ user_balance|floatformat:2 }}р</a>
<a href="{% url 'chat:chat-user' %}#order{{ fist_order_id }}" <a href="{% url 'chat:chat-user' %}#tab2"
class="icon_hand">{{ num_orders_in_work }}</a> class="icon_hand">{{ num_orders_in_work }}</a>
<a href="{% url 'chat:chat-user' %}" class="icon_chat js-all-messages"> <a href="{% url 'chat:chat-user' %}" class="icon_chat js-all-messages">
{{ new_messages_count| max_count:99 }} {{ new_messages_count| max_count:99 }}
@ -37,27 +37,19 @@
{% endif %} {% endif %}
<li> <li>
<div class="imgProfile"> <div class="imgProfile">
{% if request.user.is_contractor %} <a href="{{ profile_url }}">
<a href="{{ profile_url }}"> {% if request.user.avatar %}
{% if request.user.avatar %} {% thumbnail request.user.avatar "75x75" crop="center" as im %}
{% thumbnail request.user.avatar "75x75" crop="center" as im %} <img src="{{ im.url }}" alt="profile-image">
<img src="{{ im.url }}" alt="profile-image"> {% endthumbnail %}
{% endthumbnail %} {% else %}
{% else %} {% if request.user.gender == "female" %}
<img src="{% static 'img/profile.jpg' %}" alt="profile-image"> <img src="{% static 'img/avatars/avatar-female.jpg' %}" alt="profile-image">
{% endif %}
</a>
{% elif request.user.is_customer %}
<a href="{{ profile_url }}">
{% if request.user.avatar %}
{% thumbnail request.user.avatar "75x75" crop="center" as im %}
<img src="{{ im.url }}" alt="profile-image">
{% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="profile-image"> <img src="{% static 'img/avatars/avatar-male.jpg' %}" alt="profile-image">
{% endif %} {% endif %}
</a> {% endif %}
{% endif %} </a>
</div> <!-- //imgProfile --> </div> <!-- //imgProfile -->
</li> </li>
{% if request.user.is_authenticated %} {% if request.user.is_authenticated %}

@ -113,7 +113,7 @@
<a href="{% url 'chat:chat-user' %}">Сообщения<span></span></a> <a href="{% url 'chat:chat-user' %}">Сообщения<span></span></a>
{% if request.user %} {% if request.user %}
<div class="circle js-all-messages">{{ new_messages_count| max_count:99 }}</div> <div class="circle js-all-messages">{{ new_messages_count| max_count:99 }}</div>
{# {% count_new_message request.user %}#} {# {% count_new_message request.user %}#}
{% endif %} {% endif %}
</li> </li>
<li class="icon_mm4"> <li class="icon_mm4">
@ -147,7 +147,11 @@
<img src="{{ im.url }}" alt="profile-image"> <img src="{{ im.url }}" alt="profile-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="profile-image"> {% if request.user.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 %} {% endif %}
</a> </a>
{% elif request.user.is_customer %} {% elif request.user.is_customer %}
@ -157,7 +161,11 @@
<img src="{{ im.url }}" alt="profile-image"> <img src="{{ im.url }}" alt="profile-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="profile-image"> {% if request.user.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 %} {% endif %}
</a> </a>
{% endif %} {% endif %}

@ -195,7 +195,11 @@
<img src="{{ avatar.url }}" alt="profile-image"> <img src="{{ avatar.url }}" alt="profile-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="profile-image"> {% if team.owner.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 %} {% endif %}
</div> </div>
</a> </a>
@ -316,7 +320,11 @@
<img src="{{ avatar.url }}" alt="profile-image"> <img src="{{ avatar.url }}" alt="profile-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% 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 %} {% endif %}
</div> </div>
</a> </a>

@ -82,8 +82,15 @@
src="{{ im.url }}" alt="profile-image"></a> src="{{ im.url }}" alt="profile-image"></a>
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<a href="{% url 'users:team-profile' pk=contractor.team.pk %}"><img <a href="{% url 'users:team-profile' pk=contractor.team.pk %}">
src="{% static 'img/profile.jpg' %}" alt="profile-image"></a> {% 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 %}
</a>
{% endif %} {% endif %}
</div> </div>
</div> </div>
@ -105,7 +112,13 @@
<img src="{{ im.url }}" alt="mess-image"> <img src="{{ im.url }}" alt="mess-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="mess-image"> {% if c.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 %} {% endif %}
</div> </div>
@ -300,8 +313,10 @@
var $moreWorkSellsfBtn = $('.-more-work-sells-btn').first() var $moreWorkSellsfBtn = $('.-more-work-sells-btn').first()
var workSellAbsUrl = '/work_sell/' var workSellAbsUrl = '/work_sell/'
var contractorId ={{ contractor.pk }} var contractorId =
var teamId ={{ contractor.team.pk }} {{ contractor.pk }}
var teamId =
{{ contractor.team.pk }}
var contractorIds = [contractorId] var contractorIds = [contractorId]
var portfUrl = new URI('/api/portfolios/') var portfUrl = new URI('/api/portfolios/')
@ -309,10 +324,10 @@
var pageSize = {% if TESTING %}99999{% else %}9{% endif %} var pageSize = {% if TESTING %}99999{% else %}9{% endif %}
$.get('/api/teams/' + teamId + '/').then(function (res) { $.get('/api/teams/' + teamId + '/').then(function (res) {
Array.prototype.push.apply(contractorIds, _.map(function (contractor) { Array.prototype.push.apply(contractorIds, _.map(function (contractor) {
return contractor.id return contractor.id
}, res.contractors)) }, res.contractors))
}) })
.then(loadMorePortfolios) .then(loadMorePortfolios)
.then(loadMoreWorkSells) .then(loadMoreWorkSells)

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

@ -10,7 +10,11 @@
<img src="{{ im.url }}" alt="profile-image"> <img src="{{ im.url }}" alt="profile-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" width="220" height="220" alt="profile-image"> {% if customer.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 %} {% endif %}
</div> </div>
</div> </div>

@ -17,7 +17,13 @@
<img src="{{ im.url }}" alt="profile-image"> <img src="{{ im.url }}" alt="profile-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="profile-image"> {% if team.owner.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 %} {% endif %}
</div> </div>
</div> </div>
@ -40,7 +46,13 @@
<img src="{{ im.url }}" alt="mess-image"> <img src="{{ im.url }}" alt="mess-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="mess-image"> {% if c.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 %} {% endif %}
</div> </div>
@ -74,10 +86,11 @@
{% if team.owner.contractor_status == 'free' %} {% if team.owner.contractor_status == 'free' %}
<div class="statusUser">Свободен</div> <div class="statusUser">Свободен</div>
{% else %} {% else %}
<div class="statusUser busy">Занят</div> <div class="statusUser busy">Занят</div>
{% endif %} {% endif %}
<a href="{% url 'chat:chat-user' %}?user_id={{ team.owner.pk }}#user{{ team.owner.pk }}" class="new-prop new-prop2 new-prop3">написать сообщение</a> <a href="{% url 'chat:chat-user' %}?user_id={{ team.owner.pk }}#user{{ team.owner.pk }}"
class="new-prop new-prop2 new-prop3">написать сообщение</a>
</div> </div>
<div class="col-lg-4"> <div class="col-lg-4">
@ -118,8 +131,11 @@
<script type="text/x-template" class="-portfolio-item-templ"> <script type="text/x-template" class="-portfolio-item-templ">
<div class="col-lg-4"> <div class="col-lg-4">
<div class="insetCol box-sizing disTab"> <div class="insetCol box-sizing disTab">
<div class="imgGal" style="background:rgba(0, 0, 0, 0) url('<%- portfolio.photos[0].img %>') no-repeat scroll center center / cover"> <div class="imgGal"
<a class="open-modal-image" href="<%- portfolio.photos[0].img %>"><div class="imgFigure"></div></a> style="background:rgba(0, 0, 0, 0) url('<%- portfolio.photos[0].img %>') no-repeat scroll center center / cover">
<a class="open-modal-image" href="<%- portfolio.photos[0].img %>">
<div class="imgFigure"></div>
</a>
</div> </div>
</div> </div>
@ -132,7 +148,8 @@
<div class="col-lg-9 col-lg-offset-3 -more-portfolios-btn"> <div class="col-lg-9 col-lg-offset-3 -more-portfolios-btn">
<div class="linkElse"> <div class="linkElse">
<a href="#" onclick="loadMorePortfolios(); return false" class="showElse">показать еще</a> <a href="#" onclick="loadMorePortfolios(); return false" class="showElse">показать
еще</a>
</div> </div>
</div> </div>
</div> </div>
@ -142,8 +159,11 @@
<script type="text/x-template" class="-work-sell-item-templ"> <script type="text/x-template" class="-work-sell-item-templ">
<div class="col-lg-4"> <div class="col-lg-4">
<div class="insetCol box-sizing disTab"> <div class="insetCol box-sizing disTab">
<div class="imgGal" style="background:rgba(0, 0, 0, 0) url('<%- workSell.photos[0].img %>') no-repeat scroll center center / cover ;"> <div class="imgGal"
<a class="open-modal-image" href="<%- workSell.photos[0].img %>"><div class="imgFigure"></div></a> style="background:rgba(0, 0, 0, 0) url('<%- workSell.photos[0].img %>') no-repeat scroll center center / cover ;">
<a class="open-modal-image" href="<%- workSell.photos[0].img %>">
<div class="imgFigure"></div>
</a>
</div> </div>
<div class="cenaImg box-sizing"> <div class="cenaImg box-sizing">
@ -161,7 +181,8 @@
<div class="col-lg-9 col-lg-offset-3 -more-work-sells-btn"> <div class="col-lg-9 col-lg-offset-3 -more-work-sells-btn">
<div class="linkElse"> <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>
</div> </div>
@ -196,7 +217,6 @@
</div> </div>
<div> <div>
{% include 'partials/footer.html' %} {% include 'partials/footer.html' %}
</div> </div>
@ -208,7 +228,7 @@
{% block js_block %} {% block js_block %}
<script type="text/javascript"> <script type="text/javascript">
(function() { (function () {
// Pagination --------------------------------------------------- // Pagination ---------------------------------------------------
@ -222,20 +242,21 @@
var $moreWorkSellsfBtn = $('.-more-work-sells-btn').first() var $moreWorkSellsfBtn = $('.-more-work-sells-btn').first()
var workSellAbsUrl = '/work_sell/' var workSellAbsUrl = '/work_sell/'
var teamId = {{ team.pk }} var teamId =
{{ team.pk }}
var contractorIds = [{{ team.owner.pk }}] var contractorIds = [{{ team.owner.pk }}]
var portfUrl = new URI('/api/portfolios/') var portfUrl = new URI('/api/portfolios/')
var workSellUrl = new URI('/api/work-sells/') var workSellUrl = new URI('/api/work-sells/')
var pageSize = {% if TESTING %}99999{% else %}9{% endif %} var pageSize = {% if TESTING %}99999{% else %}9{% endif %}
$.get('/api/teams/' + teamId + '/').then(function(res) { $.get('/api/teams/' + teamId + '/').then(function (res) {
Array.prototype.push.apply(contractorIds, _.map(function(contractor) { Array.prototype.push.apply(contractorIds, _.map(function (contractor) {
return contractor.id return contractor.id
}, res.contractors)) }, res.contractors))
}) })
.then(loadMorePortfolios) .then(loadMorePortfolios)
.then(loadMoreWorkSells) .then(loadMoreWorkSells)
function loadMorePortfolios() { function loadMorePortfolios() {
var query = portfUrl.query(true) var query = portfUrl.query(true)
@ -245,22 +266,22 @@
portfUrl.setQuery('page', query.page ? Number(query.page) + 1 : 1) portfUrl.setQuery('page', query.page ? Number(query.page) + 1 : 1)
$.get(portfUrl.href()) $.get(portfUrl.href())
.then(function(res) { .then(function (res) {
_.each(function(portfolio) { _.each(function (portfolio) {
$portfoliosContainer.append(portfolioItemTempl({ $portfoliosContainer.append(portfolioItemTempl({
portfolio: portfolio, portfolio: portfolio,
portfAbsUrl: portfAbsUrl + portfolio.id + '/', portfAbsUrl: portfAbsUrl + portfolio.id + '/',
trunc: _.truncate, trunc: _.truncate,
})) }))
}, res.results) }, res.results)
if (!res.next) if (!res.next)
$morePortfBtn.css('display', 'none') $morePortfBtn.css('display', 'none')
}) })
.then(function() { .then(function () {
$('.open-modal-image').magnificPopup({type: 'image'}) $('.open-modal-image').magnificPopup({type: 'image'})
}) })
} }
function loadMoreWorkSells() { function loadMoreWorkSells() {
@ -270,8 +291,8 @@
workSellUrl.setQuery('page_size', pageSize) workSellUrl.setQuery('page_size', pageSize)
workSellUrl.setQuery('page', query.page ? Number(query.page) + 1 : 1) workSellUrl.setQuery('page', query.page ? Number(query.page) + 1 : 1)
$.get(workSellUrl.href()).then(function(res) { $.get(workSellUrl.href()).then(function (res) {
_.each(function(ws) { _.each(function (ws) {
$workSellsContainer.append(workSellItemTempl({ $workSellsContainer.append(workSellItemTempl({
workSell: ws, workSell: ws,
workSellAbsUrl: workSellAbsUrl + ws.id + '/', workSellAbsUrl: workSellAbsUrl + ws.id + '/',
@ -288,13 +309,12 @@
window.loadMoreWorkSells = loadMoreWorkSells window.loadMoreWorkSells = loadMoreWorkSells
// Persistent Bootstrap tabs -------------------------------------- // Persistent Bootstrap tabs --------------------------------------
$('a[data-toggle="tab"][href="' + window.location.hash + '"]').tab('show') $('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') window.location.hash = $(this).attr('href')
}) })
}()) }())

@ -13,7 +13,11 @@
<img src="{{ im.url }}" alt="profile-image"> <img src="{{ im.url }}" alt="profile-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="profile-image"> {% if customer.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 %} {% endif %}
</div> </div>
</div> </div>

@ -42,7 +42,11 @@
<img src="{{ avatar.url }}" alt="profile-image" class="-avatar-image"> <img src="{{ avatar.url }}" alt="profile-image" class="-avatar-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="profile-image" class="-avatar-image"> {% if request.user.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 %} {% endif %}
</div> </div>
</div> </div>

@ -37,7 +37,11 @@
<img src="{{ avatar.url }}" alt="profile-image" class="-avatar-image"> <img src="{{ avatar.url }}" alt="profile-image" class="-avatar-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" width="208" height="208" alt="profile-image" class="-avatar-image"> {% if request.user.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 %}
{# {% with "/static/img/profile.jpg" as path %}#} {# {% with "/static/img/profile.jpg" as path %}#}
{# {% thumbnail path "100x100" crop="center" as im %}#} {# {% thumbnail path "100x100" crop="center" as im %}#}
{# <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" alt="profile-image" class="-avatar-image">#} {# <img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" alt="profile-image" class="-avatar-image">#}

@ -42,7 +42,11 @@
<img src="{{ avatar.url }}" alt="profile-image" class="-avatar-image"> <img src="{{ avatar.url }}" alt="profile-image" class="-avatar-image">
{% endthumbnail %} {% endthumbnail %}
{% else %} {% else %}
<img src="{% static 'img/profile.jpg' %}" alt="profile-image" class="-avatar-image"> {% if request.user.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 %} {% endif %}
</div> </div>
</div> </div>

Loading…
Cancel
Save