Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
600 additions
and
260 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import warnings | ||
|
||
from .mixins import FloppyformsLayoutMixin, ItemLimitInlineMixin, PlaceholderFormMixin # noqa | ||
|
||
|
||
warnings.warn(( | ||
'Importing mixins directly from barbeque.forms is deprecated and will be removed ' | ||
'in barbeque 1.3. Use barbeque.forms.mixins instead.' | ||
), DeprecationWarning) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from floppyforms.forms import LayoutRenderer | ||
|
||
from .mixins import FloppyformsLayoutMixin | ||
|
||
|
||
class FieldsetRenderer(FloppyformsLayoutMixin, LayoutRenderer): | ||
non_field_errors = None | ||
|
||
def __init__(self, form, fields=None, exclude=None, primary=False, template=None): | ||
assert fields or exclude is not None, 'Please provide fields or exclude argument.' | ||
|
||
self.form = form | ||
self.fields = fields or () | ||
self.exclude = exclude or () | ||
self.primary_fieldset = primary | ||
|
||
if template: | ||
self.div_template_name = template | ||
|
||
def __str__(self): | ||
return self.as_div() | ||
|
||
def hidden_fields(self): | ||
return self.form.hidden_fields() if self.primary_fieldset else () | ||
|
||
def non_field_errors(self): | ||
return self.form.non_field_errors() if self.primary_fieldset else () | ||
|
||
def visible_fields(self): | ||
form_visible_fields = self.form.visible_fields() | ||
|
||
if self.fields: | ||
fields = self.fields | ||
else: | ||
fields = [field.name for field in form_visible_fields] | ||
|
||
filtered_fields = [field for field in fields if field not in self.exclude] | ||
|
||
return [field for field in form_visible_fields if field.name in filtered_fields] |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# SOME DESCRIPTIVE TITLE. | ||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER | ||
# This file is distributed under the same license as the PACKAGE package. | ||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: PACKAGE VERSION\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2016-11-28 11:54+0100\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <LL@li.org>\n" | ||
"Language: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Plural-Forms: nplurals=2; plural=(n != 1);\n" | ||
|
||
#: barbeque/anylink.py:15 | ||
msgid "CMS Page" | ||
msgstr "CMS Seite" | ||
|
||
#: barbeque/exporter.py:119 | ||
msgid "Export as CSV" | ||
msgstr "Als CSV exportieren" | ||
|
||
#: barbeque/exporter.py:125 | ||
msgid "Export as XLSX" | ||
msgstr "Als XLSX exportieren" | ||
|
||
#: barbeque/filer.py:27 | ||
#, python-brace-format | ||
msgid "Invalid file extension, allowed extensions: {0}" | ||
msgstr "Ungültige Dateiendung, erlaubte Dateitypen: {0}" | ||
|
||
#: barbeque/filer.py:33 | ||
msgid "Alternative text is missing for this file." | ||
msgstr "Bildbeschreibung fehlt für diese Datei." | ||
|
||
#: barbeque/forms/mixins.py:32 | ||
#, python-brace-format | ||
msgid "Please provide at least {num} {verbose_name}." | ||
msgstr "Mindestens {num} {verbose_name} benötigt." | ||
|
||
#: barbeque/forms/mixins.py:33 | ||
#, python-brace-format | ||
msgid "Please provide at most {num} {verbose_name}." | ||
msgstr "Maximal {num} {verbose_name} erlaubt." | ||
|
||
#: barbeque/validators.py:9 | ||
#, python-format | ||
msgid "You must be at least %(limit_value)d years old." | ||
msgstr "Sie müssen mindestens %(limit_value)d Jahre alt sein." | ||
|
||
#: barbeque/validators.py:18 | ||
msgid "This email address is already in use." | ||
msgstr "Diese E-Mail-Adresse ist bereits in Verwendung." | ||
|
||
#: barbeque/views/mixins.py:30 | ||
msgid "You must be logged in to access the requested page." | ||
msgstr "Sie müssen angemeldet sein, um auf die gewünschte Seite zu gelangen" |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
from django.conf.urls import include, url | ||
from django.contrib import admin | ||
from django.views.generic import TemplateView | ||
|
||
|
||
urlpatterns = [ | ||
url(r'^admin/', include(admin.site.urls)), | ||
url(r'^non-cms/', TemplateView.as_view(template_name='empty_template.html')), | ||
url(r'', include('cms.urls')), | ||
] |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from cms.extensions import TitleExtensionAdmin | ||
from django.contrib import admin | ||
|
||
from .models import ExtensionModel | ||
|
||
|
||
admin.site.register(ExtensionModel, TitleExtensionAdmin) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from cms.toolbar_pool import toolbar_pool | ||
|
||
from barbeque.cms.toolbar import TitleExtensionToolbar | ||
|
||
from .models import ExtensionModel | ||
|
||
|
||
class ExtensionToolbar(TitleExtensionToolbar): | ||
model = ExtensionModel | ||
insert_after = 'Advanced settings' | ||
|
||
toolbar_pool.register(ExtensionToolbar) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from cms.extensions import TitleExtension | ||
from cms.extensions.extension_pool import extension_pool | ||
from django.db import models | ||
|
||
|
||
class ExtensionModel(TitleExtension): | ||
name = models.CharField(max_length=255) | ||
|
||
class Meta: | ||
verbose_name = 'Extension' | ||
|
||
def __unicode__(self): | ||
return self.name | ||
|
||
extension_pool.register(ExtensionModel) |
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
Oops, something went wrong.