@@ -1,63 +1,63 | |||||
1 | <%= title l(:label_plugins) %> |
|
1 | <%= title l(:label_plugins) %> | |
2 |
|
2 | |||
3 | <% if @plugins.any? %> |
|
3 | <% if @plugins.any? %> | |
4 | <table class="list plugins"> |
|
4 | <table class="list plugins"> | |
5 | <% @plugins.each do |plugin| %> |
|
5 | <% @plugins.each do |plugin| %> | |
6 | <tr id="plugin-<%= plugin.id %>" class="<%= cycle('odd', 'even') %>"> |
|
6 | <tr id="plugin-<%= plugin.id %>" class="<%= cycle('odd', 'even') %>"> | |
7 | <td class="name"><span class="name"><%=h plugin.name %></span> |
|
7 | <td class="name"><span class="name"><%=h plugin.name %></span> | |
8 | <%= content_tag('span', h(plugin.description), :class => 'description') unless plugin.description.blank? %> |
|
8 | <%= content_tag('span', h(plugin.description), :class => 'description') unless plugin.description.blank? %> | |
9 | <%= content_tag('span', link_to(h(plugin.url), plugin.url), :class => 'url') unless plugin.url.blank? %> |
|
9 | <%= content_tag('span', link_to(h(plugin.url), plugin.url), :class => 'url') unless plugin.url.blank? %> | |
10 | </td> |
|
10 | </td> | |
11 | <td class="author"><%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %></td> |
|
11 | <td class="author"><%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %></td> | |
12 | <td class="version"><span class="icon"><%= plugin.version %></span></td> |
|
12 | <td class="version"><span class="icon"><%= plugin.version %></span></td> | |
13 | <td class="configure"><%= link_to(l(:button_configure), plugin_settings_path(plugin)) if plugin.configurable? %></td> |
|
13 | <td class="configure"><%= link_to(l(:button_configure), plugin_settings_path(plugin)) if plugin.configurable? %></td> | |
14 | </tr> |
|
14 | </tr> | |
15 | <% end %> |
|
15 | <% end %> | |
16 | </table> |
|
16 | </table> | |
17 | <p><a href="#" id="check-for-updates"><%= l(:label_check_for_updates) %></a></p> |
|
17 | <p><a href="#" id="check-for-updates"><%= l(:label_check_for_updates) %></a></p> | |
18 | <% else %> |
|
18 | <% else %> | |
19 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
19 | <p class="nodata"><%= l(:label_no_data) %></p> | |
20 | <% end %> |
|
20 | <% end %> | |
21 |
|
21 | |||
22 | <%= javascript_tag do %> |
|
22 | <%= javascript_tag do %> | |
23 | $(document).ready(function(){ |
|
23 | $(document).ready(function(){ | |
24 | $("#check-for-updates").click(function(e){ |
|
24 | $("#check-for-updates").click(function(e){ | |
25 | e.preventDefault(); |
|
25 | e.preventDefault(); | |
26 | $.ajax({ |
|
26 | $.ajax({ | |
27 | dataType: "jsonp", |
|
27 | dataType: "jsonp", | |
28 | url: "http://www.redmine.org/plugins/check_updates", |
|
28 | url: "https://www.redmine.org/plugins/check_updates", | |
29 | data: <%= raw_json plugin_data_for_updates(@plugins) %>, |
|
29 | data: <%= raw_json plugin_data_for_updates(@plugins) %>, | |
30 | timeout: 3000, |
|
30 | timeout: 3000, | |
31 | beforeSend: function(){ |
|
31 | beforeSend: function(){ | |
32 | $('#ajax-indicator').show(); |
|
32 | $('#ajax-indicator').show(); | |
33 | }, |
|
33 | }, | |
34 | success: function(data){ |
|
34 | success: function(data){ | |
35 | $('#ajax-indicator').hide(); |
|
35 | $('#ajax-indicator').hide(); | |
36 | $("table.plugins td.version span").addClass("unknown"); |
|
36 | $("table.plugins td.version span").addClass("unknown"); | |
37 | $.each(data, function(plugin_id, plugin_data){ |
|
37 | $.each(data, function(plugin_id, plugin_data){ | |
38 | var s = $("tr#plugin-"+plugin_id+" td.version span"); |
|
38 | var s = $("tr#plugin-"+plugin_id+" td.version span"); | |
39 | s.removeClass("icon-checked icon-warning unknown"); |
|
39 | s.removeClass("icon-checked icon-warning unknown"); | |
40 | if (plugin_data.url) { |
|
40 | if (plugin_data.url) { | |
41 | if (s.parent("a").length>0) { |
|
41 | if (s.parent("a").length>0) { | |
42 | s.unwrap(); |
|
42 | s.unwrap(); | |
43 | } |
|
43 | } | |
44 | s.addClass("found"); |
|
44 | s.addClass("found"); | |
45 | s.wrap($("<a></a>").attr("href", plugin_data.url).attr("target", "_blank")); |
|
45 | s.wrap($("<a></a>").attr("href", plugin_data.url).attr("target", "_blank")); | |
46 | } |
|
46 | } | |
47 | if (plugin_data.c == s.text()) { |
|
47 | if (plugin_data.c == s.text()) { | |
48 | s.addClass("icon-checked"); |
|
48 | s.addClass("icon-checked"); | |
49 | } else if (plugin_data.c) { |
|
49 | } else if (plugin_data.c) { | |
50 | s.addClass("icon-warning"); |
|
50 | s.addClass("icon-warning"); | |
51 | s.attr("title", "<%= escape_javascript l(:label_latest_compatible_version) %>: "+plugin_data.c); |
|
51 | s.attr("title", "<%= escape_javascript l(:label_latest_compatible_version) %>: "+plugin_data.c); | |
52 | } |
|
52 | } | |
53 | }); |
|
53 | }); | |
54 | $("table.plugins td.version span.unknown").addClass("icon-help").attr("title", "<%= escape_javascript l(:label_unknown_plugin) %>"); |
|
54 | $("table.plugins td.version span.unknown").addClass("icon-help").attr("title", "<%= escape_javascript l(:label_unknown_plugin) %>"); | |
55 | }, |
|
55 | }, | |
56 | error: function(){ |
|
56 | error: function(){ | |
57 | $('#ajax-indicator').hide(); |
|
57 | $('#ajax-indicator').hide(); | |
58 | alert("Unable to retrieve plugin informations from www.redmine.org"); |
|
58 | alert("Unable to retrieve plugin informations from www.redmine.org"); | |
59 | } |
|
59 | } | |
60 | }); |
|
60 | }); | |
61 | }); |
|
61 | }); | |
62 | }); |
|
62 | }); | |
63 | <% end if @plugins.any? %> |
|
63 | <% end if @plugins.any? %> |
General Comments 0
You need to be logged in to leave comments.
Login now