diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-03-02 21:52:58 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-03-02 21:52:58 +0000 |
commit | 3f5de3273c9e103b4909802e339db06fe0b53312 (patch) | |
tree | 793ef66c9456665f7b472e214d79b1078fccebe8 /src/ffluci/view |
* new project: ff-luci - Freifunk Lua Configuration Interface
Diffstat (limited to 'src/ffluci/view')
-rwxr-xr-x | src/ffluci/view/example-simpleview/foo.htm | 3 | ||||
-rwxr-xr-x | src/ffluci/view/example-simpleview/index.htm | 6 | ||||
-rw-r--r-- | src/ffluci/view/footer.htm | 3 | ||||
-rw-r--r-- | src/ffluci/view/header.htm | 9 | ||||
-rw-r--r-- | src/ffluci/view/hello.htm | 1 | ||||
-rw-r--r-- | src/ffluci/view/menu.htm | 25 |
6 files changed, 47 insertions, 0 deletions
diff --git a/src/ffluci/view/example-simpleview/foo.htm b/src/ffluci/view/example-simpleview/foo.htm new file mode 100755 index 0000000000..a0df536f16 --- /dev/null +++ b/src/ffluci/view/example-simpleview/foo.htm @@ -0,0 +1,3 @@ +<%+header%> +<h1>bar</h1> +<%+footer%>
\ No newline at end of file diff --git a/src/ffluci/view/example-simpleview/index.htm b/src/ffluci/view/example-simpleview/index.htm new file mode 100755 index 0000000000..ffe1ccf71d --- /dev/null +++ b/src/ffluci/view/example-simpleview/index.htm @@ -0,0 +1,6 @@ +<%+header%> +<p><%:descr This is the Simple View-Example.<br /> +This template is ffluci/view/example-simpleview/index.htm and belongs +to the index-Action.%></p> +<p><%:lan The router's LAN IP-Address is:%> <%~network.lan.ipaddr%></p> +<%+footer%>
\ No newline at end of file diff --git a/src/ffluci/view/footer.htm b/src/ffluci/view/footer.htm new file mode 100644 index 0000000000..17c7245b64 --- /dev/null +++ b/src/ffluci/view/footer.htm @@ -0,0 +1,3 @@ +</div> +</body> +</html>
\ No newline at end of file diff --git a/src/ffluci/view/header.htm b/src/ffluci/view/header.htm new file mode 100644 index 0000000000..f47388a424 --- /dev/null +++ b/src/ffluci/view/header.htm @@ -0,0 +1,9 @@ +<% require("ffluci.http").htmlheader() %> +<html> +<head> +<title>FFLuCI Examples</title> +</head> +<body> +<h1>FFLuCI</h1> +<%+menu%> +<div id="content">
\ No newline at end of file diff --git a/src/ffluci/view/hello.htm b/src/ffluci/view/hello.htm new file mode 100644 index 0000000000..8231b61f96 --- /dev/null +++ b/src/ffluci/view/hello.htm @@ -0,0 +1 @@ +A very little Hello <%=muh%> 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> |