This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from __future__ import unicode_literals | |
import re | |
from cms.models import CMSPlugin | |
from django.core.management.base import BaseCommand | |
class Command(BaseCommand): | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import unicode_literals | |
from aldryn_search.base import AldrynIndexBase | |
from django.template.loader import render_to_string | |
from haystack import indexes | |
from bodenschatz.models import Product | |
class ProductIndex(AldrynIndexBase, indexes.Indexable): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// check: if we came frome our own site, just use history.back() | |
// as simple as it gets. | |
on_back_click: function(e) { | |
// this check could be further enhanced, but works quite well already. | |
if (document.referrer.indexOf(window.location.host) !== -1) { | |
e.preventDefault(); | |
history.back(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('touchstart', function addtouchclass(e){ // first time user touches the screen | |
document.documentElement.classList.add('is-touch') // add "can-touch" class to document root using classList API | |
document.removeEventListener('touchstart', addtouchclass, false) // de-register touchstart event | |
}, false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src='https://www.google.com/recaptcha/api.js?hl=de'></script> | |
check https://developers.google.com/recaptcha/docs/invisible | |
<div | |
id="header_recaptcha" | |
class="g-recaptcha" | |
data-sitekey="6LctdiQUAAAAAOTUOX92-PkGJXpZgGUp5hrq4l65" | |
data-size="invisible" | |
data-callback="recaptcha_submit" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .... | |
class LinkBase(models.Model): | |
link_text = models.CharField(verbose_name=_('Link Text'), max_length=255, | |
blank=True, default='') | |
link_type = models.CharField(verbose_name=_('Link'), max_length=20, choices=LINK_TYPE_CHOICES, | |
blank=True, default='') | |
page = PageField(null=True, blank=True) | |
file = FilerFileField(null=True, blank=True, related_name='link') | |
mailto = models.EmailField(null=True, blank=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cms.toolbar_pool import toolbar_pool | |
from cms.cms_toolbars import PlaceholderToolbar | |
toolbar_pool.unregister(PlaceholderToolbar) | |
@toolbar_pool.register | |
class PlaceholderToolbarNoWizard(PlaceholderToolbar): | |
def add_wizard_button(self): | |
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Whoosh backend for haystack that implements character folding, as per | |
http://packages.python.org/Whoosh/stemming.html#character-folding . | |
Tested with Haystack 2.4.0 and Whooch 2.7.0 | |
To use, put this file on your path and add it to your haystack settings, eg. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from __future__ import unicode_literals | |
import os | |
from pdfminer.pdfdocument import PDFEncryptionError | |
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter | |
from pdfminer.converter import TextConverter | |
from pdfminer.layout import LAParams | |
from pdfminer.pdfpage import PDFPage | |
from cStringIO import StringIO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from django.core.urlresolvers import reverse | |
from django.utils.translation import ugettext_lazy as _ | |
from cms.toolbar_pool import toolbar_pool | |
from cms.cms_toolbar import ADMIN_MENU_IDENTIFIER, LANGUAGE_MENU_IDENTIFIER | |
from cms.toolbar_base import CMSToolbar | |
from cms.toolbar.items import Break | |
@toolbar_pool.register |