Moved examples out of source directory
authorSteven Barth <redacted>
Mon, 10 Mar 2008 08:53:14 +0000 (08:53 +0000)
committerSteven Barth <redacted>
Mon, 10 Mar 2008 08:53:14 +0000 (08:53 +0000)
Added a first draft design
Cleaned up Makefile
Prepared for module development

16 files changed:
Makefile
contrib/index.cgi
contrib/media/cascade.css [new file with mode: 0644]
contrib/media/logo.png [new file with mode: 0644]
contrib/package/ffluci/Makefile
examples/ffluci/controller/admin/index.lua [moved from src/ffluci/controller/admin/index.lua with 100% similarity]
examples/ffluci/controller/public/example-action.lua [moved from src/ffluci/controller/public/example-action.lua with 100% similarity]
examples/ffluci/controller/public/example-simpleview.lua [moved from src/ffluci/controller/public/example-simpleview.lua with 100% similarity]
examples/ffluci/controller/public/index.lua [moved from src/ffluci/controller/public/index.lua with 100% similarity]
examples/ffluci/view/example-simpleview/foo.htm [moved from src/ffluci/view/example-simpleview/foo.htm with 100% similarity]
examples/ffluci/view/example-simpleview/index.htm [moved from src/ffluci/view/example-simpleview/index.htm with 100% similarity]
examples/ffluci/view/hello.htm [moved from src/ffluci/view/hello.htm with 100% similarity]
src/ffluci/template.lua
src/ffluci/view/footer.htm
src/ffluci/view/header.htm
src/ffluci/view/menu.htm [deleted file]

index 38b7981ec91c7e7697c0857d335eedaa702f1554..2d732ff0833a4349fcf4a3bab79d5ecc3295c086 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,16 +12,25 @@ DIRECTORIES = dist/ffluci/model dist/ffluci/controller/public dist/ffluci/contro
 INFILES = $(CFILES:%=src/%)
 OUTFILE = ffluci/init.lua
 
+.PHONY: all dist-compile dist-source examples-compile examples-source dist examples compile source clean
+
 all: compile
 
-dist-compile: compile examples
-dist-source: source examples
+dist-compile: compile dist
+dist-source: source dist
 
-examples:
+examples-compile: compile examples
+examples-source: source examples
+
+
+dist:
        cp src/ffluci/controller/public/* dist/ffluci/controller/public/
        cp src/ffluci/controller/admin/* dist/ffluci/controller/admin/
        cp src/ffluci/i18n/* dist/ffluci/i18n/
        cp src/ffluci/view/* dist/ffluci/view/ -R
+       
+examples:
+       cp examples/* dist/ -R
 
 compile:
        mkdir -p $(DIRECTORIES)
@@ -34,7 +43,5 @@ source:
        for i in $(CFILES); do cp src/$$i dist/$$i; done
        for i in $(FILES); do cp src/$$i dist/$$i; done
        
-
-.PHONY: clean
 clean:
        rm dist -rf
index 429b4c3b0241fa1ee72e0de62061ef30b6eae6d2..31705ccf27e663ea6b1df641f8062510374a10e6 100755 (executable)
@@ -1,3 +1,3 @@
 #!/usr/bin/haserl --shell=luac
 print("Status: 302 Found")
-print("Location: /cgi-bin/ffluci\n")
+print("Location: ffluci\n")
diff --git a/contrib/media/cascade.css b/contrib/media/cascade.css
new file mode 100644 (file)
index 0000000..143b93b
--- /dev/null
@@ -0,0 +1,138 @@
+body {
+       font-family: Verdana, Arial, sans-serif;
+       background-color: #aaaaaa;
+}
+
+#header {
+       padding: 0.2em;
+       height: 4.5em;
+       background-color: #262626;
+}
+
+#columns {
+       border-left: 10.1em solid #262626;
+       border-right: 10.1em solid #262626;
+       display: block;
+       background-color: white;
+       padding: 0.1em;
+}
+
+#columnswrapper {
+       display: block;
+       margin-left: -10em;
+       margin-right: -10em;
+}
+
+#content {
+       margin-left: 10em;
+       margin-right: 10em;
+       display: block;
+       position: relative;
+       padding: 2px;
+}
+
+.headerlogo {
+       height: 4em;
+       padding: 5px;
+}
+
+.headerlogo img {
+       height: 100%;
+}
+
+.headertitle {
+       font-size: 2.4em;
+       color: gray;
+       letter-spacing: 0.5em;
+       text-transform: lowercase;
+}
+
+.separator {
+       padding-left: 0.25em;
+       font-weight: bold;
+       font-size: 0.8em;
+       line-height: 1.4em;
+}
+
+.whitetext {
+       color: white;
+}
+
+.yellowtext {
+       color: #ffcb05;
+}
+
+.magentatext {
+       color: #dc0065;
+}
+
+.inheritcolor {
+       color: inherit;
+}
+
+.smalltext {
+       font-size: 0.8em;
+}
+
+.yellow {
+       background-color: #ffcb05;
+}
+
+.magenta {
+       background-color: #dc0065;
+}
+
+.nodeco {
+       text-decoration: none;
+}
+
+.redhover:hover {
+       color: red;
+}
+
+.bold {
+       font-weight: bold;
+}
+
+.sidebar {
+       position: relative;
+       padding: 0.25em;
+       color: gray;
+       width: 9em;
+       font-weight: bold;
+}
+
+.separator a, .sidebar a {
+       color: inherit;
+       text-decoration: inherit;
+}
+
+.separator a:hover, .sidebar a:hover {
+       color: red;
+}
+
+.sidebar div {
+       padding-bottom: 0.5em;
+}
+
+.sidebar ul {
+       font-size: 0.8em;
+       color: white;
+       list-style-type: none;
+       padding-left: 1em;
+       margin-top: 0%;
+}
+
+.left {
+       float: left;
+       text-align: left;
+}
+
+.right {
+       float: right;
+       text-align: right;
+}
+
+.clear {
+       clear: both;
+}
diff --git a/contrib/media/logo.png b/contrib/media/logo.png
new file mode 100644 (file)
index 0000000..d4c5dd9
Binary files /dev/null and b/contrib/media/logo.png differ
index 12e811d2c2e2c729db6c2214f859aa6b4a7d4c1f..dab80be37c7702063f843fed1968db88b42431d4 100644 (file)
@@ -34,7 +34,9 @@ endef
 define Package/ffluci/install          
        $(INSTALL_DIR) $(1)/usr/lib/lua
        $(INSTALL_DIR) $(1)/www/cgi-bin
+       $(INSTALL_DIR) $(1)/www/ffluci
        $(CP) $(PKG_BUILD_DIR)/dist/* $(1)/usr/lib/lua/ -R
+       $(CP) $(PKG_BUILD_DIR)/contrib/media $(1)/www/ffluci/ -R
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/ffluci $(1)/www/cgi-bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/contrib/index.cgi $(1)/www/cgi-bin
        $(CP) -a ./ipkg/ffluci.postinst $(1)/CONTROL/postinst
index 8c7f07f94ad7e6f3824614249a3bbb4369a8ceaf..3d6457169020c6aa78323ab89829967677c6cb32 100644 (file)
@@ -39,7 +39,7 @@ viewdir = ffluci.fs.dirname(ffluci.util.__file__()) .. "view/"
 -- memory:     Always compile, do not save compiled files, ignore precompiled 
 -- always:  Same as "memory" but also saves compiled files
 -- smart:      Compile on demand, save compiled files, update precompiled
-compiler_mode = "smart"
+compiler_mode = "memory"
 
 
 -- This applies to compiler modes "always" and "smart"
@@ -186,4 +186,4 @@ function render(name, scope)
        
        -- Now finally render the thing
        return view()
-end
\ No newline at end of file
+end
index 17c7245b6472a7de7254beecda2dda49f01d8381..c43cbb7e42bf2616051cf5d36dba06c9f97d25fd 100644 (file)
@@ -1,3 +1,7 @@
-</div>
+       </div>
+       <div class="clear"></div>
+</div></div>
+
+<div class="separator magenta bold">FFLuCI 0.1 - Freifunk Lua Configuration Interface</div>
 </body>
 </html>
\ No newline at end of file
index f47388a424c99f7f2d0d81428bd17c3647b789c7..2c0836be5bf39ad4007ce83d21be6e8087f74f03 100644 (file)
@@ -1,9 +1,56 @@
-<% require("ffluci.http").htmlheader() %>
-<html>
+<%
+local req  = require("ffluci.dispatcher").request
+local menu = require("ffluci.menu").get()[req.category]
+require("ffluci.i18n").loadc("default")
+require("ffluci.http").htmlheader()
+%><?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<title>FFLuCI Examples</title>
+<link rel="stylesheet" type="text/css" href="<%=media%>/cascade.css" />
+<title>FFLuCI</title>
 </head>
 <body>
-<h1>FFLuCI</h1>
-<%+menu%>
-<div id="content">
\ No newline at end of file
+<div id="header">
+       <div class="headerlogo left"><img src="<%=media%>/logo.png" alt="Freifunk" /></div>
+       <div class="whitetext smalltext right">
+       OpenWRT Kamikaze<br />
+       Freifunk Firmware 2.0-dev<br />
+       Load average: 1.00 2.00 3.00<br />
+       1.2.3.4 - host1
+       </div>
+       <div>
+               <span class="headertitle">Freifunk Kamikaze</span><br />
+               <span class="whitetext bold"><%:batmanedition Fledermausedition%></span>
+       </div>
+</div>
+
+<div class="separator yellow bold">
+<%:path Pfad%>: <a href="<%=controller .. "/" .. req.category%>"><%=req.category%></a>
+&#187; <a href="<%=controller .. "/" .. req.category .. "/" .. req.module %>"><%=req.module%></a>
+&#187; <a href="<%=controller .. "/" .. req.category .. "/" .. req.module .. "/" .. req.action %>"><%=req.action%></a>
+</div>
+
+<div id="columns"><div id="columnswrapper">
+       <div class="sidebar left">
+       <% for k,v in pairs(menu) do %>
+           <div<% if v[".contr"] == req.module then %> class="yellowtext"<% end %>><a href="<%=controller.."/"..req.category.."/"..v[".contr"]%>"><%=translate(v[".contr"], v[".descr"])%></a><%
+           if v[".contr"] == req.module then %>
+               <ul><% for key,val in ipairs(v) do %>
+                       <li<% if val.action == req.action then %> class="yellowtext"<% end %>><a href="<%=controller.."/"..req.category.."/"..req.module.."/"..val.action%>"><%=translate(val.action, val.descr)%></a></li>
+               <% end %></ul>
+           <% end %></div>
+       <% end %>
+       </div>
+       <div class="sidebar right">
+               <div><%:webif Weboberfläche%>
+                       <ul>
+                               <li<% if "public" == req.category then %> class="yellowtext"<% end %>><a href="<%=controller%>/public"><%:public Public%></a></li>
+                               <li<% if "admin" == req.category then %> class="yellowtext"<% end %>><a href="<%=controller%>/admin"><%:admin Admin%></a></li>
+                       </ul>
+               </div>
+               <% if "admin" == req.category then %>
+               <div>Konfiguration<ul><li>x Änderungen</li><li>Anwenden</li><li>Zurücksetzen</li></ul></div>
+               <% end %>
+       </div>
+       <div id="content">
diff --git a/src/ffluci/view/menu.htm b/src/ffluci/view/menu.htm
deleted file mode 100644 (file)
index 8d5c597..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<%
-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>
git clone https://git.99rst.org/PROJECT