diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-05-22 11:59:52 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-05-22 11:59:52 +0000 |
commit | 9f69a93779e249754f680ed9a78cb6d37c59acb0 (patch) | |
tree | addcc9a7fcceddef322738d937b820ceca0fb58a | |
parent | 72b09f09eb79ae0906de9af5f89e3642fc9f35ea (diff) | |
download | acf-gnats-9f69a93779e249754f680ed9a78cb6d37c59acb0.tar.bz2 acf-gnats-9f69a93779e249754f680ed9a78cb6d37c59acb0.tar.xz |
Viewfile bugfixes on IMG.v0.2.2
Disable buttons when no connection to server.
git-svn-id: svn://svn.alpinelinux.org/acf/gnats/trunk@1174 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | gnats-controller.lua | 16 | ||||
-rw-r--r-- | gnats-report-html.lsp | 22 |
3 files changed, 29 insertions, 11 deletions
@@ -1,6 +1,6 @@ APP_NAME=gnats PACKAGE=acf-$(APP_NAME) -VERSION=0.2.1 +VERSION=0.2.2 APP_DIST=\ gnats* \ diff --git a/gnats-controller.lua b/gnats-controller.lua index 25d1ee5..d85445d 100644 --- a/gnats-controller.lua +++ b/gnats-controller.lua @@ -232,6 +232,15 @@ function query(self) value="Submit", }) + -- Assume connection is down if you get no reply from it (disable buttons) + if not (query['severity']['option']) or (#query['severity']['option'] < 2) then + query.advanced_cmd.disabled="yes" + query.advanced_cmd.errtxt="Lost connection to the server!" + query.pr_cmd.disabled=query.advanced_cmd.disabled + query.pr_cmd.errtxt=query.advanced_cmd.errtxt + + end + return { option={ script=self.conf.script, prefix=self.conf.prefix, @@ -446,6 +455,13 @@ function report(self) value="Submit", type="submit", }) + -- Assume connection is down if you get no reply from it (disable buttons) + if not (reportform['severity']['option']) or (#reportform['severity']['option'] == 0) then + reportform.submit.disabled = "yes" + reportform.submit.errtxt = "Lost connection to the server!" + end + + if (self.clientdata.submit) then diff --git a/gnats-report-html.lsp b/gnats-report-html.lsp index 7047653..b8a841e 100644 --- a/gnats-report-html.lsp +++ b/gnats-report-html.lsp @@ -1,6 +1,4 @@ <? local form = ... -?> -<? --[[ DEBUG INFORMATION io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>") io.write(html.cfe_unpack(form)) @@ -23,15 +21,19 @@ function displayinfo(myform,tags,viewtype) if (viewtype == "viewonly") then if (val.value == "") then val.value = " " end io.write(val.value) - elseif (val.type == "radio") and (type(val.option) == "table") and (#val.option > 0) then - io.write("<span style='display:inline' class='" .. ( val.class or "") .. "'>") - for k1,v1 in pairs(val.option) do - io.write("\n\t\t\t"..tostring(v1) .. ":") - io.write("<input style='margin-right:20px;margin-left:5px;' type='radio' class='" .. ( val.class or "") .. "' name='" .. val.name .. "'") - if (tostring(val.value) == tostring(v1)) then io.write(" checked='yes'") end - io.write(" value='" .. v1 .. "'>") + elseif (val.type == "radio") and (type(val.option) == "table") then + if (#val.option > 0) then + io.write("<span style='display:inline' class='" .. ( val.class or "") .. "'>") + for k1,v1 in pairs(val.option) do + io.write("\n\t\t\t"..tostring(v1) .. ":") + io.write("<input style='margin-right:20px;margin-left:5px;' type='radio' class='" .. ( val.class or "") .. "' name='" .. val.name .. "'") + if (tostring(val.value) == tostring(v1)) then io.write(" checked='yes'") end + io.write(" value='" .. v1 .. "'>") + end + io.write("\n\t\t\t</input></span>") + else + io.write("[No options available]") end - io.write("\n\t\t\t</input></span>") else io.write(html.form[val.type](val)) end |