summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-10-10 20:59:27 +0000
committerSteven Barth <steven@midlink.org>2008-10-10 20:59:27 +0000
commit720295d973b44cdad4cd4a0e0b0b0f7f79ff6c3a (patch)
tree19ba90091e82853047488f3c2a0842f31d47b42d
parenta957254e79a8cfaf4c79da138b6531c6ec324b36 (diff)
OXYGEN #3: Add "back" button to UCI apply/revert/changes pages
-rw-r--r--i18n/english/luasrc/i18n/default.en.lua1
-rw-r--r--i18n/english/luasrc/i18n/default.en.xml1
-rw-r--r--i18n/german/luasrc/i18n/default.de.lua1
-rw-r--r--i18n/german/luasrc/i18n/default.de.xml1
-rw-r--r--modules/admin-full/luasrc/controller/admin/uci.lua10
-rw-r--r--modules/admin-full/luasrc/view/admin_uci/apply.htm10
-rw-r--r--modules/admin-full/luasrc/view/admin_uci/changes.htm10
-rw-r--r--modules/admin-full/luasrc/view/admin_uci/revert.htm10
-rw-r--r--modules/admin-mini/luasrc/controller/mini/uci.lua8
-rw-r--r--modules/admin-mini/luasrc/view/mini/uci_apply.htm10
-rw-r--r--modules/admin-mini/luasrc/view/mini/uci_changes.htm19
-rw-r--r--modules/admin-mini/luasrc/view/mini/uci_revert.htm10
12 files changed, 81 insertions, 10 deletions
diff --git a/i18n/english/luasrc/i18n/default.en.lua b/i18n/english/luasrc/i18n/default.en.lua
index 3613f10bb..666b7a312 100644
--- a/i18n/english/luasrc/i18n/default.en.lua
+++ b/i18n/english/luasrc/i18n/default.en.lua
@@ -6,6 +6,7 @@ add = 'Add'
addresses = 'Addresses'
aliases = 'Aliases'
all = 'all'
+back = 'back'
administration = 'Administration'
essentials = 'Essentials'
apply = 'Apply'
diff --git a/i18n/english/luasrc/i18n/default.en.xml b/i18n/english/luasrc/i18n/default.en.xml
index cf67c7f80..3c0f270c2 100644
--- a/i18n/english/luasrc/i18n/default.en.xml
+++ b/i18n/english/luasrc/i18n/default.en.xml
@@ -11,6 +11,7 @@
<i18n:msg xml:id="addresses">Addresses</i18n:msg>
<i18n:msg xml:id="aliases">Aliases</i18n:msg>
<i18n:msg xml:id="all">all</i18n:msg>
+<i18n:msg xml:id="back">back</i18n:msg>
<i18n:msg xml:id="administration">Administration</i18n:msg>
<i18n:msg xml:id="essentials">Essentials</i18n:msg>
<i18n:msg xml:id="apply">Apply</i18n:msg>
diff --git a/i18n/german/luasrc/i18n/default.de.lua b/i18n/german/luasrc/i18n/default.de.lua
index 8700c1c9d..24c37eaa9 100644
--- a/i18n/german/luasrc/i18n/default.de.lua
+++ b/i18n/german/luasrc/i18n/default.de.lua
@@ -9,6 +9,7 @@ all = 'alle'
administration = 'Administration'
essentials = 'Vereinfacht'
apply = 'Anwenden'
+back = 'zurück'
basicsettings = 'Grundeinstellungen'
broadcast = 'IPv4-Broadcast'
changes = 'Änderungen'
diff --git a/i18n/german/luasrc/i18n/default.de.xml b/i18n/german/luasrc/i18n/default.de.xml
index 91a067d14..e9c4ca2c0 100644
--- a/i18n/german/luasrc/i18n/default.de.xml
+++ b/i18n/german/luasrc/i18n/default.de.xml
@@ -16,6 +16,7 @@
<i18n:msg xml:id="apply">Anwenden</i18n:msg>
+<i18n:msg xml:id="back">zurück</i18n:msg>
<i18n:msg xml:id="basicsettings">Grundeinstellungen</i18n:msg>
<i18n:msg xml:id="broadcast">IPv4-Broadcast</i18n:msg>
diff --git a/modules/admin-full/luasrc/controller/admin/uci.lua b/modules/admin-full/luasrc/controller/admin/uci.lua
index 53b3464f6..d313128ad 100644
--- a/modules/admin-full/luasrc/controller/admin/uci.lua
+++ b/modules/admin-full/luasrc/controller/admin/uci.lua
@@ -15,12 +15,14 @@ module("luci.controller.admin.uci", package.seeall)
function index()
local i18n = luci.i18n.translate
+ local redir = luci.http.formvalue("redir", true) or
+ luci.dispatcher.build_url(unpack(luci.dispatcher.context.request))
entry({"admin", "uci"}, nil, i18n("config"))
- entry({"admin", "uci", "changes"}, call("action_changes"), i18n("changes"), 40)
- entry({"admin", "uci", "revert"}, call("action_revert"), i18n("revert"), 30)
- entry({"admin", "uci", "apply"}, call("action_apply"), i18n("apply"), 20)
- entry({"admin", "uci", "saveapply"}, call("action_apply"), i18n("saveapply"), 10)
+ entry({"admin", "uci", "changes"}, call("action_changes"), i18n("changes"), 40).query = {redir=redir}
+ entry({"admin", "uci", "revert"}, call("action_revert"), i18n("revert"), 30).query = {redir=redir}
+ entry({"admin", "uci", "apply"}, call("action_apply"), i18n("apply"), 20).query = {redir=redir}
+ entry({"admin", "uci", "saveapply"}, call("action_apply"), i18n("saveapply"), 10).query = {redir=redir}
end
function convert_changes(changes)
diff --git a/modules/admin-full/luasrc/view/admin_uci/apply.htm b/modules/admin-full/luasrc/view/admin_uci/apply.htm
index 8aa09c641..a908b6a8b 100644
--- a/modules/admin-full/luasrc/view/admin_uci/apply.htm
+++ b/modules/admin-full/luasrc/view/admin_uci/apply.htm
@@ -13,6 +13,11 @@ $Id$
-%>
<%+header%>
+<div>
+<a href="<%=luci.http.formvalue("redir")%>">&lt;&lt; <%:back%></a>
+<br />
+<br />
+</div>
<h2><a id="content" name="content"><%:config%></a></h2>
<p><%:uci_applied%>:</p>
<code><%=(changes or "-")%>
@@ -26,4 +31,9 @@ while line do
end
fp:close()
%></code>
+<div>
+<a href="<%=luci.http.formvalue("redir")%>">&lt;&lt; <%:back%></a>
+<br />
+<br />
+</div>
<%+footer%> \ No newline at end of file
diff --git a/modules/admin-full/luasrc/view/admin_uci/changes.htm b/modules/admin-full/luasrc/view/admin_uci/changes.htm
index da0d9f11c..6375aaf71 100644
--- a/modules/admin-full/luasrc/view/admin_uci/changes.htm
+++ b/modules/admin-full/luasrc/view/admin_uci/changes.htm
@@ -13,6 +13,11 @@ $Id$
-%>
<%+header%>
+<div>
+<a href="<%=luci.http.formvalue("redir")%>">&lt;&lt; <%:back%></a>
+<br />
+<br />
+</div>
<h2><a id="content" name="content"><%:config%></a></h2>
<h3><%:changes%></h3>
<code><%=changes%></code>
@@ -26,4 +31,9 @@ $Id$
<form class="inline" method="get" action="<%=controller%>/admin/uci/revert">
<input type="submit" value="<%:revert%>" />
</form>
+
+<div>
+<br />
+<a href="<%=luci.http.formvalue("redir")%>">&lt;&lt; <%:back%></a>
+</div>
<%+footer%>
diff --git a/modules/admin-full/luasrc/view/admin_uci/revert.htm b/modules/admin-full/luasrc/view/admin_uci/revert.htm
index 553ec7454..e8515dc41 100644
--- a/modules/admin-full/luasrc/view/admin_uci/revert.htm
+++ b/modules/admin-full/luasrc/view/admin_uci/revert.htm
@@ -13,7 +13,17 @@ $Id$
-%>
<%+header%>
+<div>
+<a href="<%=luci.http.formvalue("redir")%>">&lt;&lt; <%:back%></a>
+<br />
+<br />
+</div>
<h2><a id="content" name="content"><%:config%></a></h2>
<p><%:uci_reverted%>:</p>
<code><%=(changes or "-")%></code>
+<div>
+<a href="<%=luci.http.formvalue("redir")%>">&lt;&lt; <%:back%></a>
+<br />
+<br />
+</div>
<%+footer%> \ No newline at end of file
diff --git a/modules/admin-mini/luasrc/controller/mini/uci.lua b/modules/admin-mini/luasrc/controller/mini/uci.lua
index 4e920563a..4687c839d 100644
--- a/modules/admin-mini/luasrc/controller/mini/uci.lua
+++ b/modules/admin-mini/luasrc/controller/mini/uci.lua
@@ -16,11 +16,13 @@ module("luci.controller.mini.uci", package.seeall)
function index()
local i18n = luci.i18n.translate
+ local redir = luci.http.formvalue("redir", true) or
+ luci.dispatcher.build_url(unpack(luci.dispatcher.context.request))
entry({"mini", "uci"}, nil, i18n("config"))
- entry({"mini", "uci", "changes"}, call("action_changes"), i18n("changes"), 30)
- entry({"mini", "uci", "revert"}, call("action_revert"), i18n("revert"), 20)
- entry({"mini", "uci", "saveapply"}, call("action_apply"), i18n("saveapply"), 10)
+ entry({"mini", "uci", "changes"}, call("action_changes"), i18n("changes"), 30).query = {redir=redir}
+ entry({"mini", "uci", "revert"}, call("action_revert"), i18n("revert"), 20).query = {redir=redir}
+ entry({"mini", "uci", "saveapply"}, call("action_apply"), i18n("saveapply"), 10).query = {redir=redir}
end
function convert_changes(changes)
diff --git a/modules/admin-mini/luasrc/view/mini/uci_apply.htm b/modules/admin-mini/luasrc/view/mini/uci_apply.htm
index 8aa09c641..a908b6a8b 100644
--- a/modules/admin-mini/luasrc/view/mini/uci_apply.htm
+++ b/modules/admin-mini/luasrc/view/mini/uci_apply.htm
@@ -13,6 +13,11 @@ $Id$
-%>
<%+header%>
+<div>
+<a href="<%=luci.http.formvalue("redir")%>">&lt;&lt; <%:back%></a>
+<br />
+<br />
+</div>
<h2><a id="content" name="content"><%:config%></a></h2>
<p><%:uci_applied%>:</p>
<code><%=(changes or "-")%>
@@ -26,4 +31,9 @@ while line do
end
fp:close()
%></code>
+<div>
+<a href="<%=luci.http.formvalue("redir")%>">&lt;&lt; <%:back%></a>
+<br />
+<br />
+</div>
<%+footer%> \ No newline at end of file
diff --git a/modules/admin-mini/luasrc/view/mini/uci_changes.htm b/modules/admin-mini/luasrc/view/mini/uci_changes.htm
index 591ae6998..89df99dab 100644
--- a/modules/admin-mini/luasrc/view/mini/uci_changes.htm
+++ b/modules/admin-mini/luasrc/view/mini/uci_changes.htm
@@ -13,14 +13,27 @@ $Id$
-%>
<%+header%>
+<div>
+<a href="<%=luci.http.formvalue("redir")%>">&lt;&lt; <%:back%></a>
+<br />
+<br />
+</div>
<h2><a id="content" name="content"><%:config%></a></h2>
<h3><%:changes%></h3>
<code><%=changes%></code>
<br /><br />
-<form class="inline" method="get" action="<%=controller%>/mini/uci/apply">
+<form class="inline" method="get" action="<%=controller%>/admin/uci/apply">
<input type="submit" value="<%:apply%>" />
</form>
-<form class="inline" method="get" action="<%=controller%>/mini/uci/revert">
+<form class="inline" method="get" action="<%=controller%>/admin/uci/saveapply">
+ <input type="submit" value="<%:saveapply%>" />
+</form>
+<form class="inline" method="get" action="<%=controller%>/admin/uci/revert">
<input type="submit" value="<%:revert%>" />
</form>
-<%+footer%>
+
+<div>
+<br />
+<a href="<%=luci.http.formvalue("redir")%>">&lt;&lt; <%:back%></a>
+</div>
+<%+footer%> \ No newline at end of file
diff --git a/modules/admin-mini/luasrc/view/mini/uci_revert.htm b/modules/admin-mini/luasrc/view/mini/uci_revert.htm
index 553ec7454..e8515dc41 100644
--- a/modules/admin-mini/luasrc/view/mini/uci_revert.htm
+++ b/modules/admin-mini/luasrc/view/mini/uci_revert.htm
@@ -13,7 +13,17 @@ $Id$
-%>
<%+header%>
+<div>
+<a href="<%=luci.http.formvalue("redir")%>">&lt;&lt; <%:back%></a>
+<br />
+<br />
+</div>
<h2><a id="content" name="content"><%:config%></a></h2>
<p><%:uci_reverted%>:</p>
<code><%=(changes or "-")%></code>
+<div>
+<a href="<%=luci.http.formvalue("redir")%>">&lt;&lt; <%:back%></a>
+<br />
+<br />
+</div>
<%+footer%> \ No newline at end of file