|
|
|
@ -164,14 +164,13 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{% endif %} |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
|
|
<div class="galleryWork2 disTab"> |
|
|
|
<div class="galleryWork2 disTab -portfolios-container"> |
|
|
|
{% if False %} |
|
|
|
{% if False %} |
|
|
|
{% for p in contractor.portfolios.all %} |
|
|
|
{% for p in contractor.portfolios.all %} |
|
|
|
<div class="col-lg-4"> |
|
|
|
<div class="col-lg-4"> |
|
|
|
<div class="insetCol box-sizing disTab"> |
|
|
|
<div class="insetCol box-sizing disTab"> |
|
|
|
{% thumbnail p.get_cover "224x224" crop="center" as im %} |
|
|
|
{% thumbnail p.get_cover "224x224" crop="center" as im %} |
|
|
|
<div class="imgGal" |
|
|
|
<div class="imgGal" style="background:rgba(0, 0, 0, 0) url('{{ im.url }}') no-repeat scroll center center / cover ;"> |
|
|
|
style="background:rgba(0, 0, 0, 0) url('{{ im.url }}') no-repeat scroll center center / cover ;"> |
|
|
|
|
|
|
|
<a class="open-modal-image" href="{{ p.get_cover.url }}"><div class="imgFigure"></div></a> |
|
|
|
<a class="open-modal-image" href="{{ p.get_cover.url }}"><div class="imgFigure"></div></a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{% endthumbnail %} |
|
|
|
{% endthumbnail %} |
|
|
|
@ -207,23 +206,42 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/template" class="-portfolio-item-templ"> |
|
|
|
<script type="text/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" style="background:rgba(0, 0, 0, 0) url('<%= portfolio.photos[0].img %>') no-repeat scroll center center / cover"> |
|
|
|
{# <div class="imgFigure"></div>#} |
|
|
|
<a class="open-modal-image" href="<%= portfolio.photos[0].img %>"><div class="imgFigure"></div></a> |
|
|
|
{# </div>#} |
|
|
|
</div> |
|
|
|
{# </div>#} |
|
|
|
</div> |
|
|
|
{# #} |
|
|
|
|
|
|
|
{# <div class="insetCol2 box-sizing disTab text-center">#} |
|
|
|
<div class="insetCol2 box-sizing disTab"> |
|
|
|
{# <a href="<%= portfAbsUrl %>"><%= trunc({length: 50}, portfolio.name) %></a>#} |
|
|
|
<a href="<%= portfAbsUrl %>"><%= trunc({length: 50}, portfolio.name) %></a> |
|
|
|
{# </div>#} |
|
|
|
|
|
|
|
{# </div>#} |
|
|
|
{% if False %} |
|
|
|
|
|
|
|
{% if request.user.pk == contractor.pk %} |
|
|
|
|
|
|
|
<div class="buttonsImg" disTab> |
|
|
|
|
|
|
|
<a href="{% url 'projects:contractor-portfolio-edit' p.pk %}"> |
|
|
|
|
|
|
|
<div class="insetBI insetBI1"> |
|
|
|
|
|
|
|
<i class="fa fa-pencil"></i> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
<div class="insetBI insetBI2"> |
|
|
|
|
|
|
|
<form action="{% url 'projects:contractor-portfolio-trash' pk=p.pk %}" 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> |
|
|
|
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="col-lg-9 col-lg-offset-3"> |
|
|
|
<div class="col-lg-9 col-lg-offset-3"> |
|
|
|
<div class="linkElse"> |
|
|
|
<div class="linkElse"> |
|
|
|
<a href="javascript:void(0)" class="showElse">показать еще</a> |
|
|
|
<a href="#" onclick="loadMorePortfolios(); return false" class="showElse">показать еще</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -249,28 +267,71 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{% endif %} |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
|
|
<div class="galleryWork2 disTab"> |
|
|
|
<div class="galleryWork2 disTab -work-sells-container"> |
|
|
|
{% for ws in contractor.work_sell.all %} |
|
|
|
{% if False %} |
|
|
|
|
|
|
|
{% for ws in contractor.work_sell.all %} |
|
|
|
|
|
|
|
<div class="col-lg-4"> |
|
|
|
|
|
|
|
<div class="insetCol box-sizing disTab"> |
|
|
|
|
|
|
|
<a href="{% url 'work_sell:detail' ws.pk %}"> |
|
|
|
|
|
|
|
{% thumbnail ws.get_cover "224x224" crop="center" as im %} |
|
|
|
|
|
|
|
<div class="imgGal" |
|
|
|
|
|
|
|
style="background:rgba(0, 0, 0, 0) url('{{ im.url }}') no-repeat scroll center center / cover ;"> |
|
|
|
|
|
|
|
<a class="open-modal-image" href="{{ ws.get_cover.url }}"><div class="imgFigure"></div></a> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
{% endthumbnail %} |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="cenaImg box-sizing"> |
|
|
|
|
|
|
|
<div class="cenaImgInset"> |
|
|
|
|
|
|
|
{{ ws.budget }} <i class="fa fa-rub"></i> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="insetCol2 box-sizing disTab"> |
|
|
|
|
|
|
|
<a href="{% url 'work_sell:detail' ws.pk %}">{{ ws }}</a> |
|
|
|
|
|
|
|
{% if request.user.pk == contractor.pk %} |
|
|
|
|
|
|
|
<div class="buttonsImg" disTab> |
|
|
|
|
|
|
|
<div class="insetBI insetBI1"> |
|
|
|
|
|
|
|
<a href="{% url 'work_sell:edit' ws.pk %}"> |
|
|
|
|
|
|
|
<i class="fa fa-pencil"></i> |
|
|
|
|
|
|
|
</a> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="insetBI insetBI2"> |
|
|
|
|
|
|
|
<form action="{% url 'work_sell:contractor-worksell-trash' pk=ws.pk %}" 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> |
|
|
|
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
{% endfor %} |
|
|
|
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/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"> |
|
|
|
<a href="{% url 'work_sell:detail' ws.pk %}"> |
|
|
|
{# <a href="{% url 'work_sell:detail' ws.pk %}">#} |
|
|
|
{% thumbnail ws.get_cover "224x224" crop="center" as im %} |
|
|
|
<a href="#"> |
|
|
|
<div class="imgGal" |
|
|
|
<div class="imgGal" style="background:rgba(0, 0, 0, 0) url('<%= workSell.photos[0].img %>') no-repeat scroll center center / cover"> |
|
|
|
style="background:rgba(0, 0, 0, 0) url('{{ im.url }}') no-repeat scroll center center / cover ;"> |
|
|
|
<a class="open-modal-image" href="<%= workSell.photos[0].img %>"><div class="imgFigure"></div></a> |
|
|
|
<a class="open-modal-image" href="{{ ws.get_cover.url }}"><div class="imgFigure"></div></a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
{% endthumbnail %} |
|
|
|
|
|
|
|
</a> |
|
|
|
</a> |
|
|
|
|
|
|
|
|
|
|
|
<div class="cenaImg box-sizing"> |
|
|
|
<div class="cenaImg box-sizing"> |
|
|
|
<div class="cenaImgInset"> |
|
|
|
<div class="cenaImgInset"> |
|
|
|
{{ ws.budget }} <i class="fa fa-rub"></i> |
|
|
|
<%= workSell.budget %> <i class="fa fa-rub"></i> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="insetCol2 box-sizing disTab"> |
|
|
|
<div class="insetCol2 box-sizing disTab"> |
|
|
|
<a href="{% url 'work_sell:detail' ws.pk %}">{{ ws }}</a> |
|
|
|
<a href="<%= workSellAbsUrl %>"><%= trunc({length: 50}, workSell.name) %></a> |
|
|
|
{% if request.user.pk == contractor.pk %} |
|
|
|
|
|
|
|
|
|
|
|
{% if False and request.user.pk == contractor.pk %} |
|
|
|
<div class="buttonsImg" disTab> |
|
|
|
<div class="buttonsImg" disTab> |
|
|
|
<div class="insetBI insetBI1"> |
|
|
|
<div class="insetBI insetBI1"> |
|
|
|
<a href="{% url 'work_sell:edit' ws.pk %}"> |
|
|
|
<a href="{% url 'work_sell:edit' ws.pk %}"> |
|
|
|
@ -288,11 +349,12 @@ |
|
|
|
{% endif %} |
|
|
|
{% endif %} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{% endfor %} |
|
|
|
</script> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="col-lg-9 col-lg-offset-3"> |
|
|
|
<div class="col-lg-9 col-lg-offset-3"> |
|
|
|
<div class="linkElse"> |
|
|
|
<div class="linkElse"> |
|
|
|
<a href="javascript:void(0)" class="showElse">показать еще</a> |
|
|
|
<a href="#" onclick="loadMoreWorkSells(); return false" class="showElse">показать еще</a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -498,22 +560,97 @@ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% block js_block %} |
|
|
|
{% block js_block %} |
|
|
|
<script type="text/javascript" src='{% static "js/jquery.magnific-popup.min.js" %}'></script> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript"> |
|
|
|
<script type="text/javascript"> |
|
|
|
var userId = '{{ contractor.pk }}'; |
|
|
|
;(function() { |
|
|
|
$(function () { |
|
|
|
// Pagination --------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var $portfoliosContainer = $('.-portfolios-container').first() |
|
|
|
|
|
|
|
var portfolioItemTempl = _.template($portfoliosContainer.find('.-portfolio-item-templ').first().html()) |
|
|
|
|
|
|
|
var $morePortfBtn = $('.-more-portfolios-btn').first() |
|
|
|
|
|
|
|
var portfAbsUrl = '/projects/portfolio/' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var $workSellsContainer = $('.-work-sells-container').first() |
|
|
|
|
|
|
|
var workSellItemTempl = _.template($workSellsContainer.find('.-work-sell-item-templ').first().html()) |
|
|
|
|
|
|
|
var $moreWorkSellsfBtn = $('.-more-work-sells-btn').first() |
|
|
|
|
|
|
|
var workSellAbsUrl = '/work_sell/' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var teamId = {{ contractor.team.pk }} |
|
|
|
|
|
|
|
var contractorIds |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var portfUrl = new URI('/api/portfolios/') |
|
|
|
|
|
|
|
var workSellUrl = new URI('/api/work-sells/') |
|
|
|
|
|
|
|
var pageSize = 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.get('/api/teams/' + teamId + '/').then(function(res) { |
|
|
|
|
|
|
|
contractorIds = _.map(function(contractor) { |
|
|
|
|
|
|
|
return contractor.id |
|
|
|
|
|
|
|
}, res.contractors) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(loadMorePortfolios) |
|
|
|
|
|
|
|
.then(loadMoreWorkSells) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function loadMorePortfolios() { |
|
|
|
|
|
|
|
var query = portfUrl.query(true) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
portfUrl.setQuery('user__id__in', _.join(',', contractorIds)) |
|
|
|
|
|
|
|
portfUrl.setQuery('page_size', pageSize) |
|
|
|
|
|
|
|
portfUrl.setQuery('page', query.page ? Number(query.page) + 1 : 2) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.get(portfUrl.href()) |
|
|
|
|
|
|
|
.then(function(res) { |
|
|
|
|
|
|
|
_.each(function(portfolio) { |
|
|
|
|
|
|
|
$portfoliosContainer.append(portfolioItemTempl({ |
|
|
|
|
|
|
|
portfolio: portfolio, |
|
|
|
|
|
|
|
portfAbsUrl: portfAbsUrl + portfolio.id + '/', |
|
|
|
|
|
|
|
trunc: _.truncate, |
|
|
|
|
|
|
|
})) |
|
|
|
|
|
|
|
}, res.results) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!res.next) |
|
|
|
|
|
|
|
$morePortfBtn.css('display', 'none') |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.then(function() { |
|
|
|
|
|
|
|
$('.open-modal-image').magnificPopup({type: 'image'}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function loadMoreWorkSells() { |
|
|
|
|
|
|
|
var query = workSellUrl.query(true) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
workSellUrl.setQuery('contractor__in', _.join(',', contractorIds)) |
|
|
|
|
|
|
|
workSellUrl.setQuery('page_size', pageSize) |
|
|
|
|
|
|
|
workSellUrl.setQuery('page', query.page ? Number(query.page) + 1 : 2) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.get(workSellUrl.href()).then(function(res) { |
|
|
|
|
|
|
|
_.each(function(ws) { |
|
|
|
|
|
|
|
$workSellsContainer.append(workSellItemTempl({ |
|
|
|
|
|
|
|
workSell: ws, |
|
|
|
|
|
|
|
workSellAbsUrl: workSellAbsUrl + ws.id + '/', |
|
|
|
|
|
|
|
trunc: _.truncate, |
|
|
|
|
|
|
|
})) |
|
|
|
|
|
|
|
}, res.results) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!res.next) |
|
|
|
|
|
|
|
$moreWorkSellsfBtn.css('display', 'none') |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.loadMorePortfolios = loadMorePortfolios |
|
|
|
|
|
|
|
window.loadMoreWorkSells = loadMoreWorkSells |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var userId = '{{ contractor.pk }}'; |
|
|
|
|
|
|
|
|
|
|
|
var hash = window.location.hash; |
|
|
|
var hash = window.location.hash; |
|
|
|
|
|
|
|
|
|
|
|
if (hash == '#open-contact'){ |
|
|
|
if (hash == '#open-contact'){ |
|
|
|
$("#contact-contactor-modal").modal(); |
|
|
|
$("#contact-contactor-modal").modal(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$('.open-modal-image').magnificPopup({ |
|
|
|
|
|
|
|
type: 'image' |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#resume-edit-form').on('submit', function (e) { |
|
|
|
$('#resume-edit-form').on('submit', function (e) { |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
var resumeEditUrl = "{% url 'users:contractor-resume-update' contractor.contractor_resume.pk %}"; |
|
|
|
var resumeEditUrl = "{% url 'users:contractor-resume-update' contractor.contractor_resume.pk %}"; |
|
|
|
@ -803,90 +940,11 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}).prop('disabled', !$.support.fileInput) |
|
|
|
}).prop('disabled', !$.support.fileInput) |
|
|
|
.parent().addClass($.support.fileInput ? undefined : 'disabled'); |
|
|
|
.parent().addClass($.support.fileInput ? undefined : 'disabled'); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function csrfSafeMethod(method) { |
|
|
|
|
|
|
|
// these HTTP methods do not require CSRF protection |
|
|
|
|
|
|
|
return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- Pagination ------------------------------------------------------------> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
(function() { |
|
|
|
|
|
|
|
var $portfoliosContainer = $('.-portfolios-container').first() |
|
|
|
|
|
|
|
var portfolioItemTempl = _.template($portfoliosContainer.find('.-portfolio-item-templ').first().html()) |
|
|
|
|
|
|
|
var $morePortfBtn = $('.-more-portfolios-btn').first() |
|
|
|
|
|
|
|
var portfAbsUrl = '/projects/portfolio/' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var $workSellsContainer = $('.-work-sells-container').first() |
|
|
|
|
|
|
|
var workSellItemTempl = _.template($workSellsContainer.find('.-work-sell-item-templ').first().html()) |
|
|
|
|
|
|
|
var $moreWorkSellsfBtn = $('.-more-work-sells-btn').first() |
|
|
|
|
|
|
|
var workSellAbsUrl = '/work_sell/' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var teamId = {{ contractor.team.pk }} |
|
|
|
|
|
|
|
var contractorIds |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var portfUrl = new URI('/api/portfolios/') |
|
|
|
function csrfSafeMethod(method) { |
|
|
|
var workSellUrl = new URI('/api/work-sells/') |
|
|
|
// these HTTP methods do not require CSRF protection |
|
|
|
var pageSize = 3 |
|
|
|
return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method)); |
|
|
|
|
|
|
|
|
|
|
|
$.get('/api/teams/' + teamId + '/').then(function(res) { |
|
|
|
|
|
|
|
contractorIds = _.map(function(contractor) { |
|
|
|
|
|
|
|
return contractor.id |
|
|
|
|
|
|
|
}, res.contractors) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.then(loadMorePortfolios) |
|
|
|
|
|
|
|
.then(loadMoreWorkSells) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function loadMorePortfolios() { |
|
|
|
|
|
|
|
var query = portfUrl.query(true) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
portfUrl.setQuery('user__id__in', _.join(',', contractorIds)) |
|
|
|
|
|
|
|
portfUrl.setQuery('page_size', pageSize) |
|
|
|
|
|
|
|
portfUrl.setQuery('page', query.page ? Number(query.page) + 1 : 2) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.get(portfUrl.href()).then(function(res) { |
|
|
|
|
|
|
|
_.each(function(portfolio) { |
|
|
|
|
|
|
|
$portfoliosContainer.append(portfolioItemTempl({ |
|
|
|
|
|
|
|
portfolio: portfolio, |
|
|
|
|
|
|
|
portfAbsUrl: portfAbsUrl + portfolio.id + '/', |
|
|
|
|
|
|
|
trunc: _.truncate, |
|
|
|
|
|
|
|
})) |
|
|
|
|
|
|
|
}, res.results) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!res.next) |
|
|
|
|
|
|
|
$morePortfBtn.css('display', 'none') |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function loadMoreWorkSells() { |
|
|
|
|
|
|
|
var query = workSellUrl.query(true) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
workSellUrl.setQuery('contractor__in', _.join(',', contractorIds)) |
|
|
|
|
|
|
|
workSellUrl.setQuery('page_size', pageSize) |
|
|
|
|
|
|
|
workSellUrl.setQuery('page', query.page ? Number(query.page) + 1 : 2) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.get(workSellUrl.href()).then(function(res) { |
|
|
|
|
|
|
|
_.each(function(ws) { |
|
|
|
|
|
|
|
$workSellsContainer.append(workSellItemTempl({ |
|
|
|
|
|
|
|
workSell: ws, |
|
|
|
|
|
|
|
workSellAbsUrl: workSellAbsUrl + ws.id + '/', |
|
|
|
|
|
|
|
trunc: _.truncate, |
|
|
|
|
|
|
|
})) |
|
|
|
|
|
|
|
}, res.results) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!res.next) |
|
|
|
|
|
|
|
$moreWorkSellsfBtn.css('display', 'none') |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.loadMorePortfolios = loadMorePortfolios |
|
|
|
|
|
|
|
window.loadMoreWorkSells = loadMoreWorkSells |
|
|
|
|
|
|
|
}()) |
|
|
|
}()) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
{% endblock %} |
|
|
|
{% endblock %} |
|
|
|
|