Beispiel #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
    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
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #9
0
 def tooltip_view(self):
     if is_bumblebeeable(self):
         return 'tooltip'
    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
Beispiel #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))
Beispiel #12
0
    def test_dossiers_are_not_bumblebeeable(self):
        dossier = create(Builder('dossier'))
        brain = obj2brain(dossier)

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

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

        self.assertTrue(is_bumblebeeable(brain))
    def test_dossiers_are_not_bumblebeeable(self):
        dossier = create(Builder('dossier'))
        brain = obj2brain(dossier)

        self.assertFalse(is_bumblebeeable(brain))
    def test_repo_roots_are_not_bumblebeeable(self):
        repository_root = create(Builder('repository_root'))
        brain = obj2brain(repository_root)

        self.assertFalse(is_bumblebeeable(brain))
    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
Beispiel #18
0
 def tooltip_view(self):
     if is_bumblebeeable(self):
         return 'tooltip'
 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