1e05575809489d3f2f4ad63db684e8dd4e577566
[project/luci.git] / themes / openwrt.org-oxygen / luasrc / view / themes / openwrt.org-oxygen / dashboard.htm
1 <%#
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 node = luci.dispatcher.context.requested
17         if node.nodes then
18 %>
19         <div class="dashboard">
20 <%-
21                         for k, v in luci.util.spairs(node.nodes, function (a,b)
22                                 return (node.nodes[a].order or 100) < (node.nodes[b].order or 100)
23                         end) do
24                                 if v.title and #v.title > 0 and not v.ignoreindex and (v.index or v.target) then
25                                         local csscl = "dashicon di_%s" % (v.style or k)
26                                         local iconl = v.icon
27                                         local pref = luci.util.clone(luci.dispatcher.context.request)
28                                         pref[#pref+1] = k
29                                         local target = luci.dispatcher.build_url(unpack(pref))  
30 %>
31                                         <div class="<%=csscl%>">
32                                                 <a href="<%=target%>" <%-
33                                                         if iconl then
34                                                                 %> style="background-image: url(<%=resource%>/<%=iconl%>)"<%-
35                                                         end
36                                                 -%>><%=v.title%></a>
37                                         </div>
38 <% 
39                                 end 
40                         end 
41 -%>
42         </div>
43         <div class="clear"></div>
44 <%
45 end
46 %>