Name the element a change is in and let the diff show the lines around it
Each group of changes gets a bar with its place in the settings (like router.firewall.rules[3], and the rule's zones) and buttons to show more lines above and below, or all that are hidden. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
Nothing is applied until you press Apply.</p>
|
||||
{{with .TokenEdit}}<p class="error">{{.}}</p>{{end}}
|
||||
<div class="diff" role="table" aria-label="Changes">
|
||||
{{range .Rows}}{{if eq .Class "gap"}}<div class="drow gap" role="row"><span class="gaptext">…</span></div>{{else}}<div class="drow {{.Class}}" role="row"><span class="ln" role="cell">{{if .Old}}{{.Old}}{{end}}</span><span class="ln" role="cell">{{if .New}}{{.New}}{{end}}</span><span class="mk" role="cell">{{.Mark}}</span><code role="cell">{{.Text}}</code></div>{{end}}{{end}}
|
||||
{{range .Rows}}{{if eq .Class "gap"}}<div class="drow gap" role="row" data-n="{{.N}}"><span class="more">{{if .Down}}<button type="button" class="link" data-more="down" title="Show 10 more lines below the change above">↓</button>{{end}}{{if .Up}}<button type="button" class="link" data-more="up" title="Show 10 more lines above the next change">↑</button>{{end}}{{if .N}}<button type="button" class="link" data-more="all" title="Show every line that is hidden here">Show {{.N}} lines</button>{{end}}</span>{{if .Path}}<span class="path">{{.Path}}{{with .Label}} <span class="muted">{{.}}</span>{{end}}</span>{{end}}</div>{{else}}<div class="drow {{.Class}}{{if .Hidden}} hid{{end}}" role="row"><span class="ln" role="cell">{{if .Old}}{{.Old}}{{end}}</span><span class="ln" role="cell">{{if .New}}{{.New}}{{end}}</span><span class="mk" role="cell">{{.Mark}}</span><code role="cell">{{.Text}}</code></div>{{end}}{{end}}
|
||||
</div>
|
||||
<div class="actions">
|
||||
<form method="post" action="/apply"><input type="hidden" name="csrf" value="{{$.CSRF}}"><button>Apply</button></form>
|
||||
|
||||
@@ -47,5 +47,6 @@
|
||||
<script src="/static/live.js"></script>
|
||||
<script src="/static/upload.js"></script>
|
||||
<script src="/static/dialog.js"></script>
|
||||
<script src="/static/diff.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user