Exemplo n.º 1
0
    def get_html_doc(self):
        """
        This method provides the html framework, javascript and css)

        Add content like this:
           doc.append (navbar.get_nav_bar())
           doc.append (H1 (title))

        :param self:
        :param title:
        :return:
        """

        doc = HtmlDocument (title=self.title, stylesheet="../styles.css")
        # doc.body["onload"] = "init();"

        # <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

        doc.head.append (META(http_equiv="Content-Type",
                              content="text/html; charset=utf-8"))

        doc.addJavascript ("https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js")
        doc.addJavascript ("https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js")
        doc.addJavascript ("../script.js")
        return doc
Exemplo n.º 2
0
 def getHtmlReport(self):
     title = self.name + " report"
     javascript = ["prototype.js", "report_script.js"]
     stylesheet = 'styles.css'
     doc = HtmlDocument(title=title,
                        javascript=javascript,
                        stylesheet=stylesheet)
     doc.body.append(H1(title))
     self.render(doc.body)
     dest = "html/%s.html" % self.name
     print "dest", dest
     fp = open(dest, 'w')
     fp.write(doc.__str__())
     fp.close()
     print "wrote report to ", dest
Exemplo n.º 3
0
    def as_html(self):
        doc = HtmlDocument(title=self.title, stylesheet="styles.css")
        # doc.body["onload"] = "init();"

        # <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

        doc.head.append(
            META(http_equiv="Content-Type",
                 content="text/html; charset=utf-8"))

        doc.addJavascript(
            "https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"
        )
        doc.addJavascript(
            "https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"
        )
        doc.addJavascript("script.js")

        doc.append(self.render_tree())
        return doc
Exemplo n.º 4
0
    def makeHtmlDoc(self):
        """
		Generate the html document as string
		"""
        ## title = os.path.splitext(self.filename)[0]
        title = self.title
        doc = HtmlDocument(title=title, stylesheet="resources/styles.css")
        # doc.body["onload"] = "init();"

        # <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

        doc.head.append(
            META(http_equiv="Content-Type",
                 content="text/html; charset=utf-8"))

        doc.addJavascript("resources/prototype.js")
        doc.append(DIV(id="debug"))
        doc.append(H1(title))

        # doc.append (self.getXmlRecord());  # old school
        doc.append(self.getComparisonTable())

        # doc.append (self.html)
        return doc
Exemplo n.º 5
0
    def asHtmlDoc(self):
        if self.htmlDoc is None:
            mockup_link = Href("../reporter-mockup.html", 'to Mockup')
            reportTable = self.makeReportHtml()
            javascript = [
                'javascript/prototype.js',
                'javascript/scriptaculous-js-1.9.0/scriptaculous.js',
                'javascript/toggler.js', 'javascript/decorate_upids.js'
            ]

            self.htmlDoc = HtmlDocument(mockup_link,
                                        reportTable,
                                        title="inCites Author Reporter",
                                        stylesheet="styles.css",
                                        javascript=javascript)
        return self.htmlDoc
Exemplo n.º 6
0
def makeHtmlDoc(tally_html):
    """
    Generate the html document as string
    """
    title = 'Kuali API Results Tally'
    doc = HtmlDocument(title=title)
    # doc.body["onload"] = "init();"

    # <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    doc.head.append(
        META(http_equiv="Content-Type", content="text/html; charset=utf-8"))

    doc.addJavascript(
        "https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js")
    doc.addJavascript(
        "https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"
    )
    # doc.addJavascript ("tally-script.js")

    doc.addStylesheet(
        "//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css")
    doc.addStylesheet("tally-styles.css")

    doc.append(
        DIV("This page was generated %s" % time.asctime(time.localtime()),
            id="page-date"))

    doc.append(DIV(id="debug"))

    doc.append(navbar.get_nav_bar())

    doc.append(H1(title))

    doc.append(tally_html)

    return doc
Exemplo n.º 7
0
    def get_html_doc(self):
        """
        This method provides the html framework, javascript and css)

        Add content like this:
           doc.append (navbar.get_nav_bar())
           doc.append (H1 (title))

        :param self:
        :param title:
        :return:
        """

        doc = HtmlDocument(title=self.title, stylesheet="styles.css")
        # doc.body["onload"] = "init();"

        # <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

        doc.head.append(
            META(http_equiv="Content-Type",
                 content="text/html; charset=utf-8"))
        doc.addJavascript(
            "https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"
        )
        doc.addJavascript(
            "https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"
        )
        doc.addJavascript("script.js")

        doc.append(H1("Funding Information in OpenSky Records"))

        doc.append(
            "See ",
            A("QA Notes (GoogleDoc)",
              target="google_doc",
              href=
              "https://docs.google.com/document/d/1RIXIBJGO_PrbFnAy1r9qXTY8AjoxDI5C9rrzpO4v0z4"
              ))

        doc.append(self.site_list_html())

        return doc
    def makeHtmlDoc(self):
        """
        Generate the html document as string
        """
        data_table = self.get_data_table_html()

        title = 'Kuali Smart-Match Results'
        doc = HtmlDocument(title=title, stylesheet="styles.css")
        # doc.body["onload"] = "init();"

        # <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

        doc.head.append(
            META(http_equiv="Content-Type",
                 content="text/html; charset=utf-8"))

        doc.addJavascript(
            "https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"
        )
        doc.addJavascript(
            "https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"
        )
        doc.addJavascript("script.js")

        doc.append(
            DIV("This page was generated %s" % time.asctime(time.localtime()),
                id="page-date"))

        doc.append(DIV(id="debug"))

        doc.append(navbar.get_nav_bar())

        doc.append(H1(title))

        doc.append(
            DIV(A("About this table", href="about.html"), id="about-link"))

        doc.append(DIV(BUTTON("sort me", type="button", id="sort-button")))

        doc.append(data_table)

        return doc
Exemplo n.º 9
0
 def __init__(self, *content, **attrs):
     attrs['stylesheet'] = self.stylesheet_defaults
     attrs['javascript'] = self.javascript_defaults
     HtmlDocument.__init__(self, *content, **attrs)
Exemplo n.º 10
0
	def makeHtmlDoc (self):
		"""
		Generate the html document as string
		"""
		## title = os.path.splitext(self.filename)[0]
		title = comparisonText.getTitle(self.name)
		doc = HtmlDocument (title=title, stylesheet="resources/dup-listing-styles.css")
		# doc.body["onload"] = "init();"
		
		# <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		
		doc.head.append (META(http_equiv="Content-Type",
                          content="text/html; charset=utf-8"))
		
		doc.addJavascript ("resources/prototype.js")
		doc.addJavascript ("resources/listing-scripts.js")
		doc.append (DIV (id="debug"))
		doc.append (H1 (title))
		
		doc.append (DIV ("this page was generated %s" % time.asctime(time.localtime()), id="page-date"))
		
		blurb = comparisonText.getBlurb(self.name)
		if blurb:
			doc.append (DIV (blurb, id='blurb'))
		
		doc.append (self.makeDupGroupsHtml())
		
		return doc	
Exemplo n.º 11
0
    def makeHtmlDoc(self):
        """
		Generate the html document as string
		"""
        ## title = os.path.splitext(self.filename)[0]
        title = self.title
        doc = HtmlDocument(title=title,
                           stylesheet="../resources/record-compare-styles.css")
        # doc.body["onload"] = "init();"

        # <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

        doc.head.append(
            META(http_equiv="Content-Type",
                 content="text/html; charset=utf-8"))

        doc.addJavascript("../resources/prototype.js")
        doc.addJavascript("../resources/record-compare-scripts.js")
        if self.returnUrl:
            label = comparisonText.getTitle(self.name)
            doc.append(
                DIV(Href(self.returnUrl, "back to " + label),
                    id="return-link"))
        doc.append(H1(title))

        doc.append(
            DIV("this page was generated %s" % time.asctime(time.localtime()),
                id="page-date"))

        blurb = comparisonText.getBlurb("RecordComparison")
        if blurb:
            doc.append(DIV(blurb, id='blurb'))

        sideBySideDisplay = SideBySideDisplay(self.dupGroup)
        doc.append(sideBySideDisplay.html)

        return doc