* core: Added template for a table view of typed sections
[project/luci.git] / core / src / view / header.htm
1 <%
2 require("ffluci.sys")
3 local load1, load5, load15 = ffluci.sys.loadavg()
4 local req  = require("ffluci.dispatcher").request
5 local menu = require("ffluci.menu").get()[req.category]
6 menu = menu or {}
7 require("ffluci.i18n").loadc("default")
8 require("ffluci.http").prepare_content("text/html")
9 %><?xml version="1.0" encoding="utf-8"?>
10 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
11 <html xmlns="http://www.w3.org/1999/xhtml">
12 <head>
13         <link rel="stylesheet" type="text/css" href="<%=media%>/cascade.css" />
14         <link rel="stylesheet" type="text/css" href="<%=media%>/css/<%=req.category%>_<%=req.module%>.css" />
15         <link rel="stylesheet" type="text/css" href="<%=media%>/css/<%=req.category%>_<%=req.module%>_<%=req.action%>.css" />
16         <meta http-equiv="content-type" content="text/xhtml+xml; charset=utf-8" />
17         <meta http-equiv="content-script-type" content="text/javascript" />
18         <title>FFLuCI</title>
19 </head>
20 <body>
21 <div id="header">
22         <div class="headerlogo left"><img src="<%=media%>/logo.png" alt="Freifunk" /></div>
23         <div class="whitetext smalltext right">
24         OpenWRT Kamikaze<br />
25         Freifunk Firmware 2.0-dev<br />
26         <%:load Last%>: <%=load1%> <%=load5%> <%=load15%><br />
27         <%:hostname Hostname%>: <%=ffluci.sys.hostname()%> 
28         </div>
29         <div>
30                 <span class="headertitle">Freifunk Kamikaze</span><br />
31                 <span class="whitetext bold"><%:batmanedition Fledermausedition%></span>
32         </div>
33 </div>
34
35 <div class="separator yellow bold">
36 <%:path Pfad%>: <a href="<%=controller .. "/" .. req.category%>"><%=translate(req.category, req.category)%></a>
37 &#187; <a href="<%=controller .. "/" .. req.category .. "/" .. req.module %>"><%=translate(req.module, req.module)%></a>
38 &#187; <a href="<%=controller .. "/" .. req.category .. "/" .. req.module .. "/" .. req.action %>"><%=translate(req.action, req.action)%></a>
39 </div>
40
41 <div id="columns"><div id="columnswrapper">
42         <div class="sidebar left">
43         <% for k,v in pairs(menu) do %>
44             <div<% if v[".contr"] == req.module then %> class="yellowtext"<% end %>><a href="<%=controller.."/"..req.category.."/"..v[".contr"]%>"><%=translate(v[".contr"], v[".descr"])%></a><%
45             if v[".contr"] == req.module then %>
46                 <ul><% for key,val in ipairs(v) do %>
47                         <li<% if val.action == req.action then %> class="yellowtext"<% end %>><a href="<%=controller.."/"..req.category.."/"..req.module.."/"..val.action%>"><%=translate(val.action, val.descr)%></a></li>
48                 <% end %></ul>
49             <% end %></div>
50         <% end %>
51         </div>
52         <div class="sidebar right">
53                 <div><%:webif Weboberfläche%>
54                         <ul>
55                                 <li<% if "public" == req.category then %> class="yellowtext"<% end %>><a href="<%=controller%>/public"><%:public Öffentlich%></a></li>
56                                 <li<% if "admin" == req.category then %> class="yellowtext"<% end %>><a href="<%=controller%>/admin"><%:admin Verwaltung%></a></li>
57                         </ul>
58                 </div>
59                 <%
60                         if "admin" == req.category then
61                                 require("ffluci.model.uci") 
62                                 local ucic = ffluci.model.uci.changes()
63                                 if ucic then
64                                         ucic = #ffluci.util.split(ucic)
65                                 end
66                 %>
67                 <div><%:config Konfiguration%>
68                         <ul>
69                         <% if ucic then %>
70                                 <li><a href="<%=controller%>/admin/uci/changes"><%:changes Änderungen%>: <%=ucic%></a></li>
71                                 <li><a href="<%=controller%>/admin/uci/apply"><%:apply Anwenden%></a></li>
72                                 <li><a href="<%=controller%>/admin/uci/revert"><%:revert Verwerfen%></a></li>
73                         <% else %>
74                                 <li><%:changes Änderungen%>: 0</li>
75                         <% end %>
76                         </ul>
77                 </div>
78                 <% end %>
79         </div>
80         <div id="content">