treewide: improve handling of page redirections in uci change views
[project/luci.git] / modules / luci-mod-admin-full / luasrc / view / admin_uci / changes.htm
1 <%#
2  Copyright 2008 Steven Barth <steven@midlink.org>
3  Copyright 2008-2015 Jo-Philipp Wich <jow@openwrt.org>
4  Licensed to the public under the Apache License 2.0.
5 -%>
6
7 <%+header%>
8
9 <h2 name="content"><%:Configuration%> / <%:Changes%></h2>
10
11 <% if changes then %>
12         <%+admin_uci/changelog%>
13         <%- uci_changelog(changes) -%>
14 <% else %>
15         <p><strong><%:There are no pending changes!%></strong></p>
16 <% end %>
17
18 <div class="cbi-page-actions">
19         <% local node, url = luci.dispatcher.lookup(luci.http.formvalue("redir")); if url then %>
20         <div style="float:left">
21                 <form class="inline" method="get" action="<%=luci.util.pcdata(url)%>">
22                         <input class="cbi-button cbi-button-link" style="float:left; margin:0" type="submit" value="<%:Back%>" />
23                 </form>
24         </div>
25         <% end %>
26
27         <div style="text-align:right">
28                 <form class="inline" method="post" action="<%=controller%>/admin/uci/apply">
29                         <input type="hidden" name="token" value="<%=token%>" />
30                         <input type="hidden" name="redir" value="<%=pcdata(luci.http.formvalue("redir"))%>" />
31                         <input class="cbi-button cbi-button-apply" type="submit" value="<%:Apply%>" />
32                 </form>
33                 <form class="inline" method="post" action="<%=controller%>/admin/uci/saveapply">
34                         <input type="hidden" name="token" value="<%=token%>" />
35                         <input type="hidden" name="redir" value="<%=pcdata(luci.http.formvalue("redir"))%>" />
36                         <input class="cbi-button cbi-button-save" type="submit" value="<%:Save & Apply%>" />
37                 </form>
38                 <form class="inline" method="post" action="<%=controller%>/admin/uci/revert">
39                         <input type="hidden" name="token" value="<%=token%>" />
40                         <input type="hidden" name="redir" value="<%=pcdata(luci.http.formvalue("redir"))%>" />
41                         <input class="cbi-button cbi-button-reset" type="submit" value="<%:Revert%>" />
42                 </form>
43         </div>
44 </div>
45
46 <%+footer%>