ref: refs/heads/master
commit 70d88691d34a931ba804a3047c0f59faeddedca5
Author: Josef Reidinger >
- <tr>
- <th class="first" width=5%><%=_("Check")%></th>
- <th width=8%><%=_("Kind")%></th>
- <th width=15%><%=_("Name")%></th>
- <th width="100"><%=_("Summary")%></th>
- <% if @permissions[:install] %>
- <th width=15%><%=_("Source")%></th>
- <th class="last" width=5%><%=_("Install")%></th>
- <% else %>
- <th class="last" width=15%><%=_("Source")%></th>
- <% end %>
- </tr>
-
- <% counter=0 %>
- <% for patch_update in @patch_updates %>
-
>
- <td> name=<%="#{patch_update.kind}_#{counter}"%> value=<%=patch_update.resolvable_id%> ></td>
- <%
- # this should go to a helper?
- kinds = { "security" => '/icons/kupdateapplet_red.png',
- "important" => '/icons/kupdateapplet_yellow.png',
- "green" => '/icons/kupdateapplet_green.png',
- "optional" => '/icons/kupdateapplet_optional.png' }
- %>
- <% if kinds.has_key?(patch_update.kind) %>
- <%= image_tag(kinds[patch_update.kind]) %> </td>
- <% else %>
- <td><%=h patch_update.kind %></td>
- <% end %>
+ <tr>
+ <th class="first" width=5%><%=_("Check")%></th>
+ <th width=8%><%=_("Kind")%></th>
+ <th width=15%><%=_("Name")%></th>
+ <th width="100"><%=_("Summary")%></th>
+ <% if @permissions[:install] %>
+ <th width=15%><%=_("Source")%></th>
+ <th class="last" width=5%><%=_("Install")%></th>
+ <% else %>
+ <th class="last" width=15%><%=_("Source")%></th>
+ <% end %>
+ </tr>
+ <%
+ # this should go to a helper?
+ kinds = { "security" => '/icons/kupdateapplet_red.png',
+ "important" => '/icons/kupdateapplet_yellow.png',
+ "green" => '/icons/kupdateapplet_green.png',
+ "optional" => '/icons/kupdateapplet_optional.png' }
+%>
+ <% @patch_updates.each do |patch_update| %>
+ <tr>
+ <td> name=<%="patch_#{patch_update.resolvable_id}" %> value=<%=patch_update.resolvable_id%> ></td>
- <td class="label"><%=h patch_update.name %></td>
- <td class="label"><%=h patch_update.summary %></td>
- <td><%=h patch_update.repo %></td>
- <% if @permissions[:install] %>
- <td><%= link_to image_tag("/icons/system-software-install.png"\
- , :alt => "install", :class=>"icon", :border => "0"),\
- :controller => 'patch_updates', :id => patch_update.resolvable_id,\
- :onclick=>"Element.show('progress')", :method => :post, :action => "install" %></td>
- <% end %>
- </tr>
- <% counter += 1 %>
+ <% if kinds.has_key?(patch_update.kind) %>
+ <td class="icon" > <%= image_tag(kinds[patch_update.kind]) %> </td>
+ <% else %>
+ <td><%=h patch_update.kind %></td>
<% end %>
- <tr><td> ></input></td></tr>
- </table>
+
+ <td class="label"><%=h patch_update.name %></td>
+ <td class="label"><%=h patch_update.summary %></td>
+ <td><%=h patch_update.repo %></td>
+ <% if @permissions[:install] %>
+ <td><%= link_to image_tag("/icons/system-software-install.png"\
+ , :alt => "install", :class=>"icon", :border => "0"),\
+ :controller => 'patch_updates', :id => patch_update.resolvable_id,\
+ :onclick=>"Element.show('progress')", :method => :post, :action => "install" %></td>
+ <% end %>
+ </tr>
+ <% end %>
+</table>
diff --git a/plugins/patch_updates/app/views/patch_updates/index.html.erb b/plugins/patch_updates/app/views/patch_updates/index.html.erb
index d92a5a3..d961632 100644
--- a/plugins/patch_updates/app/views/patch_updates/index.html.erb
+++ b/plugins/patch_updates/app/views/patch_updates/index.html.erb
@@ -1,44 +1,12 @@
<% if @permissions and @patch_updates %>
- <%= javascript_include_tag 'jquery' %>
- <%= javascript_include_tag 'jquery-form' %>
- <%= javascript_include_tag 'application' %>
- <%= javascript_include_tag 'effects.core' %>
- <%= javascript_include_tag 'effects.highlight' %>
- <script type="text/javascript">
+ <%= javascript_include_tag :defaults %>
+ <% javascript_tag do -%>
$(document).ready(function() {
-
$('#All').click(function() {
$("INPUT[type='checkbox']").attr('checked', $('#All').is(':checked'));
});
-
- $('#selector').click(function(){
- var match = document.getElementById("selector").value;
- var counter = document.getElementById("counter").value;
-
- if (match == "all") {
- for(var i = 0; i < counter; i++) {
- try {
- document.getElementById("row_" + i).style.display="";
- } catch(err) {
- alert("error");
- }
- }
- } else {
- for(var i = 0; i < counter; i++) {
- if ( !(document.getElementById(i).name == match + "_" + i) ) {
- try {
- document.getElementById("row_" + i).style.display="none";
- } catch(err) {
- alert("error");
- }
- } else {
- document.getElementById("row_" + i).style.display="";
- }
- }
- }
- });
});
- </script>
+ <% end %>
<style type="text/css">
option[value=security]:before { content:url('/icons/kupdateapplet_red.png'); }
@@ -55,15 +23,16 @@
<p><%=_("Updates available") %></p>
<% end %>
+ <select name="selector" id="selector" size="1">
+ <option value="all">All</option>
+ <option value="security">Security</option>
+ <option value="important">Important</option>
+ <option value="green">Green</option>
+ <option value="optional">Optional</option>
+ </select>
<% form_for :patch_updates, :url => { :action => "install" }, :html => {:id => "patches-form"} do |form| %>
- <select name="selector" id="selector" size="1">
- <option value="all">All</option>
- <option value="security">Security</option>
- <option value="important">Important</option>
- <option value="green">Green</option>
- <option value="optional">Optional</option>
- </select>
- <div id="patch-table"><%= render :partial => "patches"%></div>
+
+ <div id="patchesd"><%= render :partial => "patches"%></div>
<input type="checkbox" name="All" id="All">All</input>
@@ -71,4 +40,12 @@
<a href="/" class="button"><%=_("Back")%></a>
<% end %>
-<% end %>
\ No newline at end of file
+<% end %>
+
+<%= observe_field(:selector,
+ :frequency => 0.1,
+ :update => :patchesd,
+ :url => { :action => :load_filtered },
+ :with => "'value=' + value"
+)
+%>
\ No newline at end of file
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org