summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2007-12-20 14:08:26 +0000
committerMika Havela <mika.havela@gmail.com>2007-12-20 14:08:26 +0000
commit1ab9d16c73cce05f6c4488b22fd40ac4d228a9fd (patch)
treeeb6d824f79326c536a71a44bb9e1a565b9a4d32e
parentabe7c8c6e20037fd40385bed21f1764ce0f41d9f (diff)
downloadacf-alpine-baselayout-1ab9d16c73cce05f6c4488b22fd40ac4d228a9fd.tar.bz2
acf-alpine-baselayout-1ab9d16c73cce05f6c4488b22fd40ac4d228a9fd.tar.xz
Changed the view-files to reflect updates in css
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@426 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--interfaces-create-html.lsp4
-rw-r--r--interfaces-delete-html.lsp4
-rw-r--r--interfaces-read-html.lsp61
-rw-r--r--interfaces-update-html.lsp14
4 files changed, 42 insertions, 41 deletions
diff --git a/interfaces-create-html.lsp b/interfaces-create-html.lsp
index 56e9790..169cc76 100644
--- a/interfaces-create-html.lsp
+++ b/interfaces-create-html.lsp
@@ -19,7 +19,7 @@ local tags = { "name", "comment", "method", "address", "netmask", "gateway",
for i,v in pairs(tags) do
local val = myform[v] ?>
-<tr><td><? if (val.label) then io.write(val.label) else io.write (v) end ?></td><td>
+<dt><? if (val.label) then io.write(val.label) else io.write (v) end ?></dt>
<? if val.name == "" then
val.name = v
end
@@ -30,7 +30,7 @@ for i,v in pairs(tags) do
end
?>
- <?= html.form[val.type](val) ?>
+ <dd><?= html.form[val.type](val) ?></dd>
</td></tr>
<? end ?>
</table>
diff --git a/interfaces-delete-html.lsp b/interfaces-delete-html.lsp
index bb2634d..cb11de4 100644
--- a/interfaces-delete-html.lsp
+++ b/interfaces-delete-html.lsp
@@ -9,7 +9,7 @@
<? local myform = form.value ?>
<p>Are you you sure you want to delete <?= myform.iface.value ?></p>
<center>
-<input type=submit name=cmd value="<?= myform.action1.value ?>">
-<input type=submit name=cmd value="<?= myform.action2.value ?>">
+<?= html.form[myform.action1.type](myform.action1) ?>
+<?= html.form[myform.action2.type](myform.action2) ?>
</center>
</form>
diff --git a/interfaces-read-html.lsp b/interfaces-read-html.lsp
index 0b377bb..d1dd58b 100644
--- a/interfaces-read-html.lsp
+++ b/interfaces-read-html.lsp
@@ -1,34 +1,43 @@
<? local view = ... ?>
+
<h1>Interfaces file</h1>
-<table border=1>
+<h2>New interface</h2>
+<dt>Create new interface</dt>
+<dd>[<a href="create?iface=">Create</a>]</dd>
+
+
+<h2>Existing interface(s)</h2>
+
<? for i=0,table.maxn(view.iface) do
local iface=""
if i > 0 then do
j = view.iface[i]
iface = j.name.value ?>
- <tr><td><?= j.name.value ?></td><td><?= j.method.value ?></td> <td><?
- if ( j.method.value == "dhcp" ) then
- io.write (j.hostname.value )
- else
- io.write ( j.address.value .. "/" .. j.netmask.value )
- end ?></td><td><?
- for x=3,4 do
- a=view.actions.action[x]
- io.write ("<a href=\"" .. view.actions.link .. a ..
- "?iface=" .. j.name.value .. "\"" ..
- ">" .. a .. "</a>\n&nbsp;" )
- end
- ?></td></tr><?
- end
-end ?>
-<tr><td></td><td></td><td></td><td><?
- a = view.actions.action[1]
- io.write ("<a href=\"" .. view.actions.link .. a ..
- "?iface=" .. iface .. "\"" ..
- ">" .. a .. "</a>\n&nbsp;" )
- ?></td></tr>
-<?
-end
-?>
-</table>
+<h3><?= j.name.value ?></h3>
+<dt>Method</dt>
+<dd><?= j.method.value ?></dd>
+<? if ( j.method.value == "dhcp" ) then ?>
+ <dt>Hostname</dt>
+ <dd><?= j.address.value ?></dd>
+<? elseif ( j.address.value ~= "" ) then?>
+ <dt>Address</dt>
+ <dd><?= j.address.value ?>/<?= j.netmask.value ?></dd>
+<? end ?>
+<? if (j.comment.value ~= "") then ?>
+ <dt>Comments</dt>
+ <dd><?= j.comment.value ?></dd>
+<? end ?>
+
+<? local val = {value="update", type="submit", option="", errtxt=""}?>
+
+<dt>Modify this interface</dt>
+<dd>[<a href="<?= view.actions.link .. "update?iface=" .. j.name.value ?>">update</a>]
+[<a href="<?= view.actions.link .. "delete?iface=" .. j.name.value ?>">delete</a>]</dd>
+
+<? end ?>
+<? end ?>
+<? end ?>
+
+
+
diff --git a/interfaces-update-html.lsp b/interfaces-update-html.lsp
index ef53642..09743f3 100644
--- a/interfaces-update-html.lsp
+++ b/interfaces-update-html.lsp
@@ -4,7 +4,6 @@
<form action="<?= form.option.script .. "/" .. form.option.prefix ..
form.option.controller .. "/" .. form.option.action ..
form.option.extra ?>" method="POST">
-<table>
<? local myform = form.value
@@ -18,19 +17,12 @@ local tags = { "comment", "method", "address", "netmask", "gateway",
for i,v in pairs(tags) do
local val = myform[v] ?>
-<tr><td><? if (val.label) then io.write(val.label) else io.write (v) end ?></td><td>
+<dt><? if (val.label) then io.write(val.label) else io.write (v) end ?></dt>
<? if val.name == "" then
val.name = v
end
-
- if val.type == "longtext" then
- val.cols = 60
- val.rows = 3
- end
-
?>
- <?= html.form[val.type](val) ?>
-</td></tr>
+ <dd><?= html.form[val.type](val) ?></dd>
<? end ?>
-</table>
</form>
+