Example #1
0
    def is_visible_admin(self, page):
        """
        Instead of just showing an on/off boolean, also indicate whether this
        page is not visible because of publishing dates or inherited status.
        """
        if not hasattr(self, "_visible_pages"):
            self._visible_pages = list(
            )  # Sanity check in case this is not already defined

        if page.parent_id and not page.parent_id in self._visible_pages:
            # parent page's invisibility is inherited
            if page.id in self._visible_pages:
                self._visible_pages.remove(page.id)
            return tree_editor.ajax_editable_boolean_cell(page,
                                                          'active',
                                                          override=False,
                                                          text=_('inherited'))

        if page.active and not page.id in self._visible_pages:
            # is active but should not be shown, so visibility limited by extension: show a "not active"
            return tree_editor.ajax_editable_boolean_cell(page,
                                                          'active',
                                                          override=False,
                                                          text=_('extensions'))

        return tree_editor.ajax_editable_boolean_cell(page, 'active')
Example #2
0
    def is_visible_admin(self, page):
        """
        Instead of just showing an on/off boolean, also indicate whether this
        page is not visible because of publishing dates or inherited status.
        """
        if not hasattr(self, "_visible_pages"):
            self._visible_pages = list() # Sanity check in case this is not already defined

        # If a page's site is not the current site, it will not be visible
        # Indicate why the page is not visible in the admin
        if hasattr(Site, 'page_set'):
            if page.site_id != django_settings.SITE_ID:
                return editor.ajax_editable_boolean_cell(page, 'active', override=False, text=_('site'))

        if page.parent_id and not page.parent_id in self._visible_pages:
            # parent page's invisibility is inherited
            if page.id in self._visible_pages:
                self._visible_pages.remove(page.id)
            return tree_editor.ajax_editable_boolean_cell(page, 'active', override=False, text=_('inherited'))

        if page.active and not page.id in self._visible_pages:
            # is active but should not be shown, so visibility limited by extension: show a "not active"
            return tree_editor.ajax_editable_boolean_cell(page, 'active', override=False, text=_('extensions'))

        return tree_editor.ajax_editable_boolean_cell(page, 'active')
Example #3
0
    def is_private_admin(self, page):
        if not hasattr(self, "_private_pages"):
            self._private_pages = list()

        if page.parent_id and page.parent_id in self._private_pages:
            if page.id in self._private_pages:
                self._private_pages.remove(page.id)
            return tree_editor.ajax_editable_boolean_cell(page, 'private', override=True, text=_('inherited'))

        if page.private and not page.id in self._private_pages:
            return tree_editor.ajax_editable_boolean_cell(page, 'private', override=True, text=_('extensions'))

        return tree_editor.ajax_editable_boolean_cell(page, 'private')
Example #4
0
    def is_visible_admin(self, page):
        """
        Instead of just showing an on/off boolean, also indicate whether this
        page is not visible because of publishing dates or inherited status.
        """
        if page.parent_id and page.parent_id not in _local.visible_pages:
            # parent page's invisibility is inherited
            if page.id in _local.visible_pages:
                _local.visible_pages.remove(page.id)
            return tree_editor.ajax_editable_boolean_cell(
                page, 'active', override=False, text=_('inherited'))

        if page.active and page.id not in _local.visible_pages:
            # is active but should not be shown, so visibility limited by
            # extension: show a "not active"
            return tree_editor.ajax_editable_boolean_cell(
                page, 'active', override=False, text=_('extensions'))

        return tree_editor.ajax_editable_boolean_cell(page, 'active')
Example #5
0
    def is_visible_admin(self, page):
        """
        Instead of just showing an on/off boolean, also indicate whether this
        page is not visible because of publishing dates or inherited status.
        """
        if not hasattr(self, "_visible_pages"):
            self._visible_pages = list()  # Sanity check in case this is not already defined

        if page.parent_id and not page.parent_id in self._visible_pages:
            # parent page's invisibility is inherited
            if page.id in self._visible_pages:
                self._visible_pages.remove(page.id)
            return tree_editor.ajax_editable_boolean_cell(page, "active", override=False, text=_("inherited"))

        if page.active and not page.id in self._visible_pages:
            # is active but should not be shown, so visibility limited by extension: show a "not active"
            return tree_editor.ajax_editable_boolean_cell(page, "active", override=False, text=_("extensions"))

        return tree_editor.ajax_editable_boolean_cell(page, "active")
Example #6
0
    def is_visible_admin(self, page):
        """
        Instead of just showing an on/off boolean, also indicate whether this
        page is not visible because of publishing dates or inherited status.
        """
        if page.parent_id and page.parent_id not in _local.visible_pages:
            # parent page's invisibility is inherited
            if page.id in _local.visible_pages:
                _local.visible_pages.remove(page.id)
            return tree_editor.ajax_editable_boolean_cell(
                page, 'active', override=False, text=_('inherited'))

        if page.active and page.id not in _local.visible_pages:
            # is active but should not be shown, so visibility limited by
            # extension: show a "not active"
            return tree_editor.ajax_editable_boolean_cell(
                page, 'active', override=False, text=_('extensions'))

        return tree_editor.ajax_editable_boolean_cell(page, 'active')