summaryrefslogtreecommitdiffstats
path: root/app/template-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-12-31 00:34:48 +0000
committerTed Trask <ttrask01@yahoo.com>2013-12-31 00:34:48 +0000
commit856015e04d5da57b651301d061585510c78c1923 (patch)
treefb2f381be706ef6943573be0860a8d3827d613b4 /app/template-html.lsp
parent0f3a2a14db8740ccc987ac623ae68f48c154e2a3 (diff)
downloadacf-core-856015e04d5da57b651301d061585510c78c1923.tar.bz2
acf-core-856015e04d5da57b651301d061585510c78c1923.tar.xz
Switch HTML template to HTML5 and cleanup code by removing extra divs
Removed div class leader, tailer, and mute Removed div id logo and postnav
Diffstat (limited to 'app/template-html.lsp')
-rw-r--r--app/template-html.lsp253
1 files changed, 107 insertions, 146 deletions
diff --git a/app/template-html.lsp b/app/template-html.lsp
index 9277736..92550a4 100644
--- a/app/template-html.lsp
+++ b/app/template-html.lsp
@@ -2,177 +2,138 @@
html=require("acf.html") %>
Status: 200 OK
Content-Type: text/html
-<% if (session.id) then
+<%
+if (session.id) then
io.write( html.cookie.set("sessionid", session.id) )
- else
+else
io.write (html.cookie.unset("sessionid"))
- end
+end
%>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<%
local hostname = ""
-
-if pageinfo.skinned ~= "false" then
-
-if viewlibrary and viewlibrary.dispatch_component then
+if pageinfo.skinned ~= "false" and viewlibrary and viewlibrary.dispatch_component then
local result = viewlibrary.dispatch_component("alpine-baselayout/hostname/read", nil, true)
if result and result.value then
hostname = result.value
end
end
%>
-<title><%= html.html_escape(hostname .. " - " .. pageinfo.controller .. "->" .. pageinfo.action) %></title>
-<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.staticdir) %>/reset.css">
-<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.skin.."/"..posix.basename(pageinfo.skin)..".css") %>">
-<!--[if IE]>
-<link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.skin.."/"..posix.basename(pageinfo.skin).."-ie.css") %>">
-<![endif]-->
-<script type="text/javascript">
- if (typeof jQuery == 'undefined') {
- document.write('<script type="text/javascript" src="<%= html.html_escape(pageinfo.wwwprefix) %>/js/jquery-latest.js"><\/script>');
- }
-</script>
-<script type="text/javascript" src="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.skin.."/"..posix.basename(pageinfo.skin)..".js") %>"></script>
-<script type="text/javascript">
- $(function(){
- $(":input:not(:submit):enabled:not([readonly]):first").focus();
- });
-</script>
-<% end -- pageinfo.skinned %>
-</head>
-<body>
-<% if pageinfo.skinned ~= "false" then %>
-<div id="page">
- <div id="header">
- <div class="leader">
- <a href="#Content" class="hide">[Skip to main content]</a>
- </div>
- <div id="logo">
- <div class="leader"></div>
- <h1>AlpineLinux</h1>
- <p><%= html.html_escape(hostname or "unknown hostname") %></p>
- <div class="tailer"></div>
- </div>
- <div class="mute">
- <p>
- <% local ctlr = pageinfo.script .. "/acf-util/logon/"
-
- if session.userinfo and session.userinfo.userid then
- io.write ( string.format("\t\t\t\t\t\t<a href=\"%s\">Log off as '" .. html.html_escape(session.userinfo.userid) .. "'</a>\n", html.html_escape(ctlr) .. "logoff" ) )
- else
- io.write ( string.format("\t\t\t\t\t\t<a href=\"%s\">Log on</a>\n", html.html_escape(ctlr) .. "logon" ) )
- end %>
- |
- <a href="<%= html.html_escape(pageinfo.wwwprefix) %>/">home</a> |
- <a href="http://www.alpinelinux.org">about</a>
- </p></div>
- <div class="tailer"></div>
- </div> <!-- header -->
+<!DOCTYPE html>
+<!--[if IE 6]> <html class="ie6"> <![endif]-->
+<!--[if IE 7]> <html class="ie7"> <![endif]-->
+<!--[if IE 8]> <html class="ie8"> <![endif]-->
+<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <div id="main">
- <div class="leader">
- </div>
+<% if pageinfo.skinned ~= "false" then %>
+ <title><%= html.html_escape(hostname .. " - " .. pageinfo.controller .. "->" .. pageinfo.action) %></title>
+
+ <link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.staticdir) %>/reset.css">
+ <link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.skin.."/"..posix.basename(pageinfo.skin)..".css") %>">
+ <!--[if IE]>
+ <link rel="stylesheet" type="text/css" href="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.skin.."/"..posix.basename(pageinfo.skin).."-ie.css") %>">
+ <![endif]-->
+
+ <script type="text/javascript">
+ if (typeof jQuery == 'undefined') {
+ document.write('<script type="text/javascript" src="<%= html.html_escape(pageinfo.wwwprefix) %>/js/jquery-latest.js"><\/script>');
+ }
+ </script>
+ <script type="text/javascript" src="<%= html.html_escape(pageinfo.wwwprefix..pageinfo.skin.."/"..posix.basename(pageinfo.skin)..".js") %>"></script>
+ <script type="text/javascript">
+ $(function(){
+ $(":input:not(:submit):enabled:not([readonly]):first").focus();
+ });
+ </script>
+<% end -- pageinfo.skinned %>
- <div id="nav">
- <div class="leader">
- <h3 class="hide">[Main menu]</h3>
- </div>
+ </head>
+ <body>
- <%
- local class
- local tabs
- if (#session.menu.cats > 0) then
- io.write ( "<ul>")
- for x,cat in ipairs(session.menu.cats) do
- io.write (string.format("\n\t\t\t\t<li>%s\n\t\t\t\t\t<ul>\n", html.html_escape(cat.name))) --start row
- for y,group in ipairs(cat.groups) do
- class=""
- if not tabs and group.controllers[pageinfo.prefix .. pageinfo.controller] then
- class="class='selected'"
- tabs = group.tabs
+<% if pageinfo.skinned ~= "false" then %>
+ <div id="page">
+ <div id="header">
+ <h1>AlpineLinux</h1>
+ <p class="hostname"><%= html.html_escape(hostname or "unknown hostname") %></p>
+ <p class="links">
+ <%
+ local ctlr = pageinfo.script .. "/acf-util/logon/"
+
+ if session.userinfo and session.userinfo.userid then
+ print("<a href=\""..html.html_escape(ctlr).."logoff\">Log off as '" .. html.html_escape(session.userinfo.userid) .. "'</a> |")
+ else
+ print("<a href=\""..html.html_escape(ctlr).."logon\">Log on</a> |" )
+ end
+ %>
+ <a href="<%= html.html_escape(pageinfo.wwwprefix) %>/">home</a> |
+ <a href="http://www.alpinelinux.org">about</a>
+ </p>
+ </div> <!-- header -->
+
+ <div id="main">
+ <div id="nav">
+ <%
+ local class
+ local tabs
+ if (#session.menu.cats > 0) then
+ print("<ul>")
+ for x,cat in ipairs(session.menu.cats) do
+ print("<li>"..html.html_escape(cat.name))
+ print("<ul>")
+ for y,group in ipairs(cat.groups) do
+ class=""
+ if not tabs and group.controllers[pageinfo.prefix .. pageinfo.controller] then
+ class="class='selected'"
+ tabs = group.tabs
+ end
+ print("<li "..class.."><a "..class.." href=\""..html.html_escape(pageinfo.script)..html.html_escape(group.tabs[1].prefix)..html.html_escape(group.tabs[1].controller).."/"..html.html_escape(group.tabs[1].action).."\">"..html.html_escape(group.name).."</a></li>")
+ end
+ print("</ul>")
+ print("</li>")
end
- io.write (string.format("\t\t\t\t\t\t<li %s><a %s href=\"%s%s%s/%s\">%s</a></li>\n",
- class,class,html.html_escape(pageinfo.script),html.html_escape(group.tabs[1].prefix), html.html_escape(group.tabs[1].controller), html.html_escape(group.tabs[1].action), html.html_escape(group.name) ))
+ print("</ul>")
end
- io.write ( "\t\t\t\t\t</ul>" )
- io.write ( "\t\t\t\t</li>\n")
- end
- io.write ( "\n\t\t\t</ul>\n")
- end
- %>
-
- <div class="tailer">
- </div>
- </div> <!-- nav -->
-
-
- <div id="postnav">
- <div class="leader">
- </div>
- <h2><%= html.html_escape(pageinfo.controller) %> : <%= html.html_escape(pageinfo.action) %></h2>
- <!-- FIXME: Next row is 'dead' data! Remove 'class=hide' when done! -->
- <p class='hide'>[ welcome ] > [ logon ] > [ bgp ] > [ firewall ] > [ content filter ] > [ interfaces ]</p>
- <div class="tailer">
- </div>
- </div> <!-- postnav -->
-
- <a name="Content"></a>
-
- <div id="subnav">
- <div class="leader">
- <h3 class="hide">[Submenu]</h3>
- </div>
-
- <%
- local class=""
- if (tabs and #tabs > 0) then
- io.write ( "<ul>")
- for x,tab in pairs(tabs or {}) do
- if tab.prefix == pageinfo.prefix and tab.controller == pageinfo.controller and tab.action == pageinfo.action then
- class="class='selected'"
- else
- class=""
+ %>
+ </div> <!-- nav -->
+
+ <div id="subnav">
+ <%
+ local class=""
+ if (tabs and #tabs > 0) then
+ print("<ul>")
+ for x,tab in pairs(tabs or {}) do
+ if tab.prefix == pageinfo.prefix and tab.controller == pageinfo.controller and tab.action == pageinfo.action then
+ class="class='selected'"
+ else
+ class=""
+ end
+ print("<li "..class.."><a "..class.." href=\""..html.html_escape(pageinfo.script)..html.html_escape(tab.prefix)..html.html_escape(tab.controller).."/"..html.html_escape(tab.action).."\">"..html.html_escape(tab.name).."</a></li>")
+ end
+ print("</ul>")
end
- io.write (string.format('<li %s><a %s href="%s%s%s/%s">%s</a></li>\n',
- class,class,html.html_escape(pageinfo.script),html.html_escape(tab.prefix),html.html_escape(tab.controller),html.html_escape(tab.action),html.html_escape(tab.name) ))
- end
- io.write ( "</ul>")
- end
- %>
+ %>
+ </div> <!-- subnav -->
- <div class="tailer">
- </div>
- </div> <!-- subnav -->
-
-<div id="content">
- <div class="leader">
- </div>
+ <div id="content">
<% end --pageinfo.skinned %>
- <% pageinfo.viewfunc(viewtable, viewlibrary, pageinfo, session) %>
+ <% pageinfo.viewfunc(viewtable, viewlibrary, pageinfo, session) %>
<% if pageinfo.skinned ~= "false" then %>
- <div class="tailer">
- </div>
-</div> <!-- content -->
+ </div> <!-- content -->
- </div> <!-- main -->
+ </div> <!-- main -->
- <div id="footer">
- <div class="leader">
- </div>
- <p>Page generated in <%= html.html_escape(os.clock()) %> seconds on <%= html.html_escape(os.date()) %>.</p>
- <div class="tailer">
- </div>
- </div> <!-- footer -->
-</div> <!-- page -->
-<% end --pageinfo.skinned %>
+ <div id="footer">
+ <p>Page generated in <%= html.html_escape(os.clock()) %> seconds on <%= html.html_escape(os.date()) %>.</p>
+ </div> <!-- footer -->
-</body>
+ </div> <!-- page -->
+<% end --pageinfo.skinned %>
+
+ </body>
</html>