treewide: improve handling of page redirections in uci change views
[project/luci.git] / modules / luci-mod-admin-full / luasrc / view / admin_uci / revert.htm
index 8f7b3e8..20327ad 100644 (file)
@@ -1,12 +1,12 @@
 <%#
  Copyright 2008 Steven Barth <steven@midlink.org>
- Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+ Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
  Licensed to the public under the Apache License 2.0.
 -%>
 
 <%+header%>
 
-<h2><a id="content" name="content"><%:Configuration%> / <%:Revert%></a></h2>
+<h2 name="content"><%:Configuration%> / <%:Revert%></h2>
 
 <% if changes then %>
        <%+cbi/apply_xhr%>
        <p><strong><%:There are no pending changes to revert!%></strong></p>
 <% end %>
 
-<div class="cbi-page-actions">
-       <form class="inline" method="get" action="<%=luci.util.pcdata(luci.http.formvalue("redir"))%>">
-               <input class="cbi-button cbi-button-link" style="margin:0" type="submit" value="<%:Back%>" />
-       </form>
-</div>
+<% local node, url = luci.dispatcher.lookup(luci.http.formvalue("redir")); if url then %>
+       <div class="cbi-page-actions">
+               <form class="inline" method="get" action="<%=luci.util.pcdata(url)%>">
+                       <input class="cbi-button cbi-button-link" style="margin:0" type="submit" value="<%:Back%>" />
+               </form>
+       </div>
+<% end %>
 
 <%+footer%>