def blank_slate_content(self):

        project = self.in_project()
        links = []

        if project:
            links.append(
                '<a class="project_home" href="%s">%s</a>' % (
                    project.absolute_url(), project.Title())
                )

        referer = None
        if self.request.form.get('created_from'):
            referer = self.request.form['created_from']
            try:
                referer = IOpenPage(project[referer])
            except (KeyError, TypeError):
                referer = None

        if referer:
            links.append(
                '<a class="created_from" rel="prev" href="%s">%s</a>' % (
                    referer.absolute_url(), referer.Title())
                )

        return "<div class='oc-boxy'>"  + ' | '.join(links) + "</div><hr />" + "<p>Please enter some text for your page</p>"
    def blank_slate_content(self):

        project = self.in_project()
        links = []

        if project:
            links.append('<a class="project_home" href="%s">%s</a>' %
                         (project.absolute_url(), project.Title()))

        referer = None
        if self.request.form.get('created_from'):
            referer = self.request.form['created_from']
            try:
                referer = IOpenPage(project[referer])
            except (KeyError, TypeError):
                referer = None

        if referer:
            links.append(
                '<a class="created_from" rel="prev" href="%s">%s</a>' %
                (referer.absolute_url(), referer.Title()))

        return "<div class='oc-boxy'>" + ' | '.join(
            links
        ) + "</div><hr />" + "<p>Please enter some text for your page</p>"
Beispiel #3
0
def cache_history(page, pr):
    if not IOpenPage.providedBy(page):
        return False
    
    try:
        history = pr.getHistory(page, countPurged=False)
    except ArchivistRetrieveError, e:
        print e
        return False
Beispiel #4
0
def openpage_provided(viewlet):
    """return True if the viewlet context is a wiki page"""
    return IOpenPage.providedBy(viewlet.context)