summaryrefslogtreecommitdiffhomepage
path: root/src/ffluci/view/menu.htm
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-03-02 21:52:58 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-03-02 21:52:58 +0000
commit3f5de3273c9e103b4909802e339db06fe0b53312 (patch)
tree793ef66c9456665f7b472e214d79b1078fccebe8 /src/ffluci/view/menu.htm
* new project: ff-luci - Freifunk Lua Configuration Interface
Diffstat (limited to 'src/ffluci/view/menu.htm')
-rw-r--r--src/ffluci/view/menu.htm25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ffluci/view/menu.htm b/src/ffluci/view/menu.htm
new file mode 100644
index 0000000000..8d5c597cf7
--- /dev/null
+++ b/src/ffluci/view/menu.htm
@@ -0,0 +1,25 @@
+<%
+local req = require("ffluci.dispatcher").request
+local menu = require("ffluci.menu").get()[req.category]
+local menu_module = nil
+require("ffluci.i18n").loadc("default")
+%>
+<div id="menu" style="font-size: 0.8em; padding-bottom: 20px">
+ <div id="menu_categories">
+ <span style="<% if "public" == req.category then write("font-weight: bold") end %>"><a href="<%=controller%>/public"><%:public Public%></a></span>
+ <span style="<% if "admin" == req.category then write("font-weight: bold") end %>"><a href="<%=controller%>/admin"><%:admin Admin%></a></span>
+ </div>
+ <div id="menu_modules">
+<% for k,v in pairs(menu) do
+if v[".contr"] == req.module then menu_module = v end %>
+ <span style="<% if v[".contr"] == req.module then write("font-weight: bold") end %>"><a href="<%=controller.."/"..req.category.."/"..v[".contr"]%>"><%=translate(v[".contr"], v[".descr"])%></a></span>
+<% end %>
+ </div>
+<% if menu_module then %>
+ <div id="menu_actions">
+<% for k,v in ipairs(menu_module) do %>
+ <span style="<% if v.action == req.action then write("font-weight: bold") end %>"><a href="<%=controller.."/"..req.category.."/"..req.module.."/"..v.action%>"><%=translate(v.action, v.descr)%></a></span>
+<% end %>
+ </div>
+<% end %>
+</div>