Example #1
0
    def doctypes(self):
        """Document type names."""

        if not hasattr(self, "_doctypes"):
            self._doctypes = []
            for doctype in Doctype.list_doc_types(self.session):
                if doctype not in self.SKIP:
                    self._doctypes.append(doctype)
        return self._doctypes
Example #2
0
    def typenames(self):
        """Document type names for the form's picklist."""

        if not hasattr(self, "_typenames"):
            self._typenames = []
            for name in Doctype.list_doc_types(self.session):
                if name:
                    self._typenames.append(name)
        return self._typenames
Example #3
0
    def populate_form(self, page):
        """Add doctype editing links and some custom styling to the page."""

        page.body.set("class", "admin-menu")
        fieldset = page.fieldset("Existing Document Types (click to edit)")
        fieldset.set("class", "flexlinks")
        ul = page.B.UL()
        script = self.EDIT_DOCTYPE
        for doctype in Doctype.list_doc_types(self.session):
            link = page.menu_link(script, doctype, doctype=doctype)
            ul.append(page.B.LI(link))
        fieldset.append(ul)
        page.form.append(fieldset)
        page.add_css(".flexlinks ul { height: 125px }")
Example #4
0
    def doctypes(self):
        """Sequence of strings for the document type picklists."""

        if not hasattr(self, "_doctypes"):
            self._doctypes = Doctype.list_doc_types(self.session)
        return self._doctypes
Example #5
0
 def doctypes(self):
     return sorted(Doctype.list_doc_types(self.session))
Example #6
0
    def doctypes(self):
        """Valid value strings for available CDR document types."""

        if not hasattr(self, "_doctypes"):
            self._doctypes = Doctype.list_doc_types(self.session)
        return self._doctypes
Example #7
0
    def doctypes(self):
        """Sorted names of all the active document types."""

        if not hasattr(self, "_doctypes"):
            self._doctypes = Doctype.list_doc_types(self.session)
        return self._doctypes