示例#1
0
    def columns(self):
        if not is_bumblebee_feature_enabled() or not is_bumblebeeable(
                self.context):
            self._columns = self.remove_column('preview')
            self._columns = self.remove_column('save_pdf_under_link')

        return self._columns
示例#2
0
    def columns(self):
        """Disable pdf_preview link in deployments without pdfconverter.
        """
        if not is_bumblebee_feature_enabled() or not is_bumblebeeable(self.context):
            self._columns = self.remove_column('preview')

        if not is_pdfconverter_enabled():
            self._columns = self.remove_column('pdf_preview_link')

        return self._columns
示例#3
0
    def columns(self):
        """Disable pdf_preview link in deployments without pdfconverter.
        """
        if not is_bumblebee_feature_enabled() or not is_bumblebeeable(
                self.context):
            self._columns = self.remove_column('preview')

        if not is_pdfconverter_enabled():
            self._columns = self.remove_column('pdf_preview_link')

        return self._columns
示例#4
0
    def calculate_showroom_configuration(self, brains, b_start):
        """Calculates the number of documents from a list of brains
        and the offset depending on the batch-start position.
        """
        offset = 0
        number_of_documents = 0

        for i, brain in enumerate(brains):
            if not is_bumblebeeable(brain):
                continue

            if b_start > i:
                # increment the offset as long as we are
                # behind the batch start position
                offset += 1

            number_of_documents += 1

        self.offset = offset
        self.number_of_documents = number_of_documents
示例#5
0
    def calculate_showroom_configuration(self, brains, b_start):
        """Calculates the number of documents from a list of brains
        and the offset depending on the batch-start position.
        """
        offset = 0
        number_of_documents = 0

        for i, brain in enumerate(brains):
            if not is_bumblebeeable(brain):
                continue

            if b_start > i:
                # increment the offset as long as we are
                # behind the batch start position
                offset += 1

            number_of_documents += 1

        self.offset = offset
        self.number_of_documents = number_of_documents
    def test_mails_are_bumblebeeable(self):
        mail = create(Builder('mail'))
        brain = obj2brain(mail)

        self.assertTrue(is_bumblebeeable(brain))
    def test_documents_are_bumblebeeable(self):
        document = create(Builder('document').with_dummy_content())
        brain = obj2brain(document)

        self.assertTrue(is_bumblebeeable(brain))
 def is_bumblebeeable(self):
     if not hasattr(self, '_is_bumblebeeable'):
         self._is_bumblebeeable = (is_bumblebee_feature_enabled()
                                   and is_bumblebeeable(self))
     return self._is_bumblebeeable
示例#9
0
 def tooltip_view(self):
     if is_bumblebeeable(self):
         return 'tooltip'
示例#10
0
    def is_bumblebeeable(self):
        if not hasattr(self, '_is_bumblebeeable'):
            self._is_bumblebeeable = (
                is_bumblebee_feature_enabled() and is_bumblebeeable(self))

        return self._is_bumblebeeable
示例#11
0
    def test_repo_roots_are_not_bumblebeeable(self):
        repository_root = create(Builder('repository_root'))
        brain = obj2brain(repository_root)

        self.assertFalse(is_bumblebeeable(brain))
示例#12
0
    def test_dossiers_are_not_bumblebeeable(self):
        dossier = create(Builder('dossier'))
        brain = obj2brain(dossier)

        self.assertFalse(is_bumblebeeable(brain))
示例#13
0
    def test_mails_are_bumblebeeable(self):
        mail = create(Builder('mail'))
        brain = obj2brain(mail)

        self.assertTrue(is_bumblebeeable(brain))
示例#14
0
    def test_documents_are_bumblebeeable(self):
        document = create(Builder('document').with_dummy_content())
        brain = obj2brain(document)

        self.assertTrue(is_bumblebeeable(brain))
示例#15
0
    def test_dossiers_are_not_bumblebeeable(self):
        dossier = create(Builder('dossier'))
        brain = obj2brain(dossier)

        self.assertFalse(is_bumblebeeable(brain))
示例#16
0
    def test_repo_roots_are_not_bumblebeeable(self):
        repository_root = create(Builder('repository_root'))
        brain = obj2brain(repository_root)

        self.assertFalse(is_bumblebeeable(brain))
示例#17
0
    def columns(self):
        if not is_bumblebee_feature_enabled() or not is_bumblebeeable(self.context):
            self._columns = self.remove_column('preview')
            self._columns = self.remove_column('save_pdf_under_link')

        return self._columns
示例#18
0
 def tooltip_view(self):
     if is_bumblebeeable(self):
         return 'tooltip'
示例#19
0
 def is_bumblebeeable(self):
     if not hasattr(self, "_is_bumblebeeable"):
         self._is_bumblebeeable = is_bumblebee_feature_enabled() and is_bumblebeeable(self)
     return self._is_bumblebeeable