示例#1
0
    def __call__ (self):
        # Find the DMG file
        dmg_refs = Downloads.get_latest_macosx_dmg()

        # No MacOS package found
        if not dmg_refs:
            content = CTK.Container()
            content += CTK.RawHTML ("<h3>%s</h3>" %(_("Could not find the MacOS X package")))
            content += CTK.RawHTML ("<p>%s</p>" %(_("It seems that the MacOS X package for the latest version has not been compiled yet.")))
            content += CTK.RawHTML ("<p>%s</p>" %(_("Due the circunstances, we encourage you to download the source code and compile it by hand.")))
            return CTK.HTTP_Cacheable (60, body = content.Render().toStr())

        dmg_local, dmg_web = dmg_refs
        dmg_url = "http://www.cherokee-project.com%s"%(dmg_web)

        if os.path.exists (dmg_local):
            mbs = os.path.getsize (dmg_local) / (1024**2)
        else:
            mbs = 0
        ver = re.findall (r'(\d+\.\d+\.\d+)', dmg_web)[0]

        download_button = CTK.Button ('Get Cherokee %s DMG'%(ver)) # ??? %sMb'%(mbs))
        download_button.bind ('click', CTK.DruidContent__JS_to_goto (download_button.id, URL_MACOSX_2))

        content = CTK.Container()
        content += CTK.RawHTML ('<h3>Binary Package</h3>')
        content += CTK.RawHTML ('<p>%s</p>'%(_("A binary package for MacOS X (Intel) is available for download: %sMb"%(mbs))))
        content += download_button

        return CTK.HTTP_Cacheable (60, body=content.Render().toStr())
示例#2
0
    def __call__ (self):
        content = CTK.Container()
        content += CTK.RawHTML ("<h3>%s</h3>" %(_("The Windows port is an ongoing effort...")))
        content += CTK.RawHTML ("<p>%s</p>" %(_('Even though the source code of the Cherokee Web Server can be compiled on Windows (<i>with the mingw + msys</i>), it is not stable enough to be considered production ready.')))
        content += CTK.RawHTML ("<p>%s</p>" %(_('Developers are welcome to join the effort of finishing the port of Cherokee to Windows. Do not hesitate to <a href="http://git.cherokee-project.com/" target="_blank">join us</a>!')))

        return CTK.HTTP_Cacheable (60, body=content.Render().toStr())
示例#3
0
    def __call__ (self):
        tarball_refs = Downloads.get_latest_tarball()
        tar_local, tar_web = tarball_refs

        # Automatic
        content = CTK.Container()
        content += CTK.RawHTML ("<h3>%s</h3>" %(_("Option 1: Automatic installation")))

        box  = CTK.Box()
        box += CTK.RawHTML ('<p>%s</p>' %(_('Open a terminal and enter:')))
        box += CTK.RawHTML ('<pre class="terminal">wget http://cherokee-project.com/install && python install</pre>')
        box += CTK.RawHTML ('<p>%s</p>' %(_('or')))
        box += CTK.RawHTML ('<pre class="terminal">curl -LO http://cherokee-project.com/install && python install</pre>')
        box += CTK.RawHTML ('<p>%s</p>' %(_('This will download and install Cherokee under /opt/cherokee')))
        content += box

        # By hand
        content += CTK.RawHTML ("<h3>%s</h2>" %(_("Option 2: Compile it by hand")))

        sources  = CTK.Box()
        sources += CTK.RawHTML ('%s '%(_("Download")))
        sources += CTK.Link (tar_web, CTK.RawHTML (_("latest source code package")))
        sources += CTK.RawHTML (', and install it by hand doing the <i>./configure, make, make install</i> dance.')
        sources += CTK.RawHTML ('<pre class="terminal">configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc<br/>make && sudo make install</pre>')
        sources += CTK.RawHTML ('Older releases are also available at our <a href="/download/">Downloads archive</a>.')

        content += sources

        return CTK.HTTP_Cacheable (60, body=content.Render().toStr())
示例#4
0
    def __call__ (self):
        title = "Screencasts"

        page = Page.Page_Menu_Side (title=title)
        page += CTK.RawHTML ("<h1>%s</h1>"%(title))

        # Sidebar
        page.sidebar += Menu()

        # Redirect the hashtag
        page += CTK.RawHTML (js=JS)

        # Content
        video = None
        tmp = re.findall (r'^%s.*/(.*)$'%(URL_BASE), CTK.request.url, re.I)
        if tmp:
            for v in VIDEOS:
                if v[0] == tmp[0].lower():
                    video = v
                    break
        if not video:
            video = VIDEOS[0]

        box  = CTK.Box ()
        box += CTK.RawHTML ('<h2>%s</h2>' %(video[2]))
        box += CTK.RawHTML (EMBED_VIDEO_HTML%({'num': video[1]}))
        box += CTK.RawHTML ('</br><p><b>%s</b></p>' %(DEPRECATED))

        page += box

        return CTK.HTTP_Cacheable (60, body=page.Render())
示例#5
0
    def __call__ (self):
        page = Page.Page_Menu()
        page.banner += Top_Banner()

        main_box  = CTK.Box ({'id': 'index-main'})
        main_box += Highlights()
        page     += main_box

        side_box  = CTK.Box ({'id': 'index-sidebox'})
        side_box += Sidebox()
        page     += side_box

        page += CTK.Box({'class': 'clr'})

        bar3  = CTK.Box ({'class': 'bar3'})
        bar3 += Twitter.Latest_Tweets()
        page += bar3

        bar3  = CTK.Box ({'class': 'bar3'})
        bar3 += Commits.Latest_GIT_Commits()
        page += bar3

        bar3  = CTK.Box ({'class': 'bar3'})
        bar3 += MailingList.Latest_Mailing_List()
        page += bar3

        page += CTK.Box({'class': 'clr'})

        return CTK.HTTP_Cacheable (10, body=page.Render())
示例#6
0
文件: PageForum.py 项目: mdavid/web
    def __call__(self):
        title = "Forums"

        page = Page.Page_Menu_Side(title=title)
        page += CTK.RawHTML("<h1>%s</h1>" % (title))
        page += CTK.RawHTML(FORUM_EMBEDDABLE_HTML)

        return CTK.HTTP_Cacheable(60, body=page.Render())
示例#7
0
class Download_Linux:

	# Ubuntu
        box = CTK.Box({'class': 'platform', 'id': 'platform-ubuntu'})
        box += CTK.RawHTML ('<h3>Ubuntu</h3>')
        box += CTK.RawHTML ('Open a terminal and enter:')
        box += CTK.RawHTML ('<pre class="terminal">sudo add-apt-repository ppa:cherokee-webserver/ppa</pre>')
        box += CTK.RawHTML ('After that, you should tell your system to pull down the latest list of software from each archive it knows about, including the PPA you just added:')
        box += CTK.RawHTML ('<pre class="terminal">sudo apt-get update</pre>')
        box += CTK.RawHTML ("Now you're ready to install Cherokee from the PPA:")
        box += CTK.RawHTML ('<pre class="terminal">sudo apt-get install cherokee cherokee-admin</pre>')
        content += box

        # Debian
        box = CTK.Box({'class': 'platform', 'id': 'platform-debian'})
        box += CTK.RawHTML ('<h3>Debian</h3>')
        box += CTK.RawHTML ('Install Cherokee from the apt repository')
        box += CTK.RawHTML ('<pre class="terminal">apt-get install cherokee cherokee-admin</pre>')
        details = CTK.Box({'class': 'platform-details'})
        details += CTK.RawHTML ('%s '%(_('Please, check the documentation for further')))
        details += CTK.LinkWindow (DOC_APTGET, CTK.RawHTML(_('details')))
        details += CTK.RawHTML ('.')
        box += details
        content += box

        #EPEL
        box = CTK.Box({'class': 'platform', 'id': 'platform-epel'})
        box += CTK.RawHTML ('<h3>Red Hat Enterprise Linux (RHEL)/CentOS</h3>')
        box += CTK.RawHTML ('Install Cherokee from the EPEL (Extra Packages for Enterprise Linux) repository')
        box += CTK.RawHTML ('<pre class="terminal">yum install cherokee</pre>')
        details = CTK.Box({'class': 'platform-details'})
        details += CTK.RawHTML ('Check the ')
        details += CTK.LinkWindow (DOC_EPEL_URL, CTK.RawHTML('EPEL documentation'))
        details += CTK.RawHTML (' for details on making EPEL repositories available on your system.')
        box += details
        content += box

        #Fedora
        box = CTK.Box({'class': 'platform', 'id': 'platform-fedora'})
        box += CTK.RawHTML ('<h3>Fedora</h3>')
        box += CTK.RawHTML ('Install Cherokee from Fedora\'s Yum repository')
        box += CTK.RawHTML ('<pre class="terminal">yum install cherokee</pre>')
        details = CTK.Box({'class': 'platform-details'})
        details += CTK.RawHTML ('See Fedora\'s ')
        details += CTK.LinkWindow (DOC_FEDORA_PACKAGE_URL, CTK.RawHTML('package information'))
        details += CTK.RawHTML (' for later versions than what\'s included with the latest distribution.')
        box += details
        content += box

        return CTK.HTTP_Cacheable (60, body=content.Render().toStr())
示例#8
0
    def __call__ (self):
        content = CTK.Container()

        # FreeBSD
        box = CTK.Box({'class': 'platform', 'id': 'platform-freebsd'})
        box += CTK.RawHTML ('<h3>FreeBSD</h3>')
        box += CTK.RawHTML ('Open a terminal and enter:')
        box += CTK.RawHTML ('<pre class="terminal">sudo cd /usr/ports/www/cherokee && make install clean</pre>')
        box += CTK.RawHTML ('If using pkgng:')
        box += CTK.RawHTML ('<pre class="terminal">sudo pkg install cherokee</pre>')
        box += CTK.RawHTML ("If you just want the package:")
        box += CTK.RawHTML ('<pre class="terminal">sudo pkg_add -r cherokee (Will soon be defuncted) </pre>')
        content += box

        return CTK.HTTP_Cacheable (60, body=content.Render().toStr())
示例#9
0
    def __call__(self):
        title = "License"

        page = Page.Page_Menu(title=title)
        page += CTK.RawHTML("<h1 class=\"single\">%s</h1>" % (title))

        page += CTK.Image({
            'src': '/static/images/osi-certified-120x100.gif',
            'class': 'license-img'
        })
        page += CTK.RawHTML('<p>%s</p>' % (LICENSE_P1))
        page += CTK.RawHTML('<p>%s</p>' % (LICENSE_P2))
        page += CTK.Box({'class': 'gpl-text'}, CTK.RawHTML(GPL_v2))

        return CTK.HTTP_Cacheable(60, body=page.Render())
示例#10
0
    def __call__(self):
        title = "Marketing and Branding"

        page = Page.Page_Menu_Side(title=title)
        page += CTK.RawHTML("<h1>%s</h1>" % (title))

        # Logos
        page += CTK.RawHTML('<h2>Logos</h2>')
        page += Logo("cherokee", ["8000 x 3109px, 460Kb", "Vectorial, 27Kb"])
        page += Logo("cherokee-border",
                     ["8000 x 5333px, 721Kb", "Vectorial, 102Kb"])

        # Clarification
        page += Clarification()

        return CTK.HTTP_Cacheable(60, body=page.Render())
示例#11
0
    def __call__(self):
        # Handle request
        if CTK.request.url in ('/doc', '/doc/', '/doc/index',
                               '/doc/index.html'):
            request = "/doc/index.html"
            sidebar = False
        else:
            request = CTK.request.url
            sidebar = True

        tmp = re.findall(r'^%s/(.+\.html)' % (URL_BASE), request)
        if not tmp:
            return CTK.HTTP_Response(404)
        help_file = tmp[0]

        # Title
        title = help_file.replace('_', ' ').replace('.html',
                                                    '') + ": Documentation"
        page = Page.Page_Menu_Side(title=title)

        page += CTK.RawHTML("<h1>Documentation</h1>")

        # Security check
        local_file = os.path.abspath(os.path.join(config.DOC_LOCAL, help_file))
        if not local_file.startswith(config.DOC_LOCAL):
            page += CTK.RawHTML('no way')
            return page.Render()

        if not os.path.exists(local_file):
            return CTK.HTTP_Response(404)

        # Read it
        html = open(local_file, 'r').read()
        tmp = re.findall('<body.*?>(.*?)</body>', html,
                         re.IGNORECASE | re.DOTALL)
        if not tmp:
            page += CTK.RawHTML('no body')
            return page.Render()

        body = tmp[0]

        # Layout
        if sidebar:
            page.sidebar += Index()

        page += CTK.RawHTML(body)
        return CTK.HTTP_Cacheable(60, body=page.Render())
示例#12
0
    def __call__ (self):
        title = "Contributing with the Cherokee Project"

        page = Page.Page_Menu_Side (title=title)
        page += CTK.RawHTML ("<h1>%s</h1>"%(title))

        page.sidebar += Ohloh.Cocomo()
        page.sidebar += Ohloh.Languages()

        # Intro
        page += CTK.RawHTML ('<p>%s</p>' %(INTRO_P1))
        page += CTK.RawHTML ('<p>%s</p>' %(INTRO_P2))

        # Ways to contribute
        l = CTK.List()
        l += self.ListEntry ("Helping Users", [HELP_P1])
        l += self.ListEntry ("Localization",  [L10N_P1])
        l += self.ListEntry ("Coding",        [CODE_P1])
        l += self.ListEntry ("Marketing",     [MRKT_P1, MRKT_P2])
        page += l

        # Contributor Agreement
        page += CTK.RawHTML ('<h2>Cherokee Contributor Agreement</h2>')
        page += CTK.RawHTML ('<p>%s</p>' %(DEV_P1))
        page += CTK.RawHTML ('<p>%s</p>' %(DEV_P2))
        page += CTK.RawHTML ('<p>%s</p>' %(DEV_P3))
        page += CTK.RawHTML ('<p>%s</p>' %(DEV_P4))
        page += CTK.RawHTML ('<p>%s</p>' %(DEV_P5))

        l = CTK.List()
        l += self.ListEntry ("Download the Document", [DEV_L1])
        l += self.ListEntry ("Sign it",               [DEV_L2])
        l += self.ListEntry ("Submit it",             [DEV_L3])
        page += l

        # Bug Reports
        page += CTK.RawHTML ('<h2>Report of Issues</h2>')
        page += CTK.RawHTML ('<p>%s</p>' %(BUGS_P1))
        page += CTK.RawHTML ('<p>%s</p>' %(BUGS_P2))


        return CTK.HTTP_Cacheable (60, body=page.Render())
示例#13
0
    def __call__(self):
        title = "Community"

        page = Page.Page_Menu_Side(title=title)
        page += CTK.RawHTML("<h1>%s</h1>" % (title))

        # Proud Cherokee Users List
        page.sidebar += CTK.RawHTML('<h3>Proud Cherokee Users</h3>')
        page.sidebar += ProudList.Add_New_Domain()
        page.sidebar += ProudList.DomainList()

        # Content
        box = CTK.Box({'class': 'community-lists'})
        box += CTK.RawHTML('<h2>Mailing Lists / Forums</h2>')
        box += CTK.RawHTML('<p>%s</p>' % (MAILING_P1))
        box += CTK.RawHTML('<p>%s</p>' % (MAILING_P2))
        page += box

        box = CTK.Box({'class': 'community-chat'})
        box += CTK.RawHTML('<h2>IRC / Chat</h2>')
        box += CTK.RawHTML('<p>%s</p>' % (IRC_P1))
        page += box

        box = CTK.Box({'class': 'community-social'})
        box += CTK.RawHTML('<h2>Social Networks</h2>')
        l = CTK.List()
        l += CTK.LinkWindow("http://www.github.com/cherokee",
                            CTK.RawHTML("Github"), {'class': 'github-link'})
        l += CTK.LinkWindow("http://www.twitter.com/webserver",
                            CTK.RawHTML("Twitter"), {'class': 'twitter-link'})
        l += CTK.LinkWindow(
            "http://www.linkedin.com/groups/Cherokee-Web-Server-1819726",
            CTK.RawHTML("LinkedIn"), {'class': 'linkedin-link'})
        l += CTK.LinkWindow("http://www.facebook.com/cherokee.project",
                            CTK.RawHTML("Facebook"), {'class': 'fb-link'})
        box += CTK.RawHTML('<p>%s</p>' % (SOCIAL_P1))
        box += l
        page += box

        return CTK.HTTP_Cacheable(60, body=page.Render())
示例#14
0
    def __call__ (self):
        content = CTK.Box({'id': 'macosx-steps'})
        content += CTK.RawHTML ('<h3>MacOS X (Intel)</h3>')

        # Find the DMG file
        dmg_refs = Downloads.get_latest_macosx_dmg()
        dmg_local, dmg_web = dmg_refs
        dmg_url = "http://www.cherokee-project.com%s"%(dmg_web)
        content += CTK.RawHTML (js='setTimeout(function(){ %s }, 2000);' %(CTK.JS.GotoURL(dmg_url)))

        # Step 1
        box = CTK.Box({'class': 'macosx-step'})
        box += CTK.Image({'src': "/static/images/dmg1.png"})
        box += CTK.RawHTML ('<strong>%s</strong>' %(_("Step 1")))
        box += CTK.RawHTML ('<span>%s</span>' %(_("Save and Open the Cherokee installer")))
        content += box

        # Step 2
        box = CTK.Box({'class': 'macosx-step'})
        box += CTK.Image({'src': "/static/images/dmg2.png"})
        box += CTK.RawHTML ('<strong>%s</strong>' %(_("Step 2")))
        box += CTK.RawHTML ('<span>%s</span>' %(_("Install the package")))
        content += box

        # Step 3
        box = CTK.Box({'class': 'macosx-step'})
        box += CTK.Image({'src': "/static/images/dmg3.png"})
        box += CTK.RawHTML ('<strong>%s</strong>' %(_("Step 3")))
        box += CTK.RawHTML ('<span>%s</span>' %(_("Drag Cherokee Admin to your application folder")))
        content += box

        # Step 4
        box = CTK.Box({'class': 'macosx-step'})
        box += CTK.Image({'src': "/static/images/dmg4.png"})
        box += CTK.RawHTML ('<strong>%s</strong>' %(_("Step 4")))
        box += CTK.RawHTML ('<span>%s</span>' %(_("Open Cherokee Admin")))
        content += box

        return CTK.HTTP_Cacheable (60, body=content.Render().toStr())
示例#15
0
    def __call__(self):
        title = _("Web Applications Distribution")

        # Intro
        page = Page.Page_Menu_Side(title=title)
        page += CTK.RawHTML("<h1>%s</h1>" % (title))
        page += CTK.RawHTML("<p>%s</p>" % (P1))
        page += CTK.RawHTML("<p>%s</p>" % (P2))

        # Apps
        page.sidebar += CTK.RawHTML("<h2>Apps</h2>")
        page.sidebar += Distro.Apps_List()

        # Join
        page += CTK.RawHTML("<h2>Join the Maintainers Team!</h2>")
        page += CTK.RawHTML("<p>%s</p>" % (JOIN_P1))
        page += CTK.RawHTML("<p>%s</p>" % (JOIN_P2))

        l = CTK.List()
        page += l
        for k in JOIN_L1:
            l += CTK.RawHTML("<b>%s</b>: %s" % (k, JOIN_L1[k]))

        page += CTK.RawHTML("<p>%s</p>" % (JOIN_P3))

        # Maintainers
        page += CTK.RawHTML("<h2>Maintainer</h2>")
        page += CTK.RawHTML("<p>%s</p>" % (MAINTAINERS_P1))
        page += Distro.Authors_List()

        if Distro.get_orphans():
            page += CTK.RawHTML("<h2>Orphan Packages</h2>")
            page += CTK.RawHTML("<p>%s</p>" % (ORPHANS_P1))
            page += Distro.Orphans_List()

        return CTK.HTTP_Cacheable(60, body=page.Render())
示例#16
0
 def __call__ (self):
     page = Page.Page_Menu()
     page += CTK.RawHTML(open(self.FILE,'r').read())
     return CTK.HTTP_Cacheable (60, body=page.Render())