Пример #1
0
def install():
    """Installs the blog application.
    """
    # Register Portlets
    register_portlet(BlogPortlet, "Blog")

    # Register Templates
    register_template(name="Blog", path="lfc/templates/blog.html")

    register_template(name="Blog Entry", path="lfc/templates/blog_entry.html")

    # Register objects
    register_content_type(BlogEntry,
                          name="Blog Entry",
                          templates=["Blog Entry"],
                          default_template="Blog Entry",
                          global_addable=False,
                          workflow="Portal")

    register_content_type(Blog,
                          name="Blog",
                          sub_types=["BlogEntry"],
                          templates=["Blog"],
                          default_template="Blog",
                          workflow="Portal")

    # Register Blog as a sub type of Page
    register_sub_type(Blog, "Page")
Пример #2
0
def install():
    """Installs the blog application.
    """
    # Register Portlets
    register_portlet(BlogPortlet, "Blog")

    # Register Templates
    register_template(
        name="Blog",
        path="lfc/templates/blog.html")

    register_template(
        name="Blog Entry",
        path="lfc/templates/blog_entry.html")

    # Register objects
    register_content_type(BlogEntry,
        name = "Blog Entry",
        templates=["Blog Entry"],
        default_template="Blog Entry",
        global_addable=False,
        workflow="Portal")

    register_content_type(Blog,
        name="Blog",
        sub_types=["BlogEntry"],
        templates=["Blog"],
        default_template="Blog",
        workflow="Portal")

    # Register Blog as a sub type of Page
    register_sub_type(Blog, "Page")
Пример #3
0
def install():
    """Installs the blog application.
    """
    # Register Portlets
    register_portlet(NewsPortlet, "News")

    # Register Templates
    register_template(name = "News", path="lfc/templates/news.html")
    register_template(name = "News Entry", path="lfc/templates/news_entry.html")

    # Register objects
    register_content_type(NewsEntry, name = "News Entry", templates=["News Entry"], default_template="News Entry", global_addable=False)
    register_content_type(News, name = "News", sub_types = ["NewsEntry"], templates=["News"], default_template="News")

    # Register Blog as a sub type of Page
    register_sub_type(News, "Page")
Пример #4
0
def initialize(create_resources=False):
    """Registers default portlets, templates and content types.
    """
    # Portlets
    register_portlet(NavigationPortlet, "Navigation")
    register_portlet(ContentPortlet, "Pages")
    register_portlet(RandomPortlet, "Random")
    register_portlet(TextPortlet, "Text")

    # Register Templates
    register_template(name="Plain", path="lfc/templates/plain.html")
    register_template(name="Article", path="lfc/templates/article.html")
    register_template(name="Gallery", path="lfc/templates/gallery.html", images_columns=3)
    register_template(name="Overview", path="lfc/templates/overview.html")

    # Register Resources
    register_resource(type=CSS, group="lfc", path="lfc/yui/reset-fonts.css")
    register_resource(type=CSS, group="lfc", path="lfc/lightbox/css/jquery.lightbox-0.5.css")
    register_resource(type=CSS, group="lfc", path="lfc/blueprint/src/grid.css")
    register_resource(type=CSS, group="lfc", path="lfc_theme/css/tiny.css")
    register_resource(type=CSS, group="lfc", path="lfc_theme/css/lfc.css")

    register_resource(type=JS, group="lfc", path="lfc/jquery/jquery.min.js")
    register_resource(type=JS, group="lfc", path="lfc/jquery/jquery.tools.min.js")
    register_resource(type=JS, group="lfc", path="lfc/lightbox/js/jquery.lightbox-0.5.js")
    register_resource(type=JS, group="lfc", path="lfc_theme/js/lfctheme.js")

    register_resource(type=CSS, group="manage", path="lfc/yui/reset-min.css")
    register_resource(type=CSS, group="manage", path="lfc/lightbox/css/jquery.lightbox-0.5.css")
    register_resource(type=CSS, group="manage", path="lfc/jquery-ui-1.8.4.custom/css/smoothness/jquery-ui-1.8.4.custom.css")
    register_resource(type=CSS, group="manage", path="lfc/jquery/jquery.jgrowl.css")
    register_resource(type=CSS, group="manage", path="lfc/jquery/superfish/superfish.css")
    register_resource(type=CSS, group="manage", path="lfc/jquery/autocomplete/jquery.autocomplete.css")
    register_resource(type=CSS, group="manage", path="lfc/css/lfc_manage.css")

    register_resource(type=JS, group="manage", path="/admin/jsi18n/", merge=0, minify=0, absolute=1)
    register_resource(type=JS, group="manage", path="admin/js/core.js")
    register_resource(type=JS, group="manage", path="admin/js/calendar.js")
    register_resource(type=JS, group="manage", path="admin/js/urlify.js")
    register_resource(type=JS, group="manage", path="lfc/jquery/jquery-1.4.2.min.js")
    register_resource(type=JS, group="manage", path="lfc/jquery/jquery.tools.min.js")
    register_resource(type=JS, group="manage", path="lfc/jquery/jquery.form.js")
    register_resource(type=JS, group="manage", path="lfc/jquery/jquery.jgrowl_minimized.js")
    register_resource(type=JS, group="manage", path="lfc/jquery/jquery.cookie.pack.js")
    register_resource(type=JS, group="manage", path="lfc/jquery/superfish/superfish.js")
    register_resource(type=JS, group="manage", path="lfc/jquery-ui-1.8.4.custom/js/jquery-ui-1.8.4.custom.min.js")
    register_resource(type=JS, group="manage", path="lfc/jquery/autocomplete/jquery.autocomplete.pack.js")
    register_resource(type=JS, group="manage", path="lfc/js/lfc_manage.js")

    register_resource(type=JS, group="manage", minify=0, path="lfc/tiny_mce/jquery.tinymce.js")
    register_resource(type=JS, group="manage", minify=1, path="lfc/js/lfc_editor.js")
    register_resource(type=JS, group="manage", minify=1, path="lfc/js/lfc_tinymce.js")

    register_resource(type=JS, group="manage", merge=0, path="admin/js/admin/DateTimeShortcuts.js")

    if create_resources:
        resources.utils.create_resources()
Пример #5
0
def initialize():
    """Registers default portlets, templates and content types.
    """
    # Portlets
    register_portlet(NavigationPortlet, u"Navigation")
    register_portlet(ContentPortlet, u"Content")
    register_portlet(RandomPortlet, u"Random")
    register_portlet(TextPortlet, u"Text")

    # Register Templates
    register_template(name=u"Plain", path=u"lfc/templates/plain.html")
    register_template(name=u"Article", path=u"lfc/templates/article.html")
    register_template(name=u"Gallery", path=u"lfc/templates/gallery.html", images_columns=3)
    register_template(name=u"Overview", path=u"lfc/templates/overview.html")
Пример #6
0
def initialize():
    """Registers default portlets, templates and content types.
    """
    # Portlets
    register_portlet(NavigationPortlet, u"Navigation")
    register_portlet(ContentPortlet, u"Content")
    register_portlet(RandomPortlet, u"Random")
    register_portlet(TextPortlet, u"Text")

    # Register Templates
    register_template(name=u"Plain", path=u"lfc/templates/plain.html")
    register_template(name=u"Article", path=u"lfc/templates/article.html")
    register_template(name=u"Gallery",
                      path=u"lfc/templates/gallery.html",
                      images_columns=3)
    register_template(name=u"Overview", path=u"lfc/templates/overview.html")
Пример #7
0
def install():
    """Installs the Scrollable parts application.
    """
    # Register Portlets
    register_portlet(ScrollableNavigatorPortlet, "ScrollableNavigator")
    register_portlet(FeedbackActionPortlet, u"Копка формы обратной связи")

    # Register Templates
    register_template(name = "Scrollable Overview", path="lfc/templates/scrollable_overview.html")
    register_template(name = "Carousel Overview", path="lfc/templates/jcarousel_overview.html")
    register_template(name = "Kidness Gallery", path="lfc/templates/jcarousel_gallery.html")
    register_template(name = "Video Gallery", path="lfc/templates/video_gallery.html")
    register_template(name = "Video Gallery with VK Comments", path="lfc/templates/video_gallery_vk.html")
#    register_template(name = "Scrollable Container", path="lfc/templates/scrollable_container.html")
#    register_template(name = "Scrollable Part", path="lfc/templates/scrollable_part.html")

    # Register objects
    register_content_type(ScrollableContainer, 
                          name = "Scrollable Container", 
                          templates=["Scrollable Overview","Carousel Overview"], 
                          default_template="Carousel Overview", 
                          global_addable=False)
    
    register_content_type(ScrollablePart, 
                          name = u"Scrollable Part", 
                          global_addable=False)
    
    register_content_type(Page,
        name="Page",
        sub_types=["Page"],
        templates=["Article", "Plain", "Gallery", "Overview", "Scrollable Overview","Carousel Overview", "Kidness Gallery", "Video Gallery", "Video Gallery with VK Comments"],
        default_template="Article")

    # Register Blog as a sub type of Page
    register_sub_type(ScrollableContainer, "Page")
    register_sub_type(ScrollablePart, "Scrollable Container")
Пример #8
0
def install():
    """Installs the Kidness Portlets parts application.
    """
    # Register Portlets
    #register_portlet(NewsPortlet, "NewsPortlet")
    #register_portlet(ArticlePortlet, "ArticlePortlet")
    #register_portlet(AnouncementPortlet, "AnouncementPortlet")
    register_portlet(SignupButtonPortlet, "SignupButtonPortlet")
    register_portlet(TagsBlockPortlet, "TagsBlockPortlet")
    register_portlet(AddThisBlockPortlet, "AddThisBlockPortlet")
Пример #9
0
def register_lfs_portlets(sender, **kwargs):
    # don't register our portlets until the table has been created by syncdb
    if sender == portlets.models:
        register_portlet(AverageRatingPortlet, "Average Rating")
        register_portlet(CartPortlet, "Cart")
        register_portlet(CategoriesPortlet, "Categories")
        register_portlet(DeliveryTimePortlet, "Delivery Time")
        register_portlet(FilterPortlet, "Filter")
        register_portlet(PagesPortlet, "Pages")
        register_portlet(RecentProductsPortlet, "Recent Products")
        register_portlet(RelatedProductsPortlet, "Related Products")
        register_portlet(TextPortlet, "Text")
        register_portlet(TopsellerPortlet, "Topseller")
        register_portlet(ForsalePortlet, "For sale")
        register_portlet(FeaturedPortlet, "Featured Products")
        register_portlet(LatestPortlet, "Latest Products")
Пример #10
0
def register_portlets(sender, **kwargs):
    # don't register our portlets until the table has been created by syncdb
    if sender == portlets.models:
        register_portlet(AdditionalFilterPortlet, "Addinional category filter")
Пример #11
0
def register_lfs_portlets(sender, **kwargs):
    # don't register our portlets until the table has been created by syncdb
    if sender == portlets.models:
        register_portlet(AverageRatingPortlet, "Average Rating")
        register_portlet(CartPortlet, "Cart")
        register_portlet(CategoriesPortlet, "Categories")
        register_portlet(DeliveryTimePortlet, "Delivery Time")
        register_portlet(FilterPortlet, "Filter")
        register_portlet(PagesPortlet, "Pages")
        register_portlet(RecentProductsPortlet, "Recent Products")
        register_portlet(RelatedProductsPortlet, "Related Products")
        register_portlet(TextPortlet, "Text")
        register_portlet(TopsellerPortlet, "Topseller")
        register_portlet(ForsalePortlet, "For sale")
        register_portlet(FeaturedPortlet, "Featured Products")
        register_portlet(LatestPortlet, "Latest Products")
Пример #12
0
def register_lfs_portlets(sender, **kwargs):
    if sender.name == "portlets":
        register_portlet(AverageRatingPortlet, "Average Rating")
        register_portlet(CartPortlet, "Cart")
        register_portlet(CategoriesPortlet, "Categories")
        register_portlet(DeliveryTimePortlet, "Delivery Time")
        register_portlet(FilterPortlet, "Filter")
        register_portlet(PagesPortlet, "Pages")
        register_portlet(RecentProductsPortlet, "Recent Products")
        register_portlet(RelatedProductsPortlet, "Related Products")
        register_portlet(TextPortlet, "Text")
        register_portlet(TopsellerPortlet, "Topseller")
        register_portlet(ForsalePortlet, "For sale")
        register_portlet(FeaturedPortlet, "Featured Products")
        register_portlet(LatestPortlet, "Latest Products")
Пример #13
0
def initialize(create_resources=False):
    """Registers default portlets, templates and content types.
    """
    # Portlets
    register_portlet(NavigationPortlet, "Navigation")
    register_portlet(PagesPortlet, "Pages")
    register_portlet(RandomPortlet, "Random")
    register_portlet(TextPortlet, "Text")

    # Register Templates
    register_template(name="Plain", path="lfc/templates/plain.html")
    register_template(name="Article", path="lfc/templates/article.html")
    register_template(name="Gallery",
                      path="lfc/templates/gallery.html",
                      images_columns=3)
    register_template(name="Overview", path="lfc/templates/overview.html")

    # Register Resources
    register_resource(type=CSS, group="lfc", path="lfc/yui/reset-fonts.css")
    register_resource(type=CSS,
                      group="lfc",
                      path="lfc/lightbox/css/jquery.lightbox-0.5.css")
    register_resource(type=CSS, group="lfc", path="lfc/blueprint/src/grid.css")
    register_resource(type=CSS, group="lfc", path="lfc_theme/css/tiny.css")
    register_resource(type=CSS, group="lfc", path="lfc_theme/css/lfc.css")

    register_resource(type=JS, group="lfc", path="lfc/jquery/jquery.min.js")
    register_resource(type=JS,
                      group="lfc",
                      path="lfc/jquery/jquery.tools.min.js")
    register_resource(type=JS,
                      group="lfc",
                      path="lfc/lightbox/js/jquery.lightbox-0.5.js")
    register_resource(type=JS, group="lfc", path="lfc_theme/js/lfctheme.js")

    register_resource(type=CSS, group="manage", path="lfc/yui/reset-min.css")
    register_resource(type=CSS,
                      group="manage",
                      path="lfc/lightbox/css/jquery.lightbox-0.5.css")
    register_resource(
        type=CSS,
        group="manage",
        path=
        "lfc/jquery-ui-1.8.4.custom/css/smoothness/jquery-ui-1.8.4.custom.css")
    register_resource(type=CSS,
                      group="manage",
                      path="lfc/jquery/jquery.jgrowl.css")
    register_resource(type=CSS,
                      group="manage",
                      path="lfc/jquery/superfish/superfish.css")
    register_resource(type=CSS,
                      group="manage",
                      path="lfc/jquery/autocomplete/jquery.autocomplete.css")
    register_resource(type=CSS, group="manage", path="lfc/css/lfc_manage.css")
    register_resource(type=CSS,
                      group="manage",
                      path="lfc/swfupload/default.css")
    register_resource(type=CSS,
                      group="manage",
                      path="lfc/cleditor/jquery.cleditor.css")

    register_resource(type=JS,
                      group="manage",
                      path="/admin/jsi18n",
                      merge=0,
                      minify=0,
                      absolute=1)
    register_resource(type=JS, group="manage", path="admin/js/core.js")
    register_resource(type=JS, group="manage", path="admin/js/calendar.js")
    register_resource(type=JS, group="manage", path="admin/js/urlify.js")
    register_resource(type=JS,
                      group="manage",
                      path="lfc/jquery/jquery-1.4.2.min.js")
    register_resource(type=JS,
                      group="manage",
                      path="lfc/cleditor/jquery.cleditor.min.js")
    register_resource(type=JS,
                      group="manage",
                      path="lfc/jquery/jquery.tools.min.js")
    register_resource(type=JS,
                      group="manage",
                      path="lfc/jquery/jquery.form.js")
    register_resource(type=JS,
                      group="manage",
                      path="lfc/jquery/jquery.jgrowl_minimized.js")
    register_resource(type=JS,
                      group="manage",
                      path="lfc/jquery/jquery.cookie.pack.js")
    register_resource(type=JS,
                      group="manage",
                      path="lfc/jquery/superfish/superfish.js")
    register_resource(type=JS,
                      group="manage",
                      path="lfc/jquery/jquery.ba-bbq.min.js")
    register_resource(
        type=JS,
        group="manage",
        path="lfc/jquery-ui-1.8.4.custom/js/jquery-ui-1.8.4.custom.min.js")
    register_resource(
        type=JS,
        group="manage",
        path="lfc/jquery/autocomplete/jquery.autocomplete.pack.js")
    register_resource(type=JS,
                      group="manage",
                      minify=0,
                      path="lfc/swfupload/swfupload.js")
    register_resource(type=JS,
                      group="manage",
                      path="lfc/swfupload/swfupload.queue.js")
    register_resource(type=JS,
                      group="manage",
                      path="lfc/swfupload/fileprogress.js")
    register_resource(type=JS,
                      group="manage",
                      path="lfc/swfupload/handlers.js")
    register_resource(type=JS,
                      group="manage",
                      path="lfc/swfupload/swfupload.cookies.js")
    register_resource(type=JS, group="manage", path="lfc/js/lfc_manage.js")

    register_resource(type=JS,
                      group="manage",
                      minify=0,
                      path="lfc/tiny_mce/jquery.tinymce.js")
    register_resource(type=JS,
                      group="manage",
                      minify=1,
                      path="lfc/js/lfc_editor.js")
    register_resource(type=JS,
                      group="manage",
                      minify=1,
                      path="lfc/js/lfc_tinymce.js")

    register_resource(type=JS,
                      group="manage",
                      merge=0,
                      path="admin/js/admin/DateTimeShortcuts.js")

    if create_resources:
        resources.utils.create_resources()

    # Content Types
    register_content_type(
        Page,
        name="Page",
        sub_types=["Page"],
        templates=["Article", "Plain", "Gallery", "Overview"],
        default_template="Article")
Пример #14
0
            # portlet query string from request.POST
            self.session.set('qs', context.get('post').urlencode())

    def xhr(self, *args):
        """ XHR. """
        logging.debug('XHR request')
        self.session.set('xhr', '1')


class MarionetForm(forms.ModelForm):
    """Form for Marionet.
    """
    class Meta:
        model = Marionet

register_portlet(Marionet, "Marionet")


class MarionetSession(PortletSession):
    """ Connects marionet and a user,
        so a single portlet can be created on the page,
        and all users accessing have their own session.
    """
    # user is not necessary, and each user may have multiple sessions
    user = models.ForeignKey(User, null=True, unique=False)
    # portlet is not necessary, if initialized with url kwarg.
    portlet = models.ForeignKey(Marionet, null=True)
    # key is needed to identify, if user is not set.
    django_key = models.CharField(null=True, blank=True, max_length=42, unique=False)

    def __init__(self,*args,**kwargs):
Пример #15
0
def install():
    """Installs the Scrollable parts application.
    """
    # Register Portlets
    register_portlet(TextBlockPortlet, "TextBlock")
    register_portlet(SlideshowPortlet, "Slideshow")