summaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/plugins/UpdateCenterMatrix.java5
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/updatecenter_helper.rb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_list.html.erb0
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb52
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb35
5 files changed, 58 insertions, 40 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/plugins/UpdateCenterMatrix.java b/sonar-server/src/main/java/org/sonar/server/plugins/UpdateCenterMatrix.java
index a5c698539c3..82c1cc773c1 100644
--- a/sonar-server/src/main/java/org/sonar/server/plugins/UpdateCenterMatrix.java
+++ b/sonar-server/src/main/java/org/sonar/server/plugins/UpdateCenterMatrix.java
@@ -125,10 +125,7 @@ public final class UpdateCenterMatrix {
Version pluginVersion = entry.getValue();
Release pluginRelease = plugin.getRelease(pluginVersion);
- if (pluginRelease == null) {
- update.addIncompatiblePlugin(plugin);
-
- } else if (pluginRelease.supportSonarVersion(sonarRelease.getVersion())) {
+ if (pluginRelease != null && pluginRelease.supportSonarVersion(sonarRelease.getVersion())) {
update.addCompatiblePlugin(plugin);
} else {
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/updatecenter_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/updatecenter_helper.rb
index 04139237bee..856025ab7a7 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/updatecenter_helper.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/updatecenter_helper.rb
@@ -20,7 +20,11 @@
module UpdatecenterHelper
def release_date(date)
- Time.at(date.getTime() / 1000).strftime('%b %e, %Y')
+ if date
+ Time.at(date.getTime() / 1000).strftime('%b %e, %Y')
+ else
+ nil
+ end
end
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_list.html.erb
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_list.html.erb
+++ /dev/null
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb
index e4ccf1b0b5a..297999c8940 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb
@@ -49,48 +49,54 @@ function installPlugin(key) {
<td>
<%= plugin.getDescription() %>
<div id="detail-<%= plugin.getKey() -%>" style="display:none">
+ <table class="spaced width100">
<% if plugin.getLicense() %>
- <p>
- License: <%= h(plugin.getLicense()) %>
- </p>
+ <tr>
+ <td class="thin nowrap">License: </td><td><%= h(plugin.getLicense()) %></td>
+ </tr>
<% end %>
<% if plugin.getOrganization() %>
- <p>
- By: <%= link_to_if plugin.getOrganizationUrl(), plugin.getOrganization(), plugin.getOrganizationUrl(), :class=>'external' %>
- </p>
+ <tr>
+ <td class="thin nowrap">Author: </td><td><%= link_to_if plugin.getOrganizationUrl(), plugin.getOrganization(), plugin.getOrganizationUrl(), :class=>'external' %></td>
+ </tr>
<% 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>
+ <tr>
+ <td class="thin nowrap">Links: </td>
+ <td>
+ <%= link_to 'Homepage', plugin.getHomepageUrl(), :class=>'external' if plugin.getHomepageUrl() -%>
+ <%= link_to "Issue Tracker", plugin.getIssueTrackerUrl(), :class=>'external' if plugin.getIssueTrackerUrl() -%>
+ </td>
+ </tr>
+ <% end %>
<%
- end
if update.isCompatible()
%>
- <p>
- Version: <%= update.getRelease().getVersion() -%>
- </p>
- <div>
+ <tr>
+ <% date=release_date(update.getRelease().getDate()) %>
+ <td class="thin nowrap">Version: </td>
+ <td><%= update.getRelease().getVersion() -%> <%= "(#{date})" if date -%></td>
+ </tr>
+ <tr>
+ <td colspan="2">
<% 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" id="install-<%= plugin.getKey() -%>">
<input type="submit" value="Install" onClick="return installPlugin('<%= plugin.getKey() -%>')" id="submit-<%= plugin.getKey() -%>"></input>
</form>
- </div>
+ </td>
+ </tr>
<% elsif update.requiresSonarUpgrade
%>
- <p>
- Version: <%= update.getRelease().getVersion() -%> (not compatible, needs Sonar upgrade)
- </p>
+ <tr>
+ <td class="thin nowrap">Last version: </td>
+ <td><%= update.getRelease().getVersion() -%> (<%= image_tag 'warning.png' -%> Not compatible, requires Sonar upgrade)</td>
+ </tr>
<%
end
%>
+ </table>
</div>
</td>
</tr>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb
index 58f7fca5504..432ad359a5a 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb
@@ -1,4 +1,13 @@
- <ul class="tabs">
+ <script>
+function upgradePlugin(key) {
+ var button=$('upgrade-submit-' + key);
+ button.disable();
+ button.writeAttribute('value', 'Upgrading');
+ return true;
+}
+</script>
+
+<ul class="tabs">
<li>
<a href="<%= url_for :action => 'index' -%>">Installed</a>
</li>
@@ -21,7 +30,7 @@
<tbody>
<% if @updates_by_plugin.empty? %>
<tr class="even">
- <td colspan="2">No updates</td>
+ <td colspan="2">All of your plugins are up to date.</td>
</tr>
<% end %>
<% @updates_by_plugin.keys.each do |plugin|
@@ -38,23 +47,25 @@
<td><%= link_to 'Release Notes', release.getChangelogUrl(), :class => 'external' if release.getChangelogUrl() %></td>
<td>
<% if update.isIncompatible() %>
- <%= image_tag 'warning.png' -%> Not compatible
+ <%= image_tag 'warning.png' -%> Incompatible
<% elsif update.requiresSonarUpgrade %>
- <%= image_tag 'warning.png' -%> Not compatible, requires to upgrade system
+ <%= image_tag 'warning.png' -%> Incompatible, requires to upgrade system
<% end %>
</td>
</tr>
<%
end
%>
+ <% if @last_compatible[plugin.getKey()] %>
<tr class="<%= css -%>">
- <td> </td>
- <td colspan="5">
- <form method="post" action="<%= ApplicationController.root_context -%>/updatecenter/install?from=updates&key=<%= plugin.getKey() -%>&version=<%= @last_compatible[plugin.getKey()] -%>" style="display: inline-block">
- <input type="submit" value="Upgrade to <%= @last_compatible[plugin.getKey()] -%>"></input>
- </form>
- </td>
- </tr>
+ <td> </td>
+ <td colspan="5">
+ <form method="post" id="upgrade-form-<%= plugin.getKey() -%>" action="<%= ApplicationController.root_context -%>/updatecenter/install?from=updates&key=<%= plugin.getKey() -%>&version=<%= @last_compatible[plugin.getKey()] -%>" style="display: inline-block">
+ <input type="submit" id="upgrade-submit-<%= plugin.getKey() -%>" value="Upgrade to <%= @last_compatible[plugin.getKey()] -%>" onClick="return upgradePlugin('<%= plugin.getKey() -%>')"></input>
+ </form>
+ </td>
+ </tr>
+ <% end %>
<%
end
%>
@@ -94,7 +105,7 @@
<td> </td>
<td colspan="3">
<% if update.isIncompatible() %>
- <%= image_tag 'warning.png' -%> Not compatible plugins must be uninstalled before upgrading system:
+ <%= image_tag 'warning.png' -%> Incompatible plugins must be uninstalled before upgrading system:
<%= update.getIncompatiblePlugins().map{|plugin| plugin.getName()}.sort.join(',') -%>
<% end %>
<% if update.requiresPluginUpgrades() %>