CMS improvements
[snf-cloudcms] / cloudcms / cms.py
index 0cb997a..4f2b091 100644 (file)
@@ -54,9 +54,10 @@ from feincms.content.template.models import TemplateContent
 from feincms.content.video.models import VideoContent
 from feincms.content.richtext.models import RichTextContent
 
-from cloudcmsblog.models import Entry
+from cloudcmsresources.models import ResourcesList
 from cloudcms.content import *
 
+
 Page.register_extensions(
     'changedate',
     'datepublisher',
@@ -65,52 +66,89 @@ Page.register_extensions(
     'symlinks',
     'navigation',
     'sites',
-    'titles'
+    'titles',
+    'featured',
 )
 
+
 # Feincms Page templates declaration
 TEMPLATES = [{
-    'key': 'basic',
-    'title': 'Basic 2 columns template',
-    'path': 'cms/pages/page.html',
+    'key': 'twocolwide',
+    'title': 'Basic 2 columns template (left wider)',
+    'path': 'cms/pages/twocolwide.html',
     'regions': (
         ('main', 'Main region'),
         ('sidebar', 'Sidebar', 'inherited'),
         ),
     },
     {
-    'key': 'twocolwide',
-    'title': 'Basic 2 columns template (wider)',
-    'path': 'cms/pages/twocolwide.html',
+    'key': 'singlecol',
+    'title': 'Basic (Top 1 col, Bottom 2 cols)',
+    'path': 'cms/pages/basic1top2bottom.html',
     'regions': (
-        ('main', 'Main region'),
-        ('sidebar', 'Sidebar', 'inherited'),
+        ('top', 'Top region'),
+        ('bottom_left', 'Bottom left region'),
+        ('bottom_right', 'Bottom right region'),
+        ),
+    },
+             {
+    'key': 'basic2top2bottom',
+    'title': 'Basic (Top 2 cols, Bottom 2 cols)',
+    'path': 'cms/pages/basic2top2bottom.html',
+    'regions': (
+        ('top_left', 'Top left region'),
+        ('top_right', 'Top right region'),
+        ('bottom_left', 'Bottom left region'),
+        ('bottom_right', 'Bottom right region'),
         ),
     },
     {
-    'key': 'intro',
-    'title': 'Intro page Template',
-    'path': 'cms/pages/intro.html',
+    'key': 'blog',
+    'title': 'Blog template',
+    'path': 'cms/pages/blog.html',
     'regions': (
         ('main', 'Main region'),
         ('sidebar', 'Sidebar', 'inherited'),
         ),
     },
     {
-    'key': 'singlecol',
-    'title': 'Basic 1 column template',
-    'path': 'cms/pages/onecol.html',
+    'key': 'userguide',
+    'title': 'Userguide template',
+    'path': 'cms/pages/userguide.html',
     'regions': (
-        ('main', 'Main region'),
+        ('top', 'Top region'),
+        ('bottom_left', 'Bottom left region'),
+        ('bottom_right', 'Bottom right region'),
         ),
     },
     {
-    'key': 'blog',
-    'title': 'Blog template',
-    'path': 'cms/pages/blog.html',
+    'key': 'faq',
+    'title': 'FAQ\'s template',
+    'path': 'cms/pages/faq.html',
+    'regions': (
+        ('top', 'Top region'),
+        ('bottom_left', 'Bottom left region'),
+        ('bottom_right', 'Bottom right region'),
+        ),
+    },
+    {
+    'key': 'raw',
+    'title': 'Empty content template',
+    'path': 'cms/pages/empty.html',
     'regions': (
         ('main', 'Main region'),
-        ('sidebar', 'Sidebar', 'inherited'),
+        ),
+    },
+    {
+    'key': 'topwidetwocol',
+    'title': 'Basic (Top 1 col, Middle 2 cols, Bottom 2 cols)',
+    'path': 'cms/pages/topwidetwocol.html',
+    'regions': (
+        ('top', 'Top region'), 
+        ('middle_left', 'Middle left region'),
+        ('middle_right', 'Middle right region'),
+        ('bottom_left', 'Bottom left region'),
+        ('bottom_right', 'Bottom right region'),
         ),
     },
 ]
@@ -118,6 +156,8 @@ TEMPLATES = [{
 # register templates
 map(Page.register_templates, TEMPLATES)
 
+Page.create_content_type(TextileContent)
+Page.create_content_type(IntroBlock)
 Page.create_content_type(RichTextContent)
 Page.create_content_type(RawContent)
 Page.create_content_type(SectionContent, TYPE_CHOICES=(('block', 'Block'),))
@@ -125,6 +165,8 @@ Page.create_content_type(TemplateContent)
 Page.create_content_type(TwitterFeed)
 Page.create_content_type(VideoContent)
 Page.create_content_type(VideoSection)
+Page.create_content_type(IntroButton)
+Page.create_content_type(ClientDownload)
 Page.create_content_type(ImageContent, POSITION_CHOICES=(
     ('default', 'Default position'),
 ))
@@ -133,23 +175,47 @@ Page.create_content_type(MediaFileContent, TYPE_CHOICES=(
   ('download', 'as download')
 ))
 Page.create_content_type(ApplicationContent, APPLICATIONS=(
-    ('cloudcmsblog', 'Cloud blog', {'urls': 'cloudcmsblog.urls'}),))
-
+    ('cloudcmsblog', 'Cloud blog', {'urls': 'cloudcmsblog.urls'}),
+    ('cloudcmsfaq', 'Cloud FAQ', {'urls': 'cloudcmsfaq.urls'}),
+    ('cloudcmsguide', 'Cloud user guide', {'urls': 'cloudcmsguide.urls'}),)
+)
 
 # cloudcms specific content registration
 Page.create_content_type(LoginForm)
 Page.create_content_type(AboutBlock)
+Page.create_content_type(ResourcesList)
+Page.create_content_type(BlockColor)
 
+# Extra cms applications
+EXTRA_CONTENT_MODELS = []
+
+if 'cloudcmsblog' in settings.INSTALLED_APPS:
+    from cloudcmsblog.models import Entry, LatestEntries
+    EXTRA_CONTENT_MODELS.append(Entry)
+    Page.create_content_type(LatestEntries)
+
+if 'cloudcmsfaq' in settings.INSTALLED_APPS:
+    from cloudcmsfaq.models import Question
+    EXTRA_CONTENT_MODELS.append(Question)
+
+if 'cloudcmsguide' in settings.INSTALLED_APPS:
+    from cloudcmsguide.models import UserGuideEntry
+    EXTRA_CONTENT_MODELS.append(UserGuideEntry)
+
+for model in EXTRA_CONTENT_MODELS:
+    # Feincms specific registrations for our blog entry model
+    model.register_regions(
+        ('main', _('Main content area')),
+        ('sidebar', _('Right column')),
+    )
+    model.create_content_type(RawContent)
+    model.create_content_type(TemplateContent)
+    model.create_content_type(SectionContent, TYPE_CHOICES=(('block', 'Block'),))
+    model.create_content_type(RichTextContent, cleanse=False, regions=('main',))
+    model.create_content_type(ImageContent, POSITION_CHOICES=(
+        ('default', 'Default position'),
+    ))
 
-# Feincms specific registrations for our blog entry model
-Entry.register_regions(
-    ('main', _('Main content area')),
-    ('sidebar', _('Right column')),
-)
-Entry.create_content_type(RichTextContent, cleanse=False, regions=('main',))
-Entry.create_content_type(TemplateContent)
-Entry.create_content_type(VideoContent)
-Entry.create_content_type(TwitterFeed)
-Entry.create_content_type(RawContent)
-Entry.create_content_type(SectionContent, TYPE_CHOICES=(('block', 'Block'),))
 
+Page.create_content_type(StatsBlock)
+Page.create_content_type(IntroVideo)
\ No newline at end of file