diff options
author | Jo-Philipp Wich <jo@mein.io> | 2018-08-04 22:09:49 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-08-13 09:23:22 +0200 |
commit | 849d153851db2fc193c1c82648dbe719463d3a38 (patch) | |
tree | d88b4e4332938f8451be33aaa502e5dbce798b73 /themes/luci-theme-bootstrap | |
parent | c2d36ba280c50d81a5d6e6cfa30b995008c1a98e (diff) |
treewide: rework uci change display
- Use native rpcd uci changes format instead of incompletely converting
back and forth between the old and the new format
- Rework uci changelog template to print the equivalent uci commands
for the various changes
- Rework theme headers to properly count the uncomitted changes
- Rework theme CSS to properly style new changelog
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'themes/luci-theme-bootstrap')
-rw-r--r-- | themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css | 61 | ||||
-rw-r--r-- | themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm | 7 |
2 files changed, 37 insertions, 31 deletions
diff --git a/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css b/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css index 644a47fee..260f5e31c 100644 --- a/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css +++ b/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css @@ -23,7 +23,7 @@ body { padding: 5px; } -h1, h2, h3, h4, h5, h6, p, pre, a, abbr, acronym, code, del, em, img, q, s, +h1, h2, h3, h4, h5, h6, p, pre, a, abbr, acronym, code, del, em, img, ins, q, s, small, strike, strong, sub, sup, tt, var, dd, dl, dt, li, ol, ul, fieldset, form, label, legend, button, table, caption, tbody, tfoot, thead, tr, th, td, .table, .tbody, .tfoot, .thead, .tr, .th, .td { @@ -1956,47 +1956,51 @@ div.cbi-value var, } .uci-change-list { - font-family: monospace; + line-height: 170%; + white-space: pre; } +.uci-change-list del, .uci-change-list ins, -.uci-change-legend-label ins { +.uci-change-list var, +.uci-change-legend-label del, +.uci-change-legend-label ins, +.uci-change-legend-label var { text-decoration: none; - border: 1px solid #0f0; - background-color: #cfc; - display: block; + font-family: monospace; + font-style: normal; + border: 1px solid #ccc; + background: #eee; padding: 2px; + display: block; + line-height: 15px; + margin-bottom: 1px; +} + +.uci-change-list ins, +.uci-change-legend-label ins { + border-color: #0f0; + background: #cfc; } .uci-change-list del, .uci-change-legend-label del { - text-decoration: none; - border: 1px solid #f00; - background-color: #fcc; - display: block; - font-style: normal; - padding: 2px; + border-color: #f00; + background: #fcc; } .uci-change-list var, .uci-change-legend-label var { - text-decoration: none; - border: 1px solid #ccc; - background-color: #eee; - display: block; - font-style: normal; - padding: 2px; - line-height: 19px; - white-space: pre; + border-color: #ccc; + background: #eee; } .uci-change-list var ins, .uci-change-list var del { - display: inline; - /*border: none;*/ - white-space: pre; - font-style: normal; - padding: 0px; + display: inline-block; + border: none; + width: 100%; + padding: 0; } .uci-change-legend { @@ -2016,12 +2020,17 @@ div.cbi-value var, width: 10px; height: 10px; display: block; + position: relative; } .uci-change-legend-label var ins, .uci-change-legend-label var del { - line-height: 6px; border: none; + position: absolute; + top: 2px; + left: 2px; + right: 2px; + bottom: 2px; } html body.apply-overlay-active { diff --git a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm index 6ad32efb4..4347f133a 100644 --- a/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm +++ b/themes/luci-theme-bootstrap/luasrc/view/themes/bootstrap/header.htm @@ -136,12 +136,9 @@ if tree.nodes[category] and tree.nodes[category].ucidata then local ucichanges = 0 + local i, j for i, j in pairs(require("luci.model.uci").cursor():changes()) do - for k, l in pairs(j) do - for m, n in pairs(l) do - ucichanges = ucichanges + 1; - end - end + ucichanges = ucichanges + #j end if ucichanges > 0 then |