Exemple #1
0
def get_content_status(content):
    public_status = None
    next_status = None

    if IVersionedObject.providedBy(content):
        if content.get_public_version() is not None:
            public_status = 'published'
        elif content.get_previous_versions():
            public_status = 'closed'

        if content.get_unapproved_version() is not None:
            if content.is_approval_requested():
                next_status = "pending"
            else:
                next_status = "draft"
        elif content.get_approved_version() is not None:
            next_status = "approved"

    # XXX: define behavior for Folders
    # elif IFolder.providedBy(content):
    #     if content.is_published():
    #         status[0] = 'published'
    #     if content.is_approved():
    #         status[1] = 'approved'
    return {'status_public': public_status, 'status_next': next_status}
Exemple #2
0
 def available(self):
     return (not IVersionedObject.providedBy(self.context) and
             super(NonVersionedContentMetadataForm, self).available())