* luci-trunk: huge xhtml, css and accessibility improvement patch - thanks Alina!
[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 rowcnt = 1
17 function rowstyle()
18         rowcnt = rowcnt + 1
19         return (rowcnt % 2) + 1
20 end
21 -%>
22 <%+header%>
23 <h2><a id="content" name="content"><%:system%></a></h2>
24 <h3><%:a_s_packages%></h3>
25
26 <br />
27
28 <% if install or remove or update or upgrade then %>
29 <div class="code"><strong><%:status%>:</strong><br />
30 <% if update then %>
31         <%:a_s_packages_update%>: <% if update == 0 then %><span class="ok"><%:ok%></span><% else %><span class="error"><%:error%> (<%:code%> <%=update%>)</span><% end %><br />
32 <% end %>
33 <% if upgrade then%>
34         <%:a_s_packages_upgrade%>: <% if upgrade == 0 then %><span class="ok"><%:ok%></span><% else %><span class="error"><%:error%> (<%:code%> <%=upgrade%>)</span><% end %><br />
35 <% end %>
36 <% if install then for k,v in pairs(install) do %>
37         <%:a_s_packages_install%> '<%=k%>': <% if v == 0 then %><span class="ok"><%:ok%></span><% else %><span class="error"><%:error%> (<%:code%> <%=v%>)</span><% end %><br />
38 <% end end %>
39 <% if remove then for k,v in pairs(remove) do %>
40         <%:a_s_packages_remove%> '<%=k%>': <% if v == 0 then %><span class="ok"><%:ok%></span><% else %><span class="error"><%:error%> (<%:code%> <%=v%>)</span><% end %><br />
41 <% end end %>
42 </div>
43 <br />
44 <% end %>
45
46 <form method="post" action="<%=REQUEST_URI%>">
47         <div class="cbi-map">
48                 <fieldset class="cbi-section">
49                         <ul>
50                                 <li><a href="<%=REQUEST_URI%>/ipkg"><%:a_s_packages_ipkg%></a></li>
51                                 <li><a href="<%=REQUEST_URI%>?update=1"><%:a_s_packages_updatelist%></a></li>
52                                 <li><a href="<%=REQUEST_URI%>?upgrade=1"><%:a_s_packages_upgrade%></a></li>
53                         </ul>
54                         <br />
55                         <fieldset class="cbi-section-node">
56                         <div class="cbi-value">
57                                 <label class="cbi-value-title"><%:a_s_packages_installurl%>:</label>
58                                 <div class="cbi-value-field">
59                                         <input type="text" name="url" size="30" value="" />
60                                         <input class="cbi-input-save" type="submit" name="submit" value="<%:ok%>" />
61                                 </div>
62                         </div>
63
64                         <div class="cbi-value">
65                                 <label class="cbi-value-title"><%:filter%>:</label>
66                                 <div class="cbi-value-field">
67                                         <input type="text" name="query" size="20" value="<%=query%>" />
68                                         <input type="submit" class="cbi-input-find" name="search" value="<%:a_s_packages_search%>" />
69                                 </div>
70                         </div>
71
72                         <table class="cbi-section-table">
73                                 <tr class="cbi-section-table-titles">
74                                         <th class="cbi-section-table-cell"><%:a_s_packages_name%></th>
75                                         <th class="cbi-section-table-cell"><%:version%></th>
76                                         <th class="cbi-section-table-cell"><%:install%></th>
77                                         <th class="cbi-section-table-cell"><%:delete%></th>
78                                         <th class="cbi-section-table-cell"><%:descr%></th>
79                                 </tr>
80                                 <% for k, pkg in pairs(pkgs) do %>
81                                 <tr class="cbi-section-table-row cbi-rowstyle-<%=rowstyle()%>">
82                                         <td><%=luci.util.pcdata(pkg.Package)%></td>
83                                         <td><%=luci.util.pcdata(pkg.Version)%></td>
84                                         <td><% if not pkg.Status or not pkg.Status.installed then %><input type="checkbox" name="install.<%=pkg.Package%>" value="1" /><% else %><%:installed%><% end %></td>
85                                         <td><% if pkg.Status and pkg.Status.installed then %><input type="checkbox" name="remove.<%=pkg.Package%>" value="1" /><% else %><%:notinstalled%><% end %></td>
86                                         <td><%=luci.util.pcdata(pkg.Description)%></td>
87                                 </tr>
88                                 <% end %>
89                         </table>
90
91                         <br />
92
93                         <div style="text-align: right">
94                                 <input type="submit" class="cbi-input-apply" name="submit" value="<%:a_s_packages_do%>" />
95                         </div>
96                 </fieldset></fieldset>
97         </div>
98 </form>
99 <%+footer%>