all: change most translate statements to new format, some need manual cleanup
[project/luci.git] / modules / admin-full / luasrc / view / admin_system / packages.htm
1 <%#
2 LuCI - Lua Configuration Interface
3 Copyright 2008 Steven Barth <steven@midlink.org>
4 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13
14 -%>
15 <%-
16 local bit = require "bit"
17 local rowcnt = 1
18
19 function rowstyle()
20 rowcnt = rowcnt + 1
21 return (rowcnt % 2) + 1
22 end
23
24 function opkg_error(code)
25 code = bit.rshift(tonumber(code), 8)
26 return translate(
27 'a_s_packages_code%i' % code,
28 '%s %i' % { translate('Code'), code }
29 )
30 end
31 -%>
32 <%+header%>
33 <h2><a id="content" name="content"><%:System%></a></h2>
34 <h3><%:Software%></h3>
35
36 <br />
37
38 <% if install or remove or update or upgrade then %>
39 <div class="code"><strong><%:Status%>:</strong><br />
40 <% if update then %>
41 <%:Package lists updated%>: <% if update == 0 then %><span class="ok"><%:OK%></span><% else %><span class="error"><%:Error%> (<%=opkg_error(update)%>)</span><% end %><br />
42 <% end %>
43 <% if upgrade then%>
44 <%:Upgrade installed packages%>: <% if upgrade == 0 then %><span class="ok"><%:OK%></span><% else %><span class="error"><%:Error%> (<%=opkg_error(upgrade)%>)</span><% end %><br />
45 <% end %>
46 <% if install then for k,v in pairs(install) do %>
47 <%:Install%> '<%=k%>': <% if v == 0 then %><span class="ok"><%:OK%></span><% else %><span class="error"><%:Error%> (<%=opkg_error(v)%>)</span><% end %><br />
48 <% end end %>
49 <% if remove then for k,v in pairs(remove) do %>
50 <%:Remove%> '<%=k%>': <% if v == 0 then %><span class="ok"><%:OK%></span><% else %><span class="error"><%:Error%> (<%=opkg_error(v)%>)</span><% end %><br />
51 <% end end %>
52 </div>
53 <br />
54 <% end %>
55
56 <form method="post" action="<%=REQUEST_URI%>">
57 <div class="cbi-map">
58 <fieldset class="cbi-section">
59 <ul>
60 <li><a href="<%=REQUEST_URI%>/ipkg"><%:Edit package lists and installation targets%></a></li>
61 <li><a href="<%=REQUEST_URI%>?update=1"><%:Update package lists%></a></li>
62 </ul>
63 <br />
64 <fieldset class="cbi-section-node">
65 <div class="cbi-value">
66 <label class="cbi-value-title"><%:Download and install package%>:</label>
67 <div class="cbi-value-field">
68 <input type="text" name="url" size="30" value="" />
69 <input class="cbi-input-save" type="submit" name="submit" value="<%:OK%>" />
70 </div>
71 </div>
72
73 <div class="cbi-value">
74 <label class="cbi-value-title"><%:Filter%>:</label>
75 <div class="cbi-value-field">
76 <input type="text" name="query" size="20" value="<%=query%>" />
77 <input type="submit" class="cbi-input-find" name="search" value="<%:Find package%>" />
78 </div>
79 </div>
80
81 <table class="cbi-section-table">
82 <tr class="cbi-section-table-titles">
83 <th class="cbi-section-table-cell"><%:Package name%></th>
84 <th class="cbi-section-table-cell"><%:Version%></th>
85 <th class="cbi-section-table-cell"><%:Install%></th>
86 <th class="cbi-section-table-cell"><%:Delete%></th>
87 <th class="cbi-section-table-cell"><%:Description%></th>
88 </tr>
89 <% for k, pkg in pairs(pkgs) do %>
90 <tr class="cbi-section-table-row cbi-rowstyle-<%=rowstyle()%>">
91 <td><%=luci.util.pcdata(pkg.Package)%></td>
92 <td><%=luci.util.pcdata(pkg.Version)%></td>
93 <td><% if not pkg.Status or not pkg.Status.installed then %><input type="checkbox" name="install.<%=pkg.Package%>" value="1" /><% else %><%:installed%><% end %></td>
94 <td><% if pkg.Status and pkg.Status.installed then %><input type="checkbox" name="remove.<%=pkg.Package%>" value="1" /><% else %><%:not installed%><% end %></td>
95 <td><%=luci.util.pcdata(pkg.Description)%></td>
96 </tr>
97 <% end %>
98 </table>
99
100 <br />
101
102 <div style="text-align: right">
103 <input type="submit" class="cbi-input-apply" name="submit" value="<%:Perform Actions%>" />
104 </div>
105 </fieldset></fieldset>
106 </div>
107 </form>
108 <%+footer%>