43 lines
1.5 KiB
HTML
43 lines
1.5 KiB
HTML
|
|
[viewBag]
|
||
|
|
==
|
||
|
|
{% put scripts %}
|
||
|
|
<script>
|
||
|
|
getPartners('{{groupId}}');
|
||
|
|
// console.log("qqq");
|
||
|
|
function getPartners(groupId) {
|
||
|
|
//console.log(query.html());
|
||
|
|
$(document).ready(function () {
|
||
|
|
$.ajax({
|
||
|
|
url: `https://orient.tm/api/group/advertisements?group_id=`+groupId,
|
||
|
|
type: 'GET',
|
||
|
|
dataType: 'json',
|
||
|
|
success: function (data, textStatus, xhr) {
|
||
|
|
|
||
|
|
var advs = data.data.data;
|
||
|
|
var i = 0;
|
||
|
|
for (var adv of advs) {
|
||
|
|
|
||
|
|
//console.log(adv);
|
||
|
|
$('#adv_partners').append(`
|
||
|
|
|
||
|
|
<div class="swiper-slide" data-swiper-slide-index="`+i+`" role="group" aria-label="`+(i+1)+` / `+ (advs.length) +`" style="width: 284px; margin-right: 60px;">
|
||
|
|
<div class="partners-item">
|
||
|
|
<img src="`+ adv.media +`" alt="`+ adv.title +`" />
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
`);
|
||
|
|
|
||
|
|
i++;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
},
|
||
|
|
error: function (xhr, textStatus, errorThrown) {
|
||
|
|
console.log('Error in Operation');
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
{% endput %}
|