* Core translation part 1
[project/luci.git] / themes / fledermaus / luasrc / view / themes / fledermaus / header.htm
1 <%
2 require("luci.sys")
3 local load1, load5, load15 = luci.sys.loadavg()
4 local request  = require("luci.dispatcher").request
5 local category = request[1]
6 local tree     = luci.dispatcher.node()
7 local cattree  = category and luci.dispatcher.node(category)
8 local node     = luci.dispatcher.dispatched 
9
10 local c = tree
11 for i,r in ipairs(request) do
12         if c.nodes and c.nodes[r] then 
13                 c = c.nodes[r]
14                 c._menu_selected = true
15         end
16 end
17
18 require("luci.i18n").loadc("default")
19
20 require("luci.http").prepare_content("text/html")
21 %><?xml version="1.0" encoding="utf-8"?>
22 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
23 <html xmlns="http://www.w3.org/1999/xhtml">
24 <head>
25         <link rel="stylesheet" type="text/css" href="<%=media%>/cascade.css" />
26         <% if node and node.css then %><link rel="stylesheet" type="text/css" href="<%=resource%>/<%=node.css%>" /><% end %>
27         <meta http-equiv="content-type" content="text/xhtml+xml; charset=utf-8" />
28         <meta http-equiv="content-script-type" content="text/javascript" />
29         <title>LuCI - Lua Configuration Interface - <%=node.title%></title>
30 </head>
31 <body>
32 <div id="header">
33         <div class="headerlogo left"><img src="<%=media%>/logo.png" alt="<%=luci.config.brand.title%>" /></div>
34         <div class="whitetext smalltext right">
35         <%=luci.config.brand.firmware%><br />
36         <%=luci.config.brand.distro%><br />
37         <%:load Last%>: <%=load1%> <%=load5%> <%=load15%><br />
38         <%:hostname Hostname%>: <%=luci.sys.hostname()%> 
39         </div>
40         <div>
41                 <span class="headertitle"><%=luci.config.brand.title%></span><br />
42                 <span class="whitetext bold"><%=luci.config.brand.subtitle%></span>
43         </div>
44 </div>
45
46 <div class="separator yellow bold">
47 <%:path Pfad%>: <% 
48 local c = tree
49 local url = controller
50 for k,v in pairs(request) do
51         if c.nodes and c.nodes[v] then
52                 c = c.nodes[v]
53                 url = url .. "/" .. v
54         %><a href="<%=url%>"><%=c.title or v%></a> <% if k ~= #request then %>&#187; <% end
55         end
56 end
57 %>
58 </div>
59
60 <div id="columns"><div id="columnswrapper">
61         <div class="sidebar left">
62 <%
63 local function submenu(prefix, node)
64         if not node._menu_selected or not node.nodes then
65                 return false
66         end
67         local index = {}        
68         for k, n in pairs(node.nodes) do
69                 table.insert(index, {name=k, order=n.order or 100})
70         end
71                 
72         table.sort(index, function(a, b) return a.order < b.order end)
73 %>
74         <ul>
75         <% for j, v in pairs(index) do 
76                 local nnode = node.nodes[v.name]%>
77                 <li>
78                         <span<% if nnode._menu_selected then %> class="yellowtext"<%end%>><a href="<%=controller .. prefix .. v.name%>"><%=nnode.title%></a></span>
79                         <% submenu(prefix .. v.name .. "/", nnode) %>
80                 </li>
81         <% end %>
82                 </ul> 
83 <%       
84 end
85
86 if cattree and cattree.nodes then
87         local index = {}        
88         for k, node in pairs(cattree.nodes) do
89                 table.insert(index, {name=k, order=node.order or 100})
90         end
91         
92         table.sort(index, function(a, b) return a.order < b.order end)
93
94         for i, k in ipairs(index) do
95                 node = cattree.nodes[k.name]
96                 if node.title then %>
97                         <div<% if node._menu_selected then %> class="yellowtext"<%end%>><a href="<%=controller%>/<%=category%>/<%=k.name%>"><%=node.title%></a>                 
98                                 <%submenu("/" .. category .. "/" .. k.name .. "/", node)%>
99                         </div>
100 <%              end
101         end
102 end
103 %>              
104         </div>
105         <div class="sidebar right">
106                 <div><%:webui Weboberfläche%>
107                         <ul><%
108                                 for k,node in pairs(tree.nodes) do
109                                         if node.title then %>
110                                                 <li<% if request[1] == k then %> class="yellowtext"<%end%>><a href="<%=controller%>/<%=k%>"><%=node.title%></a></li>
111 <%                                      end
112                                 end%>
113                         </ul>
114                 </div>
115                 <%
116                         if "admin" == request[1] then
117                                 require("luci.model.uci") 
118                                 local ucic = luci.model.uci.changes()
119                                 if ucic then
120                                         ucic = #luci.util.split(ucic)
121                                 end
122                 %>
123                 <div><%:config Konfiguration%>
124                         <ul>
125                         <% if ucic then %>
126                                 <li><a href="<%=controller%>/admin/uci/changes"><%:changes Änderungen%>: <%=ucic%></a></li>
127                                 <li><a href="<%=controller%>/admin/uci/apply"><%:apply Anwenden%></a></li>
128                                 <li><a href="<%=controller%>/admin/uci/revert"><%:revert Verwerfen%></a></li>
129                         <% else %>
130                                 <li><%:changes Änderungen%>: 0</li>
131                         <% end %>
132                         </ul>
133                 </div>
134                 <% end %>
135         </div>
136         <div id="content">