--- /dev/null
+<script type="text/javascript">
+ function showPlugin(key) {
+ if ($('detail-' + key).visible()) {
+ $('detail-' + key).hide();
+ } else {
+ $('detail-' + key).show();
+ }
+ return false;
+ }
+</script>
+<%= render :partial => 'updatecenter/common' %>
+
<script>
- function showPlugin(key) {
- $('show-' + key).hide();
- $('detail-' + key).show();
- return false;
- }
function checkTermsConditions(key) {
var tc=$('tc-' + key)
if (tc!=null && !tc.checked) {
}
</script>
-
-<% if @downloads.size>0 %>
-<form action="<%= ApplicationController.root_context -%>/plugins/cancel" method="post" class="warning">
+<% if @downloads.size > 0 %>
+<form action="<%= ApplicationController.root_context -%>/updatecenter/cancel" method="post" class="warning">
<p>Sonar needs to be restarted in order to install the following plugins: <ul>
- <% @downloads.each do |download| -%>
+ <% @downloads.each do |download| %>
<li><%= download -%></li>
<% end %>
</ul>
<input type="submit" value="Cancel downloads"></input>
</p>
</form>
-<% end %>
\ No newline at end of file
+<% end %>
<% else %>
Updated on <%= @center.getDate() %>. <%= link_to 'Refresh', :action => action, :reload => true %>
<% end %>
-</p>
\ No newline at end of file
+</p>
<%= render :partial => 'updatecenter/downloads' %>
+<table class="data width100">
+ <thead>
+ </thead>
+ <tbody>
<% if @center %>
<% @updates_by_category.keys.sort_by{|c| c.downcase }.each do |category|
updates=@updates_by_category[category]
%>
- <table class="data width100" id="category-<%= u category -%>">
- <thead>
- <tr>
- <th colspan="2"><h2><%= category -%></h2></th>
- </tr>
- </thead>
- <tbody>
- <% updates.each do |update|
- plugin=update.getPlugin()
- %>
- <tr class="<%= cycle('even','odd', :name => category) -%>">
- <td width="10%" nowrap>
- <b><%= h(plugin.getName()) -%></b>
- </td>
- <td>
- <%= plugin.getDescription() %> <a href="#" onClick="showPlugin('<%= plugin.getKey() -%>');" id="show-<%= plugin.getKey() -%>">More</a>
- <div id="detail-<%= plugin.getKey() -%>" style="display:none">
- <% if plugin.getLicense() %>
- <p>
- License: <%= h(plugin.getLicense()) %>
- </p>
- <% end %>
- <% if plugin.getOrganization() %>
- <p>
- By: <%= link_to_if plugin.getOrganizationUrl(), plugin.getOrganization(), plugin.getOrganizationUrl(), :class=>'external' %>
- </p>
- <% end %>
- <% if plugin.getHomepageUrl() || plugin.getIssueTrackerUrl() %>
+ <tr>
+ <td colspan="2"><h2><%= category -%></td>
+ </tr>
+ <% updates.sort_by{|c| c.getPlugin().getName()}.each do |update|
+ plugin=update.getPlugin()
+ %>
+ <tr class="<%= cycle('even','odd', :name => category) -%>">
+ <td width="10%" nowrap>
+ <b><a href="#plugin" onClick="showPlugin('<%= plugin.getKey() -%>');"><%= h(plugin.getName()) -%></a></b>
+ </td>
+ <td>
+ <%= plugin.getDescription() %>
+ <div id="detail-<%= plugin.getKey() -%>" style="display:none">
+ <% if plugin.getLicense() %>
<p>
- <% if plugin.getHomepageUrl() %>
- <%= link_to 'Plugin details', plugin.getHomepageUrl(), :class=>'external' %> |
- <% end %>
- <% if plugin.getIssueTrackerUrl() %>
- <%= link_to "Issue Tracker", plugin.getIssueTrackerUrl(), :class=>'external' %>
- <% end %>
+ License: <%= h(plugin.getLicense()) %>
</p>
- <%
- end
- if update.isCompatible()
- %>
+ <% end %>
+ <% if plugin.getOrganization() %>
<p>
- Version: <%= update.getRelease().getVersion() -%>
+ By: <%= link_to_if plugin.getOrganizationUrl(), plugin.getOrganization(), plugin.getOrganizationUrl(), :class=>'external' %>
</p>
- <div>
- <% if plugin.getTermsConditionsUrl() %>
- <input type="checkbox" id="tc-<%= plugin.getKey() -%>"></input> I accept the <%= link_to 'Terms and Conditions', plugin.getTermsConditionsUrl(), :class => 'external' %>
- <% end %>
- <form method="post" action="<%= ApplicationController.root_context -%>/updatecenter/install?from=available&key=<%= plugin.getKey() -%>&version=<%= update.getRelease().getVersion() -%>" style="display: inline-block">
- <input type="submit" value="Install" onClick="return checkTermsConditions('<%= plugin.getKey() -%>')"></input>
- </form>
-
- </div>
- <% elsif update.requiresSonarUpgrade
- %>
- <p>
- Version: <%= update.getRelease().getVersion() -%> (not compatible, needs Sonar upgrade)
- </p>
- <%
- end
- %>
+ <% end %>
+ <% if plugin.getHomepageUrl() || plugin.getIssueTrackerUrl() %>
+ <p>
+ <% if plugin.getHomepageUrl() %>
+ <%= link_to 'Plugin details', plugin.getHomepageUrl(), :class=>'external' %> |
+ <% end %>
+ <% if plugin.getIssueTrackerUrl() %>
+ <%= link_to "Issue Tracker", plugin.getIssueTrackerUrl(), :class=>'external' %>
+ <% end %>
+ </p>
+ <%
+ end
+ if update.isCompatible()
+ %>
+ <p>
+ Version: <%= update.getRelease().getVersion() -%>
+ </p>
+ <div>
+ <% if plugin.getTermsConditionsUrl() %>
+ <input type="checkbox" id="tc-<%= plugin.getKey() -%>"></input> I accept the <%= link_to 'Terms and Conditions', plugin.getTermsConditionsUrl(), :class => 'external' %>
+ <% end %>
+ <form method="post" action="<%= ApplicationController.root_context -%>/updatecenter/install?from=available&key=<%= plugin.getKey() -%>&version=<%= update.getRelease().getVersion() -%>" style="display: inline-block">
+ <input type="submit" value="Install" onClick="return checkTermsConditions('<%= plugin.getKey() -%>')"></input>
+ </form>
</div>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table><br/>
+ <% elsif update.requiresSonarUpgrade
+ %>
+ <p>
+ Version: <%= update.getRelease().getVersion() -%> (not compatible, needs Sonar upgrade)
+ </p>
+ <%
+ end
+ %>
+ </div>
+ </td>
+ </tr>
+ <% end %>
<% end %>
<% end %>
+</tbody>
+</table><br/>
+
<%= render :partial => 'updatecenter/status', :locals => {:action => 'available' } %>
-</div>
\ No newline at end of file
+</div>
-<style type="text/css">
-.plugin {
- margin-top: 22px;
- padding: 5px;
- border: 1px solid #ddd;
-}
-
-.plugin h3 {
- margin-left: 5px;
-}
-
-.plugin p {
- padding: 5px;
-}
-</style>
-
<ul class="tabs">
<li>
<a href="<%= url_for :action => 'index' -%>" class="selected">Installed</a>
<div class="tabs-panel">
+<%= render :partial => 'updatecenter/common' %>
+
<h2>User-installed plugins</h2>
-<table class="width100" id="user-plugins">
- <tr>
- <td width="1%" nowrap class="column first">
- <table class="data">
- <thead>
- <tr>
- <th>Plugin</th>
- <th>Version</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <% if @user_plugins.empty? %>
- <tr class="even"><td colspan="5">No plugins</td></tr>
- <% else
- @user_plugins.each do |plugin|
- %>
- <tr class="select <%= cycle('even', 'odd', :name => 'user') -%>" id="select_<%= plugin.plugin_key -%>">
- <td><a href="#" onclick="showPlugin('<%= plugin.plugin_key -%>')"><%= h(plugin.name) -%></a></td>
- <td><%= plugin.version || '-' -%></td>
- <td><%= plugin.description -%></td>
- </tr>
- <% end %>
- <% end %>
- </tbody>
- </table>
- </td>
- <td class="column">
- <% @user_plugins.each do |plugin| %>
- <div class="plugin" id="plugin_<%= plugin.plugin_key -%>" style="display: none;">
- <h3><%= h(plugin.name) -%> <%= plugin.version || '-' -%></h3>
- <p><%= plugin.description -%></p>
+<table class="data">
+ <thead>
+ <tr>
+ <th>Plugin</th>
+ <th>Version</th>
+ <th>Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ <% if @user_plugins.empty? %>
+ <tr class="even"><td colspan="5">No plugins</td></tr>
+ <% else
+ @user_plugins.each do |plugin|
+ %>
+ <tr class="select <%= cycle('even', 'odd', :name => 'user') -%>" id="select_<%= plugin.plugin_key -%>">
+ <td><b><a href="#" onclick="showPlugin('<%= plugin.plugin_key -%>')"><%= h(plugin.name) -%></a></b></td>
+ <td><%= plugin.version || '-' -%></td>
+ <td>
+ <%= plugin.description -%>
+
+ <div id="detail-<%= plugin.plugin_key -%>" style="display:none">
<p>
- <% if plugin.homepage %>
- <%= link_to 'Homepage', plugin.homepage, :class => 'external' -%><br/>
- <% end %>
- License: <%= plugin.license -%><br/>
- <% if plugin.organization %>
- Author: <%= link_to_if plugin.organization_url, plugin.organization, plugin.organization_url, :class=>'external' -%><br/>
- <% end %>
- </p>
- </div>
+ License: <%= plugin.license -%><br/>
+ <% if plugin.organization %>
+ By: <%= link_to_if plugin.organization_url, plugin.organization, plugin.organization_url, :class=>'external' -%><br/>
+ <% end %>
+ <% if plugin.homepage %>
+ <%= link_to 'Details', plugin.homepage, :class => 'external' -%><br/>
+ <% end %>
+ </p>
+ </div>
+ </td>
+ </tr>
<% end %>
- </td>
- </tr>
+ <% end %>
+ </tbody>
</table>
<div class="break30"> </div>
@core_plugins.each do |plugin|
%>
<tr class="<%= cycle('even','odd', :name => 'core') -%>" id="<%= u plugin.plugin_key -%>">
- <td width="1%" nowrap><b><%= plugin.name -%></b></td>
+ <td width="1%" nowrap><b><%= plugin.name -%></b></td>
<td><%= plugin.description %></td>
</tr>
<% end %>
</div>
-<script type="text/javascript">
- function showPlugin(id) {
- $$('.plugin').each(function(element) {
- element.hide();
- });
- $$('.select').each(function(element) {
- element.removeClassName('selected');
- });
- $('plugin_' + id).show();
- $('select_' + id).addClassName('selected');
- return false;
- }
-</script>