Пример #1
0
    def baseComponents(self):
        u"""Create a theme site with just one single template home page. Answer a list
        of page instances that are used as templates for this site."""
        # Create an instance (=object) of components to be placed on the page.
        # Import current example site, as anchor for the article files.
        adapter = self.getSiteAdapter()

        logo = Logo()
        menu = Menu()
        navigation = Navigation()
        article = Article(
            showPoster=False
        )  # No poster inside the article. We use the PosterHead component.
        articleSideBar = ArticleSideBar(showChapterNavigation=True)
        articlesList = ArticlesList()
        posterhead = PosterHead(
        )  # Wordpress-like big picture from article.poster link.
        featuredByImage = FeaturedByImage()
        featuredByDiapText = FeaturedByDiapText()
        featuredByText = FeaturedByText()
        featuredByImageList = FeaturedByImageList()
        # Containers for pages
        top = Top(components=(logo, menu),
                  media=Media(max=self.C.M_MOBILE_MAX, display=self.C.NONE))
        homeContainer = Container(components=(featuredByDiapText,
                                              featuredByImage, featuredByText,
                                              featuredByImageList))
        articleContainer = Container(components=(posterhead, article,
                                                 articleSideBar))
        articlesListContainer = Container(articlesList, )
        footer = Footer()

        # Create an instance (=object) of the page, containing the navigation components.
        # The class is also the page name in the url.
        homePage = Page(class_=self.C.TEMPLATE_INDEX,
                        components=(top, homeContainer, footer),
                        adapter=adapter,
                        title=self.TITLE,
                        fonts=self.URL_FONTS)

        articlePage = Page(class_=self.C.TEMPLATE_ARTICLE,
                           components=(top, articleContainer, footer),
                           adapter=adapter,
                           title=self.TITLE,
                           fonts=self.URL_FONTS)

        articlesPage = Page(class_=self.C.TEMPLATE_ARTICLES,
                            components=(top, articlesListContainer, footer),
                            adapter=adapter,
                            title=self.TITLE,
                            fonts=self.URL_FONTS)

        # Answer a list of types of pages for this site. In this case just one template.
        return [homePage, articlePage, articlesPage]
Пример #2
0
    def baseComponents(self):
        # Import current example site, as anchor for the article files.
        from xierpa3.sites import doingbydesign
        # Root path where to find the article Simples wiki file for this example page.
        articleRoot = TX.module2Path(doingbydesign) + '/files/articles/'
        adapter = DbDAdapter(
            articleRoot)  # Preferred adapter class for articles in this site.

        logo = Logo(text='Doing by Design',
                    fontFamily='Impact',
                    color=Color('#888'),
                    fontSize=Em(1.8))
        menu = Menu()
        mobileNavigation = DbDMobileNavigation()
        article = Article()

        featuredByImage = FeaturedByImage(start=0,
                                          width=Perc(65.4),
                                          showTitle=False,
                                          showHeadline=False,
                                          showTopic=False)
        featuredByText = FeaturedByText(start=0, width=Perc(30.75))

        # Containers
        top = Top(components=(logo, menu),
                  media=Media(max=self.C.M_MOBILE_MAX, display=self.C.NONE))
        featured = Featured(components=(featuredByImage, featuredByText),
                            backgroundColor=Color('#262c37'))
        section = Section(components=(featuredByImage, ))
        mainContent = MainContent(components=article)
        footer = Footer(components=(menu))

        homePage = Page(name=self.C.TEMPLATE_INDEX,
                        components=(mobileNavigation, top, featured, section,
                                    mainContent, footer),
                        css=self.C.URL_CSS,
                        fonts=self.C.URL_FONTS,
                        js=self.URL_JAVASCRIPT,
                        favicon=self.C.URL_FAVICON,
                        adapter=adapter)

        articlePage = Page(name=self.C.TEMPLATE_ARTICLE,
                           comoonents=(mobileNavigation, top, article, footer),
                           css=self.C.URL_CSS,
                           fonts=self.C.URL_FONTS,
                           js=self.URL_JAVASCRIPT,
                           favicon=self.C.URL_FAVICON,
                           adapter=adapter)

        return [homePage, articlePage]
Пример #3
0
 def baseComponents(self):
     u"""Create a theme site with just one single template home page. Answer a list
     of page instances that are used as templates for this site."""
     # Create an instance (=object) of components to be placed on the page.
     # @start        Start index of the item in the selected/sorted set of articles.
     # @count        Nunmber of items (default is 3). Omit current article in the selection
     featured1 = FeaturedByImage(width=Perc(100), count=2)
     container = Container(components=featured1, rowMaxWidth=Perc(50))
     # Create an instance (=object) of the page, containing the featured components.
     # The class is also the page name in the url.
     homePage = Page(class_=self.C.TEMPLATE_INDEX,
                     components=container,
                     title=self.TITLE,
                     fonts=self.URL_FONTS)
     # Answer a list of types of pages for this site. In this case just one template.
     return [homePage]
Пример #4
0
    def baseComponents(self):
        # Create the article adapter
        # Import articles from the doingbydesign site, sharing the article files.
        from xierpa3.sites import doingbydesign
        # Root path where to find the article Simplex wiki file for this example page.
        articleRoot = TX.module2Path(doingbydesign) + '/files/articles/'
        adapter = SimpleSiteAdapter(articleRoot)

        # Header
        logo = Logo()
        menu = Menu()
        header = Header(
            components=(logo, menu),
            mobileContainerDisplay=self.C.NONE,
            doc_mobileContainerDisplay=u'Header is not visible for mobile')
        mobileNavigation = MobileNavigation(
        )  # Is container by itself. Change??

        # Create the component instances
        article = Article(width=Perc(68))
        featuredByImage = FeaturedByImage(count=1, width=Perc(30))
        featuredByText = FeaturedByText(start=1, count=3, width=Perc(30))
        # Create the single page instance, containing the number of components
        mainHome = Container(components=(article, featuredByImage,
                                         featuredByText))

        # Footer
        footer = Footer(components=(menu, ),
                        containerBackgroundColor=self.FOOTERBGCOLOR)

        # The class is also the page name in the url.
        homePage = Page(
            class_=self.C.TEMPLATE_INDEX,
            name=self.C.TEMPLATE_INDEX,
            adapter=adapter,
            #components=(mobileNavigation, header, mainHome, footer),
            #components=(header, mainHome, footer),
            components=Container(header),
            fonts=self.URL_FONTS,
            title=self.TITLE,
            css=self.C.URL_CSS)
        return [homePage]
Пример #5
0
 def baseComponents(self):
     u"""Create the component instances"""
     # Import current example site, as anchor for the article files.
     from xierpa3.sites.examples import textilearticles
     # Root path where to find the article Simples wiki file for this example page.
     articleRoot = TX.module2Path(textilearticles) + '/files/articles/'
     adapter = ArticleAdapter(
         articleRoot)  # Preferred adapter class for articles in this site.
     # Create navigation instance, to choose between the available articles.
     menu = Menu(adapter=adapter)
     menuContainer = Container(components=menu)
     # Create the article component to contain articles answered by the adapter.
     #article = SimplexArticle(adapter=adapter)
     article = Article(width=Perc(70),
                       adapter=adapter,
                       showPoster=True,
                       splitChapters=False)
     articleSideBar = ArticleSideBar(width=Perc(22), adapter=adapter)
     featuredArticles = FeaturedByImage(
         width=Perc(22),
         adapter=adapter,
         # Example to overwrite the default BluePrint parameter titleColor
         titleColor=Color('red'))
     #featuredByImage = FeaturedByText(widht=Perc(22), adapter=adapter)
     # Make main page container for the article column
     container = Container(components=(
         article,
         articleSideBar,
         featuredArticles,
         #featuredByImage
     ))
     # The class is also the page name in the url.
     homePage = Page(class_=self.C.TEMPLATE_INDEX,
                     name=self.C.TEMPLATE_INDEX,
                     fonts=self.URL_FONTS,
                     title=self.TITLE,
                     css=self.C.URL_CSS,
                     components=(menuContainer, container))
     return [homePage]
Пример #6
0
    def baseComponents(self):
        logo = Logo(logoSrc=self.SRCLOGO,
                    logoName=self.LOGO,
                    color=C.WHITE,
                    margintop=Em(0.5),
                    fontsize=Em(2),
                    fontfamily='AmplitudeComp Medium')
        menu = Menu()
        socialmedia = SocialMedia(twitterAccount='xierpa',
                                  facebookAccount='xierpa')

        header = Header(components=(logo, menu), mobileContainerDisplay=C.NONE)
        mobileNavigation = MobileNavigation(
            title=self.TITLE)  # Is container by itself. Change??
        # Articles featured by image
        featuredByImage = FeaturedByImage(
        )  # Featured article on a page. Main photo+link
        #featuredByImageList = FeaturedByImageList() # Featured article on a page. List of related links
        # Articles featured by summary text
        featuredSideText = FeaturedByDiapText(colWidth=4,
                                              itemStart=1,
                                              label='Featured course')
        featuredByText = FeaturedByText(itemStart=2, showPoster=False)
        featuredByTextList = FeaturedByTextList(itemStart=5)
        # Featured black container
        bgColor = '#323A47'
        featuredImages = Featured(
            class_='featuredImages',
            components=(featuredByImage, featuredSideText),
            #components=(featuredSideText, featuredByImage),
            containerBackgroundColor=bgColor)
        # Featured text container
        bgColor = '#E8E8E8'
        featuredTexts = Featured(class_='featuredTexts',
                                 components=(featuredByText,
                                             featuredByTextList),
                                 containerBackgroundColor=bgColor)
        # Footer group
        footer = Footer(components=(menu, ),
                        containerBackgroundColor=FOOTERBACKGROUNDCOLOR)

        # Article
        featuredByTextList = FeaturedByTextList(
        )  # Default start a featured index 0
        article = Container(class_=C.CLASS_ARTICLE,
                            containerBackgroundImage=self.URL_BACKGROUNDIMAGE,
                            containerBackgroundRepeat=C.REPEAT,
                            components=(Article(), socialmedia,
                                        ArticleSideBar(), featuredByTextList))

        homePage = Page(name=C.TEMPLATE_INDEX,
                        components=(mobileNavigation, header, featuredImages,
                                    featuredTexts, footer),
                        css=self.URL_CSS,
                        fonts=self.URL_FONTS,
                        js=self.URL_JAVASCRIPT,
                        favicon=self.URL_FAVICON)

        articlePage = Page(name=C.TEMPLATE_ARTICLE,
                           components=(mobileNavigation, header, article,
                                       footer),
                           css=self.URL_CSS,
                           fonts=self.URL_FONTS,
                           js=self.URL_JAVASCRIPT,
                           favicon=self.URL_FAVICON)

        return [homePage, articlePage]
Пример #7
0
    def baseComponents(self):
        logo = Logo(logoSrc=self.SRCLOGO)
        menu = Menu()
        socialmedia = SocialMedia(twitterAccount='doingbydesign',
                                  facebookAccount='doingbydesign')

        header = Header(components=(logo, menu),
                        mobileContainerDisplay=self.NONE)
        mobileNavigation = MobileNavigation(
            title=self.TITLE)  # Is container by itself. Change??
        # Articles featured by image
        featuredByImage = FeaturedByImage(
        )  # Featured article on a page. Main photo+link
        featuredByImage100 = FeaturedByImage(
            colWidth=9)  # Featured article as group item
        #featuredByImageList = FeaturedByImageList() # Featured article on a page. List of related links
        # Articles featured by summary text
        featuredSideText = FeaturedByDiapText(colWidth=4,
                                              itemStart=1,
                                              label='Featured course')
        featuredByText = FeaturedByText(itemStart=2, showPoster=False)
        featuredByTextList = FeaturedByTextList(itemStart=5)
        # Featured black container
        bgColor = '#323A47'
        featuredImages = Featured(
            class_='featuredImages',
            components=(featuredByImage, featuredSideText),
            #components=(featuredSideText, featuredByImage),
            containerBackgroundColor=bgColor)
        # Featured text container
        bgColor = '#E8E8E8'
        featuredTexts = Featured(class_='featuredTexts',
                                 components=(featuredByText,
                                             featuredByTextList),
                                 containerBackgroundColor=bgColor)
        # Footer group
        footer = Footer(components=(menu, ),
                        containerBackgroundColor=FOOTERBACKGROUNDCOLOR)

        # Article
        featuredByTextList = FeaturedByTextList(
        )  # Default start a featured index 0
        article = Container(class_=self.C.CLASS_ARTICLE,
                            containerBackgroundImage=self.URL_BACKGROUNDIMAGE,
                            containerBackgroundRepeat=self.C.REPEAT,
                            components=(Article(), socialmedia,
                                        ArticleSideBar(), featuredByTextList))

        # Floating items
        thumbnails = ItemGroup(components=(featuredByImage100, ))

        # Documentation
        documentation = Documentation()

        homePage = Page(name=self.C.TEMPLATE_INDEX,
                        components=(mobileNavigation, header, featuredImages,
                                    featuredTexts, footer),
                        css=self.URL_CSS,
                        fonts=self.URL_FONTS,
                        js=self.URL_JAVASCRIPT,
                        favicon=self.URL_FAVICON)

        articlePage = Page(name=self.C.TEMPLATE_ARTICLE,
                           components=(mobileNavigation, header, article,
                                       footer),
                           css=self.URL_CSS,
                           fonts=self.URL_FONTS,
                           js=self.URL_JAVASCRIPT,
                           favicon=self.URL_FAVICON)

        thumbnailPage = Page(name=self.C.TEMPLATE_COURSES,
                             components=(mobileNavigation, header,
                                         featuredImages, footer),
                             css=self.URL_CSS,
                             fonts=self.URL_FONTS,
                             js=self.URL_JAVASCRIPT,
                             favicon=self.URL_FAVICON)

        productsPage = Page(name=self.C.TEMPLATE_PRODUCTS,
                            components=(mobileNavigation, header, thumbnails,
                                        footer),
                            css=self.URL_CSS,
                            fonts=self.URL_FONTS,
                            js=self.URL_JAVASCRIPT,
                            favicon=self.URL_FAVICON)

        categoryPage = Page(name=self.C.TEMPLATE_CATEGORY,
                            components=(mobileNavigation, header, footer),
                            css=self.URL_CSS,
                            fonts=self.URL_FONTS,
                            js=self.URL_JAVASCRIPT,
                            favicon=self.URL_FAVICON)

        # Automatic documentation about Xierpa3
        documentationPage = Page(name=self.C.TEMPLATE_DOCUMENTATION,
                                 components=(mobileNavigation, header,
                                             documentation, footer),
                                 css=self.URL_CSS,
                                 fonts=self.URL_FONTS,
                                 js=self.URL_JAVASCRIPT,
                                 favicon=self.URL_FAVICON)

        return [
            homePage, articlePage, productsPage, thumbnailPage, categoryPage,
            documentationPage
        ]
Пример #8
0
    def baseComponents(self):        
        logo = Logo()
        menu = Menu()
        socialmedia = SocialMedia(twitterAccount='doingbydesign', facebookAccount='doingbydesign') 

        header = Header(components=(logo,menu), mobileContainerDisplay=self.C.NONE,
            doc_mobileContainerDisplay=u'Header is not visible for mobile')
        mobileNavigation = MobileNavigation() # Is container by itself. Change??
        # Articles featured by image
        #featuredByImage = FeaturedByImage() # Featured article on a page. Main photo+link
        #featuredByImage100 = FeaturedByImage(colWidth=9) # Featured article as group item
        #featuredByImageList = FeaturedByImageList() # Featured article on a page. List of related links
        # Articles featured by summary text
        #featuredSideText = FeaturedByDiapText(colWidth=4, itemStart=1, label='Featured course')
        #featuredByText = FeaturedByText(itemStart=2, showPoster=False)
        #featuredByTextList = FeaturedByTextList(itemStart=5)
        #featuredSideText = Featured(colWidth=4, itemStart=1, label='Featured course')
        #featuredByText = Featured(itemStart=2, showPoster=False)
        #featuredByTextList = Featured(itemStart=5)
        featuredSideText = featuredByImage = featuredByText = featuredByTextList = featuredByImage100 = FeaturedByImage()
        # Featured black container
        BGCOLOR = Color('#323A47')
        featuredImages = FeaturedByImage(class_='featuredImages',
            components=(featuredByImage, featuredSideText),
            containerBackgroundColor=BGCOLOR)
        # Featured text container
        BGCOLOR = Color('#E8E8E8')
        featuredTexts = FeaturedByImage(class_='featuredTexts',
            components=(featuredByText, featuredByTextList),
            containerBackgroundColor=BGCOLOR)
        # Footer group
        footer = Footer(components=(menu,), containerBackgroundColor=self.CSS_FOOTERBGCOLOR)

        # Documentation
        # The documentation class knows how to collect methods and their attributes
        # from components, adapters and builders and build them in an automated
        # documentation site.
        documentation = Documentation()
        
        # Article
        #featuredByTextList = FeaturedByTextList() # Default start at featured index 0
        featuredByTextList = FeaturedByImage() # Default start at featured index 0
        article = Container(class_=self.C.CLASS_ARTICLE,
            containerBackgroundImage=self.URL_BACKGROUNDIMAGE, containerBackgroundRepeat=self.C.REPEAT, 
            components=(Article(), socialmedia, ArticleSideBar(), featuredByTextList))
    
        # Floating items
        thumbnails = ItemGroup(components=(featuredByImage100,))

        # Import current example site, as anchor for the article files.
        from xierpa3.sites import doingbydesign
        # Root path where to find the article Simples wiki file for this example page.
        articleRoot = TX.module2Path(doingbydesign) + '/files/articles/' 
        adapter = DbDAdapter(articleRoot) # Preferred adapter class for articles in this site.
       
        #homePage = Page(name=self.C.TEMPLATE_INDEX,
        #    components=(mobileNavigation, header, featuredImages, featuredTexts, footer),
        #    css=self.C.URL_CSS, fonts=self.C.URL_FONTS, js=self.URL_JAVASCRIPT, 
        #    favicon=self.C.URL_FAVICON, adapter=adapter)

        homePage = Page(name=self.C.TEMPLATE_INDEX,
            components=featuredSideText,
            css=self.C.URL_CSS, fonts=self.C.URL_FONTS, js=self.URL_JAVASCRIPT, 
            favicon=self.C.URL_FAVICON, adapter=adapter)
    
        articlePage = Page(name=self.C.TEMPLATE_ARTICLE,
            components=(mobileNavigation, header, article, footer),
            css=self.C.URL_CSS, fonts=self.C.URL_FONTS, js=self.URL_JAVASCRIPT, 
            favicon=self.C.URL_FAVICON, adapter=adapter)

        thumbnailPage = Page(name=self.TEMPLATE_COURSES,
            components=(mobileNavigation, header, featuredImages, footer),
            css=self.C.URL_CSS, fonts=self.C.URL_FONTS, js=self.URL_JAVASCRIPT, 
            favicon=self.C.URL_FAVICON, adapter=adapter)

        productsPage = Page(name=self.TEMPLATE_PRODUCTS,
            components=(mobileNavigation, header, thumbnails, footer),
            css=self.C.URL_CSS, fonts=self.C.URL_FONTS, js=self.URL_JAVASCRIPT, 
            favicon=self.C.URL_FAVICON, adapter=adapter)

        categoryPage = Page(name=self.TEMPLATE_CATEGORY,
            components=(mobileNavigation, header, footer),
            css=self.C.URL_CSS, fonts=self.C.URL_FONTS, js=self.URL_JAVASCRIPT, 
            favicon=self.C.URL_FAVICON, adapter=adapter)

        # Automatic documentation about Xierpa3
        documentationPage = Page(name=self.C.TEMPLATE_DOCUMENTATION,
            components=(mobileNavigation, header, documentation, footer),
            css=self.C.URL_CSS, fonts=self.C.URL_FONTS, js=self.URL_JAVASCRIPT, 
            favicon=self.C.URL_FAVICON, adapter=adapter)

        return [homePage, articlePage, productsPage, thumbnailPage, categoryPage, documentationPage]