from django.contrib.sitemaps.views import sitemap
from blog.sitemaps import PostSitemap
from notes.sitemaps import MarginsSitemap
from city_notes.sitemaps import CityMarginsSitemap
from core.sitemaps import CelebrationSitemap, AnimatorSitemap, ServiceSitemap
sitemaps = {
"blog": PostSitemap,
"notes": MarginsSitemap,
"city_notes": CityMarginsSitemap,
"core.celebration": CelebrationSitemap,
"core.animator": AnimatorSitemap,
"core.service": ServiceSitemap,
}
urlpatterns = (
[
path(
"sitemap.xml",
sitemap,
{"sitemaps": sitemaps},
name="django.contrib.sitemaps.views.sitemap",
),
def get_context_data(self, *args, **kwargs):
ctx = {}
ctx = super(CatalogueView, self).get_context_data(*args, **kwargs)
ctx['slides'] = SliderImage.objects.order_by("-created_on")
ctx['summary'] = _("All products")
search_context = self.search_handler.get_search_context_data(
self.context_object_name)
ctx.update(search_context)
return ctx
(function($) {
'use strict';
$.fn.succinct = function(options) {
var settings = $.extend({
size: 240,
omission: '...',
ignore: true
}, options);
return this.each(function() {
var textDefault,
textTruncated,
elements = $(this),
regex = /[!-\/:-@\[-`{-~]$/,
init = function() {
elements.each(function() {
textDefault = $(this).html();
if (textDefault.length > settings.size) {
textTruncated = $.trim(textDefault)
.substring(0, settings.size)
.split(' ')
.slice(0, -1)
.join(' ');
if (settings.ignore) {
textTruncated = textTruncated.replace(regex, '');
}
$(this).html(textTruncated + settings.omission);
}
});
};
init();
});
};
})(jQuery);
$(function() {
"use strict";
$('.truncate299').succinct({
size: 299,
omission: '...',
ignore: true
});
$('.truncate200').succinct({
size: 200,
omission: '...',
ignore: true
});
$('.truncate100').succinct({
size: 100,
omission: '...',
ignore: true
});
$('.truncate80').succinct({
size: 80,
omission: '...',
ignore: true
});
$('.truncate25').succinct({
size: 25,
omission: '!',
ignore: true
});
$('.truncate20').succinct({
size: 20,
omission: '',
ignore: true
});
});