2 LuCI - Lua Configuration Interface
3 Copyright 2010 Jo-Philipp Wich <xm@subsignal.org>
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
15 <% export("uci_changelog", function(changes) -%>
16 <fieldset class="cbi-section">
17 <strong><%:Legend:%></strong>
18 <div class="uci-change-legend">
19 <div class="uci-change-legend-label"><ins> </ins> <%:Section added%></div>
20 <div class="uci-change-legend-label"><del> </del> <%:Section removed%></div>
21 <div class="uci-change-legend-label"><var><ins> </ins></var> <%:Option changed%></div>
22 <div class="uci-change-legend-label"><var><del> </del></var> <%:Option removed%></div>
23 <br style="clear:both" />
27 <div class="uci-change-list"><%
28 local util = luci.util
31 for r, tbl in pairs(changes) do
32 for s, os in pairs(tbl) do
34 if os['.type'] and os['.type'] ~= "" then
35 ret[#ret+1] = "<ins>%s.%s=<strong>%s</strong>" %{ r, s, os['.type'] }
36 for o, v in util.kspairs(os) do
37 if o:sub(1,1) ~= "." then
38 if type(v) == "table" then
41 ret[#ret+1] = "<br />%s.%s.%s+=<strong>%s</strong>"
42 %{ r, s, o, util.pcdata(v[i]) }
45 ret[#ret+1] = "<br />%s.%s.%s=<strong>%s</strong>"
46 %{ r, s, o, util.pcdata(v) }
50 ret[#ret+1] = "</ins><br />"
53 elseif os['.type'] and os['.type'] == "" then
54 ret[#ret+1] = "<del>%s.<strong>%s</strong></del><br />" %{ r, s }
58 ret[#ret+1] = "<var>%s.%s<br />" %{ r, s }
59 for o, v in util.kspairs(os) do
60 if o:sub(1,1) ~= "." then
63 if type(v) == "table" then
66 ret[#ret+1] = "%s.%s.%s+=<strong>%s</strong><br />"
67 %{ r, s, o, util.pcdata(v[i]) }
71 ret[#ret+1] = "%s.%s.%s=<strong>%s</strong><br />"
72 %{ r, s, o, util.pcdata(v) }
74 ret[#ret+1] = "</ins>"
76 ret[#ret+1] = "<del>%s.%s.<strong>%s</strong><br /></del>" %{ r, s, o }
80 ret[#ret+1] = "</var><br />"
85 write(table.concat(ret))