* Reworked Theme "Fledermaus"
authorSteven Barth <steven@midlink.org>
Sun, 27 Apr 2008 20:53:32 +0000 (20:53 +0000)
committerSteven Barth <steven@midlink.org>
Sun, 27 Apr 2008 20:53:32 +0000 (20:53 +0000)
* Added Freifunk wizard
* Added Freifunk iptables rules

19 files changed:
contrib/package/ffluci/Makefile
core/contrib/uci/freifunk
core/contrib/uci/luci
core/src/ffluci/view/cbi/map.htm
core/src/ffluci/view/cbi/nsection.htm
core/src/ffluci/view/cbi/ucisection.htm
core/src/ffluci/view/cbi/valuefooter.htm
core/src/ffluci/view/cbi/valueheader.htm
module/admin-core/contrib/init.d/luci_freifunk [new file with mode: 0644]
module/admin-core/src/controller/admin/index.lua
module/admin-core/src/model/cbi/admin_index/freifunk.lua
module/admin-core/src/model/menu/00admin.lua
module/admin-core/src/view/admin_index/wizard.htm [new file with mode: 0644]
module/admin-core/src/view/admin_system/ipkg.htm
module/admin-core/src/view/admin_system/passwd.htm
module/admin-core/src/view/admin_system/sshkeys.htm
module/admin-core/src/view/admin_system/upgrade.htm
themes/fledermaus/contrib/media/cascade.css
themes/fledermaus/contrib/media/cbi.js

index aba1509e99483a2141dd52f7a5ed1944aea72955..8f0581206fe3e4f9e865f43ec98dab04f2036d9b 100644 (file)
@@ -26,7 +26,7 @@ define Package/ffluci
   CATEGORY:=Administration
   TITLE:=FFLuCI
   SUBMENU:=FFLuCI
-  DEPENDS:=+luaposix +haserl-lua +ffluci-system-addons
+  DEPENDS:=+luaposix +haserl-lua +ffluci-system-addons +ffluci-splash
   MAINTAINER:=Steven Barth <steven-at-midlink-dot-org>
 endef
 
@@ -61,6 +61,7 @@ define Package/ffluci/install
        $(CP) $(PKG_BUILD_DIR)/module/admin-core/dist/* $(1)/usr/lib/lua/ffluci/ -R
        $(CP) $(PKG_BUILD_DIR)/module/admin-core/contrib/uci/luci_fw $(1)/etc/config/luci_fw
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/module/admin-core/contrib/init.d/luci_fw $(1)/etc/init.d/luci_fw
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/module/admin-core/contrib/init.d/luci_freifunk $(1)/etc/init.d/luci_freifunk
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/module/admin-core/contrib/ffluci-flash $(1)/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/module/admin-core/contrib/luci-splash $(1)/www/cgi-bin
        
index 128267d045f319ba4bdc5ff342dbe35f7cf2525c..aba12e63679dd7399c135509540fbaa2fa56511d 100644 (file)
@@ -13,4 +13,14 @@ config public community
                option essid    halle.freifunk.net
                option bssid    02:CA:FF:EE:BA:BE
                option realm    netz.freifunk-halle.net
-               option pool             104.62.0.0/16
\ No newline at end of file
+               option channel  1
+               option net              104.0.0.0
+               option mask             255.0.0.0
+               option dhcp             10.0.0.0
+               option dhcpmask 255.255.255.0
+               option dns              "88.198.178.18 141.54.1.1 212.204.49.83 208.67.220.220 208.67.222.222"
+               
+config settings routing
+               option internal 0
+               option internet 0
+               
\ No newline at end of file
index 292e8f2b281e25cf71696fd26652c831f2b9bea2..3e8dcc89aa864017860e30dab46c69a3fffff7f3 100644 (file)
@@ -25,6 +25,7 @@ config event uci_oncommit
         option fstab   "/etc/init.d/fstab restart"
         option qos             "/etc/init.d/qos restart"
         option luci_splash "/etc/init.d/luci_splash restart"
+        option freifunk "/etc/init.d/luci_freifunk restart"
         
 config internal languages
                option de "Deutsch"
index 83c377fb861554ce0e1b094c98631f58aa30770e..835393c1c5959d7c9d2c947bb456be62c1784bca 100644 (file)
@@ -1,7 +1,6 @@
                        <div class="cbi-map" id="cbi-<%=self.config%>">
                                <h1><%=self.title%></h1>
                                <div class="cbi-map-descr"><%=self.description%></div>
-                               <br />
 <% self:render_children() %>
                                <br />
                        </div>
index 0f7601a941e2c3447c6a5468d0571c958a6aa534..bbc87f1858a8d01c9f087c74bee49bfa07d6e2ba 100644 (file)
@@ -3,7 +3,7 @@ section = self.section %>
                                <div class="cbi-section" id="cbi-<%=self.config%>-<%=section%>">
                                        <h2><%=self.title%></h2>
                                        <div class="cbi-section-descr"><%=self.description%></div>
-                                       <% if self.addremove then %><div class="cbi-section-remove">
+                                       <% if self.addremove then %><div class="cbi-section-remove right">
                                                <input type="submit" name="cbi.rns.<%=self.config%>.<%=section%>" value="<%:cbi_del Eintrag entfernen%>" />
                                        </div><% end %>
 <%+cbi/ucisection%>
index ef1b6cb0e142be0f0cd4e694d3481957f5d52084..a1fb39cf45f00508e60560fdceb19a7e80439d05 100644 (file)
@@ -1,4 +1,4 @@
-                                       <fieldset class="cbi-section-node" id="cbi-<%=self.config%>-<%=section%>">
+                                       <div class="cbi-section-node" id="cbi-<%=self.config%>-<%=section%>">
 <% self:render_children(section) %>
                                                <% if #self.optionals[section] > 0 or self.dynamic then %>
                                                        <div class="cbi-optionals">
@@ -19,5 +19,5 @@
                                                                <input type="submit" value="<%:add hinzufügen%>" />
                                                        </div>
                                                <% end %>
-                                       </fieldset>
+                                       </div>
                                        <br />
\ No newline at end of file
index 3f92f09e26d0ffa104ba32dec98fa645e261dae3..6151a3a66afa88790324cd709e8e64b1b6e05953 100644 (file)
@@ -1,4 +1,4 @@
-                                                               <div class="cbi-value-description inline"><%=self.description%></div>
+                                                               <div class="cbi-value-description"><%=self.description%>&nbsp;</div>
                                                        </div>
                                                        <% if self.tag_invalid[section] then %><div class="cbi-error"><%:cbi_invalid Fehler: Ungültige Eingabe%></div><% end %>
                                                </div>
index 86c782d71108b48be21ecd74a9c7ccc332e820df..062efa2dddc7f4e76f98ae2992ebc80e77e518de 100644 (file)
@@ -1,3 +1,3 @@
-                                               <div class="cbi-value clear" id="cbi-<%=self.config.."-"..section.."-"..self.option%>">
-                                                       <div class="cbi-value-title left"><%=self.title%></div>
+                                               <div class="cbi-value" id="cbi-<%=self.config.."-"..section.."-"..self.option%>">
+                                                       <div class="cbi-value-title"><%=self.title%></div>
                                                        <div class="cbi-value-field">
\ No newline at end of file
diff --git a/module/admin-core/contrib/init.d/luci_freifunk b/module/admin-core/contrib/init.d/luci_freifunk
new file mode 100644 (file)
index 0000000..dbb346f
--- /dev/null
@@ -0,0 +1,68 @@
+#!/bin/sh /etc/rc.common
+START=70
+
+start() {
+       include /lib/network
+       scan_interfaces
+       
+       
+       ### Read interface names
+       config_get wanif wan ifname
+       config_get lanif lan ifname
+       config_get ffif  ff  ifname
+       
+       
+       [ -n "$ffif" ] || return 0
+               
+       
+       ### Read from config
+       config_load freifunk
+       
+       config_get_bool internal routing internal
+       [ -n "$wanif" ] && config_get_bool internet routing internal
+       
+       
+       ### Freifunk to Freifunk
+       [ "$internal" -gt 0 ] && {
+               iptables -A forwarding_rule -i "$ffif" -o "$ffif" -j ACCEPT
+       }
+       
+       ### Lan to Freifunk     
+       [ -n "$lanif" ] && {
+               iptables -A forwarding_rule -i "$lanif" -o "$ffif" -j ACCEPT
+               iptables -t nat -A postrouting_rule -i "$lanif" -o "$ffif" -j MASQUERADE
+       }
+       
+       ### Freifunk to Wan
+       [ "$internet" -gt 0 ] && {
+               iptables -A forwarding_rule -i "$ffif" -o "$wanif" -j ACCEPT
+               iptables -t nat -A postrouting_rule -i "$ffif" -o "$wanif" -j MASQUERADE
+       }
+}
+
+stop() {
+       include /lib/network
+       scan_interfaces
+       
+       ### Read interface names
+       config_get wanif wan ifname
+       config_get lanif lan ifname
+       config_get ffif  ff  ifname
+       
+       [ -n "$ffif" ] || return 0
+       
+       ### Freifunk to Freifunk
+       iptables -D forwarding_rule -i "$ffif" -o "$ffif" -j ACCEPT
+       
+       ### Lan to Freifunk     
+       [ -n "$lanif" ] && {
+               iptables -D forwarding_rule -i "$lanif" -o "$ffif" -j ACCEPT
+               iptables -t nat -D postrouting_rule -i "$lanif" -o "$ffif" -j MASQUERADE
+       }
+       
+       ### Freifunk to Wan
+       [ -n "$wanif" -gt 0 ] && {
+               iptables -D forwarding_rule -i "$ffif" -o "$wanif" -j ACCEPT
+               iptables -t nat -D postrouting_rule -i "$ffif" -o "$wanif" -j MASQUERADE
+       }
+}
index b4a7720f8b23628ae6a0c77c4c905852c4599b75..685478eddba0cd265cc781ae6dfbe8f8c64e23a3 100644 (file)
@@ -1 +1,127 @@
-module("ffluci.controller.admin.index", package.seeall)
\ No newline at end of file
+module("ffluci.controller.admin.index", package.seeall)
+
+function action_wizard()
+       if ffluci.http.formvalue("ip") then
+               return configure_freifunk()
+       end
+       
+       local ifaces = {}
+       local wldevs = ffluci.model.uci.show("wireless")
+       
+       if wldevs then
+               for k, v in pairs(wldevs.wireless) do
+                       if v[".type"] == "wifi-device" then
+                               table.insert(ifaces, k)
+                       end
+               end
+       end
+       
+       ffluci.template.render("admin_index/wizard", {ifaces=ifaces})
+end
+
+function configure_freifunk()
+       local ip  = ffluci.http.formvalue("ip")
+       local uci = ffluci.model.uci.Session()
+       
+       -- Configure FF-Interface
+       uci:del("network", "ff")
+       uci:del("network", "ffdhcp")
+       
+       uci:set("network", "ff", nil, "interface")
+       uci:set("network", "ff", "type", "bridge")
+       uci:set("network", "ff", "proto", "static")
+       uci:set("network", "ff", "ipaddr", ip)
+       uci:set("network", "ff", "netmask", uci:get("freifunk", "community", "mask")) 
+       uci:set("network", "ff", "dns", uci:get("freifunk", "community", "dns")) 
+       
+       -- Enable internal routing
+       uci:set("freifunk", "routing", "internal", "1")
+       
+       -- Enable internet routing
+       if ffluci.http.formvalue("shareinet") then
+               uci:set("freifunk", "routing", "internet", "1")
+       else
+               uci:set("freifunk", "routing", "internet", "0")
+       end
+       
+       -- Configure DHCP
+       if ffluci.http.formvalue("dhcp") then
+               local dhcpnet = uci:get("freifunk", "community", "dhcp"):match("^([0-9]+)")
+               local dhcpip  = ip:gsub("^[0-9]+", dhcpnet)
+       
+               uci:set("network", "ffdhcp", nil, "interface")
+               uci:set("network", "ffdhcp", "proto", "static")
+               uci:set("network", "ffdhcp", "ifname", "br-ff:dhcp")
+               uci:set("network", "ffdhcp", "ipaddr", dhcpip)
+               uci:set("network", "ffdhcp", "netmask", uci:get("freifunk", "community", "dhcpmask"))           
+       end
+       
+       -- Configure OLSR
+       if ffluci.http.formvalue("olsr") and uci:show("olsr") then
+               for k, v in pairs(uci:show("olsr").olsr) do
+                       if v[".type"] == "Interface" or v[".type"] == "LoadPlugin" then
+                               uci:del("olsr", "k")
+                       end
+               end
+               
+               if ffluci.http.formvalue("shareinet") then
+                       uci:set("olsr", "dyn_gw", nil, "LoadPlugin")
+                       uci:set("olsr", "dyn_gw", "Library", "olsrd_dyn_gw.so.0.4")
+               end
+               
+               uci:set("olsr", "nameservice", nil, "LoadPlugin")
+               uci:set("olsr", "nameservice", "Library", "olsrd_nameservice.so.0.3")
+               uci:set("olsr", "nameservice", "name", ip:gsub("%.", "-"))
+               uci:set("olsr", "nameservice", "hosts_file", "/var/etc/hosts")
+               uci:set("olsr", "nameservice", "suffix", ".olsr")
+               uci:set("olsr", "nameservice", "latlon_infile", "/tmp/latlon.txt")
+               
+               uci:set("olsr", "txtinfo", nil, "LoadPlugin")
+               uci:set("olsr", "txtinfo", "Library", "olsrd_txtinfo.so.0.1")
+               uci:set("olsr", "txtinfo", "Accept", "127.0.0.1")
+               
+               local oif = uci:add("olsr", "Interface")
+               uci:set("olsr", oif, "Interface", "ff")
+               uci:set("olsr", oif, "HelloInterval", "6.0")
+               uci:set("olsr", oif, "HelloValidityTime", "108.0")
+               uci:set("olsr", oif, "TcInterval", "4.0")
+               uci:set("olsr", oif, "TcValidityTime", "324.0")
+               uci:set("olsr", oif, "MidInterval", "18.0")
+               uci:set("olsr", oif, "MidValidityTime", "324.0")
+               uci:set("olsr", oif, "HnaInterval", "18.0")
+               uci:set("olsr", oif, "HnaValidityTime", "108.0")
+       end
+       
+       -- Configure Wifi
+       local wifi = ffluci.http.formvalue("wifi")
+       local wcfg = uci:show("wireless")
+       if type(wifi) == "table" and wcfg then
+               for iface, v in pairs(wifi) do
+                       if wcfg[iface] then
+                               -- Cleanup
+                               for k, v in pairs(wcfg.wireless) do
+                                       if v[".type"] == "wifi-iface" and v.device == iface then
+                                               uci:del("wireless", k)
+                                       end
+                               end
+                               
+                               uci:set("wireless", iface, "disabled", "0")
+                               uci:set("wireless", iface, "mode", "11g")
+                               uci:set("wireless", iface, "txantenna", 1)
+                               uci:set("wireless", iface, "rxantenna", 1)
+                               uci:set("wireless", iface, "channel", uci:get("freifunk", "community", "channel")) 
+                               
+                               local wif = uci:add("wireless", "wifi-iface")
+                               uci:set("wireless", wif, "device", iface)
+                               uci:set("wireless", wif, "network", "ff")
+                               uci:set("wireless", wif, "mode", "adhoc")
+                               uci:set("wireless", wif, "ssid", uci:get("freifunk", "community", "essid"))
+                               uci:set("wireless", wif, "bssid", uci:get("freifunk", "community", "bssid"))
+                               uci:set("wireless", wif, "txpower", 13)
+                       end
+               end
+       end
+               
+
+       ffluci.http.request_redirect("admin", "uci", "changes")
+end
\ No newline at end of file
index 64e916f32be443c002a7c50fd2e7cae5a97491f2..ec4d100b87b04572e232e85277339ef6c565d9ec 100644 (file)
@@ -1,13 +1,23 @@
 -- Todo: Translate
-m = Map("freifunk", "Freifunk", [[Informationen über die lokale Freifunkgemeinschaft.]])
+m = Map("freifunk", "Freifunk")
 
-c = m:section(NamedSection, "community", "public")
+s = m:section(NamedSection, "routing", "settings", "Netzverkehr")
+s:option(Flag, "internal", "Freifunk zulassen", "immer aktivieren!")
+s:option(Flag, "internet", "Internet zulassen")
 
+c = m:section(NamedSection, "community", "public", "Gemeinschaft", [[Dies sind die Grundeinstellungen
+für die lokale Freifunkgemeinschaft. Diese Werte wirken sich NICHT auf die Konfiguration
+des Routers aus, sondern definieren nur die Vorgaben für den Freifunkassistenten.]])
 c:option(Value, "name", "Gemeinschaft")
 c:option(Value, "homepage", "Webseite")
 c:option(Value, "essid", "ESSID")
 c:option(Value, "bssid", "BSSID")
+c:option(Value, "channel", "Funkkanal")
 c:option(Value, "realm", "Realm")
-c:option(Value, "pool", "Adressbereich")
+c:option(Value, "net", "Adressbereich")
+c:option(Value, "mask", "Netzmaske")
+c:option(Value, "dns", "DNS-Server")
+c:option(Value, "dhcp", "DHCP-Bereich")
+c:option(Value, "dhcpmask", "DHCP-Maske")
 
 return m
\ No newline at end of file
index 7d56b8b5455be77586b256485dc9f26057e96e22..8f87792cade1d9561d34f3f496386ff2a53087ad 100644 (file)
@@ -1,4 +1,5 @@
 add("admin", "index", "Übersicht", 10)
+act("wizard", "Freifunkassistent")
 act("contact", "Kontakt")
 act("luci", "Oberfläche")
 act("freifunk", "Freifunk")
diff --git a/module/admin-core/src/view/admin_index/wizard.htm b/module/admin-core/src/view/admin_index/wizard.htm
new file mode 100644 (file)
index 0000000..8c1a095
--- /dev/null
@@ -0,0 +1,36 @@
+<%+header%>
+<h1><%:ffwizard Freifunkassistent%></h1>
+<p><%:ffwizard1 Dieser Assistent konfiguriert den Router für die Benutzung im Freifunknetz%></p>
+<br />
+<form method="post" action="<%=controller%>/admin/index/wizard">
+       <div class="cbi-section-node">
+               <div class="cbi-value">
+                       <div class="cbi-value-title"><%:ip IP-Adresse%>:&nbsp;
+                       <input type="text" size="20" name="ip" /></div>
+               </div>
+               <% for i, k in ipairs(ifaces) do %>
+               <div class="cbi-value">
+                       <div class="cbi-value-title"><%:wificfg Drahtlosgerät einrichten%>: <%=k%></div>
+                       <div class="cbi-value-field"><input type="checkbox" name="wifi.<%=k%>" value="1" checked="checked" /></div>
+               </div>
+               <% end %>
+               <div class="cbi-value">
+                       <div class="cbi-value-title"><%:cfgolsr OLSR konfigurieren%></div>
+                       <div class="cbi-value-field"><input type="checkbox" name="olsr" value="1" checked="checked" /></div>
+               </div>
+               <div class="cbi-value">
+                       <div class="cbi-value-title"><%:cfgdhcp Drahtlos DHCP konfigurieren%></div>
+                       <div class="cbi-value-field"><input type="checkbox" name="dhcp" value="1" checked="checked" /></div>
+               </div>
+               <div class="cbi-value">
+                       <div class="cbi-value-title"><%:shareinet Internet teilen%></div>
+                       <div class="cbi-value-field"><input type="checkbox" name="shareinet" value="1" checked="checked" /></div>
+               </div>
+       </div>
+       <br />
+       <div>
+               <input type="submit" value="<%:configure Konfigurieren%>" />
+               <input type="reset" value="<%:reset Zurücksetzen%>" />
+       </div>
+</form> 
+<%+footer%>
\ No newline at end of file
index c1f6ad0be9183fda1a12c16eeeb6569d911641db..a385e8327e4e039e21a54c7278f7cbd03ade8570 100644 (file)
@@ -10,7 +10,7 @@
 <br />
 
 <form method="post" action="<%=controller%>/admin/system/ipkg">
-       <fieldset class="cbi-section-node">
+       <div class="cbi-section-node">
                <div><textarea style="width: 100%" rows="10" name="data"><%=cnt%></textarea></div>
                <br />
                <div>
@@ -18,6 +18,6 @@
                        <input type="reset" value="<%:reset Zurücksetzen%>" />
                </div>
                <% if msg then %><br /><div class="error"><%:error Fehler%>: <%=msg%></div><% end %>
-       </fieldset>
+       </div>
 </form>
 <%+footer%>
\ No newline at end of file
index e736204bbad8f9722c93673b36bb2c361718f591..10a079945e163103c11231afc5ed1fff5b987b84 100644 (file)
@@ -14,7 +14,7 @@
 <% end %>
 <% if not stat or stat == 10 then %>
        <form method="post" action="<%=controller%>/admin/system/passwd">
-               <fieldset class="cbi-section-node">
+               <div class="cbi-section-node">
                        <div class="cbi-value clear">
                                <div class="cbi-value-title left"><%:password Passwort%></div>
                                <div class="cbi-value-field"><input type="password" name="pwd1" /></div>
@@ -28,7 +28,7 @@
                                <input type="submit" value="<%:save Speichern%>" />
                                <input type="reset" value="<%:reset Zurücksetzen%>" />
                        </div>
-               </fieldset>
+               </div>
        </form>
 <% end %>
 </div>
index 9cf91f998cc034cb48fa7eba64b14a1ae827b152..ad80b63f0e2f36f5c149dd12bd265e27c3080d07 100644 (file)
@@ -10,7 +10,7 @@
 <br />
 
 <form method="post" action="<%=controller%>/admin/system/sshkeys">
-       <fieldset class="cbi-section-node">
+       <div class="cbi-section-node">
                <div><textarea style="width: 100%" rows="10" name="data"><%=cnt%></textarea></div>
                <br />
                <div>
@@ -18,6 +18,6 @@
                        <input type="reset" value="<%:reset Zurücksetzen%>" />
                </div>
                <% if msg then %><br /><div class="error"><%:error Fehler%>: <%=msg%></div><% end %>
-       </fieldset>
+       </div>
 </form>
 <%+footer%>
\ No newline at end of file
index 35f2e81417e040e7ffa270a4c4281b097f54dc24..5980028900ffb7d49e5ba49da6fe533cc85d580f 100644 (file)
@@ -6,7 +6,7 @@ Das Format der Firmware ist plattformabhängig.%></p>
 <br />
 <% if sysupgrade and not ret then %>
 <form method="post" action="<%=controller%>-upload/admin/system/upgrade" enctype="multipart/form-data">
-       <fieldset class="cbi-section-node">
+       <div class="cbi-section-node">
                <div class="cbi-value clear">
                        <div class="cbi-value-title left"><%:fwimage Firmwareimage%></div>
                        <div class="cbi-value-field"><input type="file" size="30" name="image" /></div>
@@ -20,7 +20,7 @@ Das Format der Firmware ist plattformabhängig.%></p>
                <div>
                        <input type="submit" value="<%:fwupgrade Firmware aktualisieren%>" />
                </div>
-       </fieldset>
+       </div>
 </form>
 <% elseif ret then %>
        <% if ret == 0 then %>
index ad1de6f46a64caffaf5eafa6c67b428a6ba28be6..a7245ae60b886a2cf663b580e70e96d714590b2b 100644 (file)
@@ -196,14 +196,21 @@ table th, table, td {
        text-align: right;
 }
 
+.cbi-value {
+       display: table-row;
+}
+
 .cbi-value-title {
+       display: table-cell;
        line-height: 1.75em;
-       width: 15em;
        font-weight: bold;
+       padding: 0.25em;
 }
 
 .cbi-value-field {
+       display: table-cell;
        text-align: left;
+       padding: 0.25em;
        line-height: 1.75em;
 }
 
@@ -219,8 +226,10 @@ table th, table, td {
 }
 
 .cbi-value-description {
+       display: inline;
        font-style: italic;
        font-size: 0.8em; 
+       padding: 0.25em;
        margin-bottom: 0.5em;
 }
 
@@ -229,11 +238,10 @@ table th, table, td {
 }
 
 .cbi-section-node {
-       display: block;
+       display: table;
+       padding: 0.25em;
        background: #f7f7f7;
        border: 1px solid #d7d7d7;
-       overflow: auto;
-       margn-bottom: 0%;
 }
 
 .cbi-section-node h3 {
index f9e463bca1720cacdd038d67c4d6629598a039f1..a3a47aa45b3237621876572d6e6dae3752398047 100644 (file)
@@ -16,15 +16,21 @@ function cbi_d_update(target) {
        }
        
        for (var x in cbi_d[target]) {
-               for (var i=0; i<cbi_d[target][x].length; i++) {                 
-                       document.getElementById(cbi_d[target][x][i]).style.display = "none";
+               for (var i=0; i<cbi_d[target][x].length; i++) { 
+                       var y = document.getElementById(cbi_d[target][x][i])    
+                       y.style.display = "none";
                }
        }
        
        var t = document.getElementById(target);
        if (t && t.value && cbi_d[target][t.value]) {
                for (var i=0; i<cbi_d[target][t.value].length; i++) {                   
-                       document.getElementById(cbi_d[target][t.value][i]).style.display = "block";
+                       var y = document.getElementById(cbi_d[target][t.value][i])
+                       if (!y.value) { 
+                               y.style.display = "table-row";
+                       } else {
+                               y.style.display = "block";
+                       }
                }
        }
 }