libs/cbi: attach pcdata() to template scope and use it
[project/luci.git] / libs / cbi / luasrc / view / cbi / cell_valuefooter.htm
index fbe266e..c325e49 100644 (file)
@@ -12,16 +12,23 @@ You may obtain a copy of the License at
 $Id$
 
 -%>
-
-       <% if self.tag_invalid[section] then -%>
-               <div class="cbi-error"><%:cbi_invalid%></div>
-       <%- end %>
+</div>
+<div id="cbip-<%=self.config.."-"..section.."-"..self.option%>"></div>
 </td>
 
 <% if #self.deps > 0 then -%>
        <script type="text/javascript">
                <% for j, d in ipairs(self.deps) do -%>
-                       cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option%>", "cbid.<%=self.config.."."..section.."."..d.field%>", "<%=d.value%>");
+                       cbi_d_add("cbi-<%=self.config.."-"..section.."-"..self.option..d.add%>", {
+               <%-
+                       for k,v in pairs(d.deps) do
+               -%>
+                       <%-=string.format('"cbid.%s.%s.%s"', self.config, section, k) .. ":" .. string.format("%q", v)-%>
+                       <%-if next(d.deps, k) then-%>,<%-end-%>
+               <%-
+                       end
+               -%>
+                       }, "cbip-<%=self.config.."-"..section.."-"..self.option%>");
                <%- end %>
        </script>
-<%- end %>
+<%- end %>
\ No newline at end of file