po: fix a message id
[project/luci.git] / themes / oxygen / luasrc / view / themes / oxygen / header.htm
1 a<%#
2 LuCI - Lua Configuration Interface
3 Copyright 2008 Steven Barth <steven@midlink.org>
4 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13
14 -%>
15 <%
16 local hostname = require("luci.sys").hostname()
17 local crequest = luci.dispatcher.context.request
18 local request  = require("luci.dispatcher").context.path
19 local category = request[1]
20 local tree     = luci.dispatcher.node()
21 local cattree  = category and luci.dispatcher.node(category)
22 local node     = luci.dispatcher.context.dispatched
23
24 local c = tree
25 for i,r in ipairs(request) do
26         if c.nodes and c.nodes[r] then
27                 c = c.nodes[r]
28                 c._menu_selected = true
29         end
30 end
31
32 require("luci.i18n").loadc("default")
33 require("luci.http").prepare_content("application/xhtml+xml")
34
35 -%>
36
37 <?xml version="1.0" encoding="utf-8"?>
38 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
39 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%=luci.i18n.context.lang%>" lang="<%=luci.i18n.context.lang%>">
40 <head>
41 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
42 <meta http-equiv="Content-Script-Type" content="text/javascript" />
43 <link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" />
44 <link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/dashboard.css" />
45 <% if node and node.css then %><link rel="stylesheet" type="text/css" media="screen" href="<%=resource%>/<%=node.css%>" />
46 <% end -%>
47 <title><%=striptags( hostname .. ( (node and node.title) and ' - ' .. node.title or '')) %> - LuCI</title>
48 </head>
49 <body class="lang_<%=luci.i18n.context.lang%>">
50 <div id="screen">
51
52 <p class="skiplink">
53 <span id="skiplink1"><a href="#navigation"><%:skiplink1 Skip to navigation%></a></span>
54 <span id="skiplink2"><a href="#content"><%:skiplink2 Skip to content%></a></span>
55 </p>
56
57 <%-
58 local function ucimenu(prefix, node)
59         if not node.nodes or node.hidden then
60                 return false
61         end
62         local index = {}
63         local count = 0
64         for k, n in pairs(node.nodes) do
65                 if n.title and n.target then
66                         table.insert(index, {name=k, order=n.order or 100})
67                         count = count + 1
68                 end
69         end
70
71         table.sort(index, function(a, b) return a.order < b.order end)
72
73         if count > 0 then
74                 for j, v in pairs(index) do
75                         if #v.name > 0 then
76                                 local nnode = node.nodes[v.name]
77                                 local href = controller .. prefix .. v.name .. "/"
78                                 href = (nnode.query) and href .. luci.http.build_querystring(nnode.query) or href
79 %>
80 <span><a class="menulink<% if nnode._menu_selected then %> active<%end%>" href="<%=pcdata(href)%>"> &gt; <%=pcdata(striptags(nnode.title))%></a></span>
81 <%-
82                         end
83                 end
84 %>
85
86 <%
87         end
88 end
89 %>
90
91 <div id="header"></div>
92
93 <%
94 if tree.nodes[category] and tree.nodes[category].ucidata then
95         local ucic = 0
96         for i, j in pairs(require("luci.model.uci").cursor():changes()) do
97                 for k, l in pairs(j) do
98                         for m, n in pairs(l) do
99                                 ucic = ucic + 1;
100                         end
101                 end
102         end
103 -%>
104 <% if ucic > 0 then %><div class="menubar"><div><a class="warning" href="<%=controller%>/<%=category%>/uci/changes/"><%:Unsaved Changes%>: <%=ucic%></a><%
105 ucimenu("/" .. category .. "/uci/", tree.nodes[category].nodes["uci"], "changes")-%>
106 <div class="clear"></div>
107 </div></div>
108 <% end %>
109 <% end %>
110
111 <div class="menubar">
112 <h2 class="navigation"><a id="navigation" name="navigation"><%:Navigation%></a></h2>
113 <strong><%:Path%>:</strong>
114 <a href="<%=controller%>"><%= luci.__appname__ %></a>
115
116 <%
117         local pointer = tree
118         for k, v in ipairs(crequest) do
119                 if pointer.nodes and pointer.nodes[v] then
120                         pointer = pointer.nodes[v]
121                         %>
122                         &#187; <a href="<%=luci.dispatcher.build_url(unpack(crequest, 1, k))%>"><%=pcdata(striptags(pointer.title or v))%></a>
123                         <%
124                 end
125         end
126 %>
127 </div>
128
129 <div id="maincontent">
130 <% if node.subindex then %><%+themes/oxygen/dashboard%><% end %>