Modal banners. Object detail

remotes/origin/1203
Kotiuk Nazarii 11 years ago
parent 664f2d2fc8
commit 07be97d05a
  1. 3
      exposition/models.py
  2. 20
      templates/client/blank.html
  3. 81
      templates/client/exposition/exposition_detail.html

@ -299,6 +299,9 @@ class Exposition(TranslatableModel, EventMixin, ExpoMixin):
return code
return cur
def theme_ids(self):
return [item['id'] for item in self.theme.all().values('id')]
class Statistic(TranslatableModel):
exposition = models.ForeignKey(Exposition, related_name='statistic')

@ -158,7 +158,7 @@ This template include basic anf main styles and js files,
{% endif %}
{% include 'client/popups/callback.html' %}
{% block popup_banner %}
{% if not request.COOKIES.popover_test1 %}
{% if theme_for_filter %}
@ -231,27 +231,11 @@ This template include basic anf main styles and js files,
}
});
/*
$(function() {
var theme_id = "{{ theme_for_filter.id }}";
var data = {'theme_id': theme_id};
console.log('--------------------------------')
console.log(data);
console.log('--------------------------------')
$.get('/ajax/get_popover/', data, function(data) {
console.log(data);
$('#main-popup-wrap').append(data['html']);
$.fancybox.open([{'href': 'expo-ad-popup'}])
});
});
*/
</script>
{% endif %}
{% endif %}
{% endblock %}
{# if user doesnt have url- show form #}
{% if not request.user.is_anonymous %}

@ -1,5 +1,6 @@
{% extends 'base_catalog.html' %}
{% load i18n %}
{% load template_filters %}
{% block bread_scrumbs %}
<div class="bread-crumbs">
@ -25,4 +26,82 @@
{% block paginator %}
{% endblock %}
{% endblock %}
{% block popup%}
{% if not request.COOKIES.popover_test1 %}
{% with theme_ids=object.theme_ids %}
{% if 32 in theme_ids %}
{% with r=False|random5 %}
{% if r == 1 %}
{% include 'client/popups/auto_modal.html' %}
{% endif %}
{% if r == 2 %}
{% include 'client/popups/auto_banner.html' %}
{% endif %}
{% if r == 3 %}
{% include 'client/popups/cemat_modal.html' %}
{% endif %}
{% if r == 4 %}
{% include 'client/popups/cemat_banner1.html' %}
{% endif %}
{% if r == 5 %}
{% include 'client/popups/cemat_banner2.html' %}
{% endif %}
{% endwith %}
{% else %}
{% if 54 in theme_ids or 26 in theme_ids or 22 in theme_ids or 15 in theme_ids or 44 in theme_ids or 30 in theme_ids %}
{% with r=False|random3 %}
{% if r == 1 %}
{% include 'client/popups/cemat_modal.html' %}
{% else %}
{% if r == 2 %}
{% include 'client/popups/cemat_banner1.html' %}
{% else %}
{% include 'client/popups/cemat_banner2.html' %}
{% endif %}
{% endif %}
{% endwith %}
{% else %}
{% if 2 in theme_ids %}
{% if False|random_social %}
{% include 'client/popups/auto_modal.html' %}
{% else %}
{% include 'client/popups/auto_banner.html' %}
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endwith %}
<script>
$(function() {
if ($('#expo-ad-popup').length > 0){
setTimeout(function(){
$.fancybox.open(
[{href: '#expo-ad-popup'}],
{}
);
var rdr = $('#expo-ad-popup').attr('data-rdr');
sendData = {'rdr': rdr};
console.log(rdr);
$.ajax({
url: '/ajax/get_popover/',
data: sendData,
type: 'GET',
async: true,
success: function(data){
console.log(data);
}
});
}, 5000);
}
});
</script>
{% endif %}
{% endblock %}

Loading…
Cancel
Save