diff --git a/lib/pyulib/src/ulib/web/pages.py b/lib/pyulib/src/ulib/web/pages.py index 2ad6dab..0c93c09 100644 --- a/lib/pyulib/src/ulib/web/pages.py +++ b/lib/pyulib/src/ulib/web/pages.py @@ -44,20 +44,50 @@ def jscss(href, min=False): BPSUPPL_CSS = "bpsuppl.css" def blueprintcss(prefix=None, suppl=True): if prefix is None: - prefix = "" - bpsuppl = BPSUPPL_CSS + prefix = "/static/blueprint/" + bpsuppl = "/static/%s" % BPSUPPL_CSS else: pprefix = path.split(prefix)[0] bpsuppl = path.join(pprefix, BPSUPPL_CSS) if not prefix.endswith("/"): prefix = prefix + "/" + lines = [ + css("%sscreen.css" % prefix, "screen, projection"), + css("%sprint.css" % prefix, "print"), + u"", + ] + if suppl: + lines.extend([ + css(bpsuppl), + ]) + return u"\n".join(lines) + +def bootstrapcss(prefix=None, icons=True, charset="utf-8"): + if prefix is None: prefix = "/static/bootstrap/" + elif not prefix.endswith("/"): prefix = prefix + "/" + lines = [ + '' % charset, + '', + '', + ] + if icons: + lines.extend([ + '' % prefix, + '' % prefix, + ]) + lines.extend([ + css("%sbootstrap/css/bootstrap.min.css" % prefix), + css("%sbslocal.css" % prefix), + js("%sjquery.min.js" % prefix), + js("%sbootstrap/js/bootstrap.min.js" % prefix), + u"", + ]) + return u"\n".join(lines) - return u"\n".join([css("%sscreen.css" % prefix, "screen, projection"), - css("%sprint.css" % prefix, "print"), - u"", - css(bpsuppl), - ]) DEFAULT_TEMPLATE_GLOBALS = {'_u': _u, 'checked': checked, 'selected': selected, @@ -66,6 +96,7 @@ DEFAULT_TEMPLATE_GLOBALS = {'_u': _u, 'js': js, 'jscss': jscss, 'blueprintcss': blueprintcss, + 'bootstrapcss': bootstrapcss, 'plural': plural, } diff --git a/lib/ulib/templates/webpyapp/static/bootstrap/template.html b/lib/ulib/templates/webpyapp/static/bootstrap/T.html similarity index 94% rename from lib/ulib/templates/webpyapp/static/bootstrap/template.html rename to lib/ulib/templates/webpyapp/static/bootstrap/T.html index b189d21..ea6f71b 100644 --- a/lib/ulib/templates/webpyapp/static/bootstrap/template.html +++ b/lib/ulib/templates/webpyapp/static/bootstrap/T.html @@ -8,6 +8,7 @@ + + +$:bootstrapcss() +Template + + +
+

Template

+
+ + diff --git a/lib/ulib/templates/webpyapp/templates/index.html b/lib/ulib/templates/webpyapp/templates/index.html index bb1ea7c..97ce608 100644 --- a/lib/ulib/templates/webpyapp/templates/index.html +++ b/lib/ulib/templates/webpyapp/templates/index.html @@ -2,18 +2,7 @@ $def with () - - - - - - - - - +$:bootstrapcss() index