Search in sources :

Example 1 with Rel

use of org.structr.api.util.html.attr.Rel in project structr by structr.

the class ConfigServlet method setupDocument.

// ----- private methods -----
private Tag setupDocument(final HttpServletRequest request, final Document doc) {
    final Tag head = doc.block("head");
    head.block("title").text(TITLE);
    head.empty("meta").attr(new Attr("http-equiv", "Content-Type"), new Attr("content", "text/html;charset=utf-8"));
    head.empty("meta").attr(new Name("viewport"), new Attr("content", "width=1024, user-scalable=yes"));
    head.empty("link").attr(new Rel("stylesheet"), new Href("/structr/css/lib/jquery-ui-1.10.3.custom.min.css"));
    head.empty("link").attr(new Rel("stylesheet"), new Href("/structr/css/main.css"));
    head.empty("link").attr(new Rel("stylesheet"), new Href("/structr/css/config.css"));
    head.empty("link").attr(new Rel("icon"), new Href("favicon.ico"), new Type("image/x-icon"));
    head.block("script").attr(new Src("/structr/js/lib/jquery-1.11.1.min.js"));
    head.block("script").attr(new Src("/structr/js/lib/jquery-ui-1.11.0.custom.min.js"));
    head.block("script").attr(new Src("/structr/js/icons.js"));
    head.block("script").attr(new Src("/structr/js/config.js"));
    final Tag body = doc.block("body");
    final Tag header = body.block("div").id("header");
    header.block("i").css("logo sprite sprite-structr-logo");
    final Tag links = header.block("div").id("menu").css("menu").block("ul");
    if (isAuthenticated(request)) {
        final Tag form = links.block("li").block("form").attr(new Attr("action", ConfigUrl), new Attr("method", "post"), new Style("display: none")).id("logout-form");
        form.empty("input").attr(new Type("hidden"), new Name("action"), new Value("logout"));
        links.block("a").text("Logout").attr(new Style("cursor: pointer"), new OnClick("$('#logout-form').submit();"));
    }
    return body;
}
Also used : Rel(org.structr.api.util.html.attr.Rel) Href(org.structr.api.util.html.attr.Href) Tag(org.structr.api.util.html.Tag) Attr(org.structr.api.util.html.Attr)

Aggregations

Attr (org.structr.api.util.html.Attr)1 Tag (org.structr.api.util.html.Tag)1 Href (org.structr.api.util.html.attr.Href)1 Rel (org.structr.api.util.html.attr.Rel)1