Beispiel #1
0
    def ready(self):
        from feincms.module.blog.models import Entry
        from feincms.module.page.models import Page
        from feincms.content.raw.models import RawContent
        from feincms.content.image.models import ImageContent
        from feincms.content.medialibrary.models import MediaFileContent
        from feincms.content.application.models import ApplicationContent

        from .models import get_admin_fields

        Page.create_content_type(RawContent)
        Page.create_content_type(
            MediaFileContent,
            TYPE_CHOICES=(('default', 'Default position'), ),
        )
        Page.create_content_type(
            ImageContent,
            POSITION_CHOICES=(('default', 'Default position'), ),
        )

        Page.create_content_type(ApplicationContent,
                                 APPLICATIONS=(('blog_urls', 'Blog', {
                                     'admin_fields': get_admin_fields,
                                     'urls': 'example.blog_urls',
                                 }), ))

        Entry.register_regions(('main', 'Main region'), )
        Entry.create_content_type(RawContent)
        Entry.create_content_type(ImageContent,
                                  POSITION_CHOICES=(('default',
                                                     'Default position'), ))
Beispiel #2
0
Page.create_content_type(ApplicationContent, APPLICATIONS=(
    ('testapp.blog_urls', 'Blog', {'admin_fields': get_admin_fields}),
    ('whatever', 'Test Urls', {'urls': 'testapp.applicationcontent_urls'}),
    ))

Entry.register_extensions(
    'feincms.module.extensions.seo',
    'feincms.module.extensions.translations',
    'feincms.module.extensions.seo',
    'feincms.module.extensions.ct_tracker',
    )
Entry.register_regions(
    ('main', 'Main region'),
    )
Entry.create_content_type(RawContent)
Entry.create_content_type(ImageContent, POSITION_CHOICES=(
    ('default', 'Default position'),
    ))


class BlogEntriesNavigationExtension(NavigationExtension):
    """
    Extended navigation for blog entries.

    It would be added to 'Blog' page properties in admin.
    """
    name = _('all blog entries')

    def children(self, page, **kwargs):
        for entry in Entry.objects.all():
Beispiel #3
0
            label=capfirst(_('exclusive subpages')),
            required=False,
            initial=form.instance.parameters.get('exclusive_subpages', False),
            help_text=_('Exclude everything other than the application\'s content when rendering subpages.'),
            ),
    }

Page.create_content_type(ApplicationContent, APPLICATIONS=(
    ('blog_urls', 'Blog', {'admin_fields': get_admin_fields}),
    ))


Entry.register_regions(
    ('main', 'Main region'),
    )
Entry.create_content_type(RawContent)
Entry.create_content_type(ImageContent, POSITION_CHOICES=(
    ('default', 'Default position'),
    ))


class BlogEntriesNavigationExtension(NavigationExtension):
    """
    Extended navigation for blog entries.

    It would be added to 'Blog' page properties in admin.
    """
    name = _('all blog entries')

    def children(self, page, **kwargs):
        for entry in Entry.objects.all():
Beispiel #4
0
Page.create_content_type(
    ApplicationContent,
    APPLICATIONS=(
        ("blog_urls", "Blog", {"admin_fields": get_admin_fields}),
        ("news.urls", "News Application"),
        ("articles.urls", "Articles Application"),
        ("players.urls", "Players"),
        ("schedule.urls", "Calendar"),
        ("gallery.urls", "Gallery New"),
    ),
)


Entry.register_regions(("main", "Main region"))
Entry.create_content_type(RawContent, regions=(""))
Entry.create_content_type(ImageContent, POSITION_CHOICES=(("default", "Default position"),))


Page.register_extensions("feincms.module.page.extensions.navigation", "feincms.module.page.extensions.sites")


class Category(MPTTModel):
    name = models.CharField(max_length=20)
    slug = models.SlugField()
    parent = models.ForeignKey("self", blank=True, null=True, related_name="children")

    class Meta:
        ordering = ["tree_id", "lft"]
        verbose_name = "category"
        verbose_name_plural = "categories"
Beispiel #5
0
            ),
    }

Page.create_content_type(ApplicationContent, APPLICATIONS=(
    ('blog_urls', 'Blog', {'admin_fields': get_admin_fields}),
    ('news.urls', 'News Application'),
    ('articles.urls', 'Articles Application'),
    ('players.urls', 'Players'),
    ('schedule.urls','Calendar')
    ))


Entry.register_regions(
    ('main', 'Main region'),
    )
Entry.create_content_type(RawContent, regions=(''))
Entry.create_content_type(ImageContent, POSITION_CHOICES=(
    ('default', 'Default position'),
    ))


class BlogEntriesNavigationExtension(NavigationExtension):
    """
    Extended navigation for blog entries.

    It would be added to 'Blog' page properties in admin.
    """
    name = _('all blog entries')

    def children(self, page, **kwargs):
        for entry in Entry.objects.all():
Beispiel #6
0
        ('sidebar', _('Sidebar'), 'inherited'),
        ),
    })

Page.create_content_type(RichTextContent)
Page.create_content_type(ImageContent, POSITION_CHOICES=(
    ('block', _('block')),
    ('left', _('left')),
    ('right', _('right')),
    ))


# feincms blog stuff
Entry.register_extensions('translations') # Example set of extensions

Entry.register_templates({
    'title': _('Standard template'),
    'path': 'base.html',
    'regions': (
        ('main', _('Main content area')),
        ),
    })

Entry.create_content_type(RichTextContent)
Entry.create_content_type(ImageContent, POSITION_CHOICES=(
    ('block', _('block')),
    ('left', _('left')),
    ('right', _('right')),
    ))