* Fixed templates to be XHTML 1.1 compliant
[project/luci.git] / src / ffluci / view / header.htm
index 2c0836be5bf39ad4007ce83d21be6e8087f74f03..66495da43c94495d3cdba7937a7088febd8213bb 100644 (file)
@@ -1,4 +1,6 @@
 <%
+require("ffluci.sys")
+local load1, load5, load15 = ffluci.sys.loadavg()
 local req  = require("ffluci.dispatcher").request
 local menu = require("ffluci.menu").get()[req.category]
 require("ffluci.i18n").loadc("default")
@@ -7,8 +9,11 @@ require("ffluci.http").htmlheader()
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<link rel="stylesheet" type="text/css" href="<%=media%>/cascade.css" />
-<title>FFLuCI</title>
+       <link rel="stylesheet" type="text/css" href="<%=media%>/cascade.css" />
+       <link rel="stylesheet" type="text/css" href="<%=media%>/css/<%=req.category%>_<%=req.module%>.css" />
+       <meta http-equiv="content-type" content="text/xhtml+xml; charset=utf-8" />
+       <meta http-equiv="content-script-type" content="text/javascript" />
+       <title>FFLuCI</title>
 </head>
 <body>
 <div id="header">
@@ -16,8 +21,8 @@ require("ffluci.http").htmlheader()
        <div class="whitetext smalltext right">
        OpenWRT Kamikaze<br />
        Freifunk Firmware 2.0-dev<br />
-       Load average: 1.00 2.00 3.00<br />
-       1.2.3.4 - host1
+       <%:load Last%>: <%=load1%> <%=load5%> <%=load15%><br />
+       <%:hostname Hostname%>: <%=ffluci.sys.hostname()%> 
        </div>
        <div>
                <span class="headertitle">Freifunk Kamikaze</span><br />
@@ -45,12 +50,29 @@ require("ffluci.http").htmlheader()
        <div class="sidebar right">
                <div><%:webif Weboberfläche%>
                        <ul>
-                               <li<% if "public" == req.category then %> class="yellowtext"<% end %>><a href="<%=controller%>/public"><%:public Public%></a></li>
-                               <li<% if "admin" == req.category then %> class="yellowtext"<% end %>><a href="<%=controller%>/admin"><%:admin Admin%></a></li>
+                               <li<% if "public" == req.category then %> class="yellowtext"<% end %>><a href="<%=controller%>/public"><%:public Öffentlich%></a></li>
+                               <li<% if "admin" == req.category then %> class="yellowtext"<% end %>><a href="<%=controller%>/admin"><%:admin Verwaltung%></a></li>
+                       </ul>
+               </div>
+               <%
+                       if "admin" == req.category then
+                               require("ffluci.model.uci") 
+                               local ucic = ffluci.model.uci.changes()
+                               if ucic then
+                                       ucic = #ffluci.util.split(ucic)
+                               end
+               %>
+               <div><%:config Konfiguration%>
+                       <ul>
+                       <% if ucic then %>
+                               <li><a href="<%=controller%>/admin/uci/changes"><%:changes Änderungen:%> <%=ucic%></a></li>
+                               <li><a href="<%=controller%>/admin/uci/apply"><%:apply Anwenden%></a></li>
+                               <li><a href="<%=controller%>/admin/uci/revert"><%:revert Verwerfen%></a></li>
+                       <% else %>
+                               <li><%:changes Änderungen: %> 0</li>
+                       <% end %>
                        </ul>
                </div>
-               <% if "admin" == req.category then %>
-               <div>Konfiguration<ul><li>x Änderungen</li><li>Anwenden</li><li>Zurücksetzen</li></ul></div>
                <% end %>
        </div>
-       <div id="content">
+       <div id="content">
\ No newline at end of file