This file contains 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 fabric.api import task, env, run, local, roles, cd, execute, hide, puts,\ | |
sudo | |
import posixpath | |
import re | |
env.forward_agent = True | |
env.project_name = 'parkhotel' # var | |
env.repository = '[email protected]:benzkji/bnzk_{project_name}.git'.format(**env) | |
env.local_branch = 'master' | |
env.remote_ref = 'origin/master' |
This file contains 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
// backbone form editor (form field) | |
Backbone.Form.editors.SingleFileUpload = Backbone.Form.editors.Base.extend ({ | |
//tagName:"input", | |
_self: false, | |
uploader: false, | |
template:false, | |
template_id: "#singleFileUploadTemplate", | |
additional_fields: [], | |
events: { | |
'change': function() { |
This file contains 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
import os | |
from filer.utils.files import get_valid_filename | |
def no_subfolders(instance, filename): | |
return get_valid_filename(filename) |
This file contains 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 django.contrib import admin | |
from django import forms | |
from django.utils.translation import ugettext_lazy as _ | |
from cms.models import Page | |
from cms.admin.forms import PageForm | |
from cms.admin.pageadmin import PageAdmin | |
class CustomPageForm(PageForm): | |
page_title = forms.CharField(label=_("Title Tag"), widget=forms.TextInput(), |
This file contains 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 |
This file contains 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 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 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 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 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" |
OlderNewer