]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-1563: Rename domain to "updatecenter"
authorGodin <mandrikov@gmail.com>
Mon, 25 Oct 2010 12:47:12 +0000 (12:47 +0000)
committerGodin <mandrikov@gmail.com>
Mon, 25 Oct 2010 12:47:12 +0000 (12:47 +0000)
13 files changed:
sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins_controller.rb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/controllers/updatecenter_controller.rb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/plugins/_downloads.html.erb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/plugins/_status.html.erb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/plugins/available.html.erb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/plugins/index.html.erb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/plugins/updates.html.erb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_downloads.html.erb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_status.html.erb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb [new file with mode: 0644]

diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins_controller.rb
deleted file mode 100644 (file)
index ede4810..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2009 SonarSource SA
-# mailto:contact AT sonarsource DOT com
-#
-# Sonar is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# Sonar is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with Sonar; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
-#
-class PluginsController < ApplicationController
-
-  SECTION=Navigation::SECTION_CONFIGURATION
-  before_filter :admin_required
-
-  verify :method => :post, :only => [:cancel, :install], :redirect_to => {:action => :index}
-
-  def index
-    @user_plugins=Plugin.user_plugins
-    @core_plugins=Plugin.core_plugins
-  end
-
-  def updates
-    @downloads=java_facade.getPluginDownloads()
-
-    @center=nil
-    @sonar_updates=[]
-    @plugin_updates=[]
-
-    finder=load_update_finder()
-    if finder
-      @center=finder.getCenter()
-      @sonar_updates=finder.findSonarUpdates()
-      @plugin_updates=finder.findPluginUpdates()
-    end
-  end
-
-  def available
-    @downloads=java_facade.getPluginDownloads()
-    @center=nil
-    @updates_by_category={}
-
-    finder=load_update_finder()
-    if finder
-      @center=finder.getCenter()
-      finder.findAvailablePlugins().each do |update|
-        category=update.getPlugin().getCategory()||''
-        @updates_by_category[category]||=[]
-        @updates_by_category[category]<<update
-      end
-    end
-  end
-
-  def cancel
-    java_facade.cancelPluginDownloads()
-    flash[:notice]="Plugin downloads are canceled."
-    redirect_to :action => 'index'
-  end
-
-  def install
-    key=params[:key]
-    version=params[:version]
-    if key && version
-      begin
-        java_facade.downloadPlugin(key, version)
-      rescue Exception => e
-        flash[:error]=e.message
-      end
-    end
-    redirect_to :action => (params[:from] || 'index')
-  end
-
-  private
-  def load_update_finder
-    @finder=java_facade.getUpdateFinder(params[:reload]=='true')
-  end
-end
\ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/updatecenter_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/updatecenter_controller.rb
new file mode 100644 (file)
index 0000000..28c89ac
--- /dev/null
@@ -0,0 +1,86 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2009 SonarSource SA
+# mailto:contact AT sonarsource DOT com
+#
+# Sonar is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# Sonar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with Sonar; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+#
+class UpdatecenterController < ApplicationController
+
+  SECTION=Navigation::SECTION_CONFIGURATION
+  before_filter :admin_required
+
+  verify :method => :post, :only => [:cancel, :install], :redirect_to => {:action => :index}
+
+  def index
+    @user_plugins=Plugin.user_plugins
+    @core_plugins=Plugin.core_plugins
+  end
+
+  def updates
+    @downloads=java_facade.getPluginDownloads()
+
+    @center=nil
+    @sonar_updates=[]
+    @plugin_updates=[]
+
+    finder=load_update_finder()
+    if finder
+      @center=finder.getCenter()
+      @sonar_updates=finder.findSonarUpdates()
+      @plugin_updates=finder.findPluginUpdates()
+    end
+  end
+
+  def available
+    @downloads=java_facade.getPluginDownloads()
+    @center=nil
+    @updates_by_category={}
+
+    finder=load_update_finder()
+    if finder
+      @center=finder.getCenter()
+      finder.findAvailablePlugins().each do |update|
+        category=update.getPlugin().getCategory()||''
+        @updates_by_category[category]||=[]
+        @updates_by_category[category]<<update
+      end
+    end
+  end
+
+  def cancel
+    java_facade.cancelPluginDownloads()
+    flash[:notice]="Plugin downloads are canceled."
+    redirect_to :action => 'index'
+  end
+
+  def install
+    key=params[:key]
+    version=params[:version]
+    if key && version
+      begin
+        java_facade.downloadPlugin(key, version)
+      rescue Exception => e
+        flash[:error]=e.message
+      end
+    end
+    redirect_to :action => (params[:from] || 'index')
+  end
+
+  private
+  def load_update_finder
+    @finder=java_facade.getUpdateFinder(params[:reload]=='true')
+  end
+end
\ No newline at end of file
index e223aab7811900ea95abd373e6bb3ca8f9554ae9..8a2a24bb8ffccc761cceb9c883554f48ca76156d 100644 (file)
@@ -74,7 +74,7 @@
               <li class="<%= 'selected' if request.request_uri.include?('/settings') -%>"><a href="<%= ApplicationController.root_context -%>/settings/index">Settings</a></li>
               <li class="<%= 'selected' if controller.controller_path=='backup' -%>"><a href="<%= ApplicationController.root_context -%>/backup">Backup</a></li>
               <li class="<%= 'selected' if controller.controller_path=='system' -%>"><a href="<%= ApplicationController.root_context -%>/system">System info</a></li>
-              <li class="<%= 'selected' if controller.controller_path=='plugins' -%>"><a href="<%= ApplicationController.root_context -%>/plugins">Upgrades (BETA)</a></li>
+              <li class="<%= 'selected' if controller.controller_path=='updatecenter' -%>"><a href="<%= ApplicationController.root_context -%>/updatecenter">Upgrades (BETA)</a></li>
             <% end %>
 
         <% end %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/_downloads.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/_downloads.html.erb
deleted file mode 100644 (file)
index 8f9d1e8..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<script>
-  function showPlugin(key) {
-    $('show-' + key).hide();
-    $('detail-' + key).show();
-    return false;
-  }
-  function checkTermsConditions(key) {
-    var tc=$('tc-' + key)
-    if (tc!=null && !tc.checked) {
-      alert('Please accept the Terms and Conditions');
-      return false;
-    }
-    return true;
-  }
-</script>
-
-
-<% if @downloads.size>0 %>
-<form action="<%= ApplicationController.root_context -%>/plugins/cancel" method="post" class="warning">
-<p>Sonar needs to be restarted in order to install the following plugins: <ul>
-  <% @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
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/_status.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/_status.html.erb
deleted file mode 100644 (file)
index 01179af..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<p class="notes">
-  <% if @center.nil? %>
-    <p>Not connected to update center. Please check your internet connection and logs.</p>
-  <% else %>
-    Updated on <%= @center.getDate() %>. <%= link_to 'Refresh', :action => action, :reload => true %>
-  <% end %>
-</p>
\ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/available.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/available.html.erb
deleted file mode 100644 (file)
index 4e2e0e3..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<ul class="tabs">
-  <li>
-    <a href="<%= url_for :action => 'index' -%>">Installed</a>
-  </li>
-  <li>
-    <a href="<%= url_for :action => 'updates' -%>">Updates</a>
-  </li>
-  <li>
-    <a href="<%= url_for :action => 'available' -%>" class="selected">Available</a>
-  </li>
-</ul>
-<div class="tabs-panel">
-
-<%= render :partial => 'plugins/downloads' %>
-
-<% 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() %>
-              <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 -%>/plugins/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
-              %>
-            </div>
-          </td>
-        </tr>
-        <% end %>
-      </tbody>
-    </table><br/>
-  <% end %>
-<% end %>
-<%= render :partial => 'plugins/status', :locals => {:action => 'available' } %>
-</div>
\ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/index.html.erb
deleted file mode 100644 (file)
index c3b8985..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<ul class="tabs">
-<li>
-<a href="<%= url_for :action => 'index' -%>" class="selected">Installed</a>
-</li>
-<li>
-<a href="<%= url_for :action => 'updates' -%>">Updates</a>
-</li>
-<li>
-<a href="<%= url_for :action => 'available' -%>">Available</a>
-</li>
-</ul>
-<div class="tabs-panel">
-
-<h2>User-installed plugins</h2>
-<table class="data width100" id="user-plugins">
-  <thead>
-    <tr>
-      <th>Plugin</th>
-      <th>Version</th>
-      <th>Description</th>
-      <th>Organization</th>
-      <th>Links</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="<%= cycle('even','odd', :name => 'user') -%> id="<%= u plugin.plugin_key -%>">
-          <td width="1%" nowrap><b><%= h(plugin.name) -%></b></td>
-          <td><%= plugin.version || '-'  %></td>
-          <td><%= plugin.description %></td>
-
-          <td>
-            <% if plugin.organization %>
-              <%= link_to_if plugin.organization_url, plugin.organization, plugin.organization_url, :class=>'external'  %>
-            <% end %>
-          </td>
-          <td><%= link_to 'Details', plugin.homepage, :class => 'external' if plugin.homepage %></td>
-        </tr>
-      <%  end %>
-    <%  end %>
-  </tbody>
-</table>
-<div class="break30"> </div>
-
-<h2>System plugins</h2>
-<table class="data width100" id="core-plugins">
-  <thead><tr>
-    <th>Plugin</th>
-    <th>Description</th>
-  </tr></thead>
-  <tbody>
-  <%
-    @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><%= plugin.description %></td>
-    </tr>
-  <% end %>
-  </tbody>
-</table>
-</div>
\ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/updates.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/updates.html.erb
deleted file mode 100644 (file)
index ad470b3..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<ul class="tabs">
-  <li>
-    <a href="<%= url_for :action => 'index' -%>">Installed</a>
-  </li>
-  <li>
-    <a href="<%= url_for :action => 'updates' -%>" class="selected">Updates</a>
-  </li>
-  <li>
-    <a href="<%= url_for :action => 'available' -%>">Available</a>
-  </li>
-</ul>
-<div class="tabs-panel">
-<%= render :partial => 'plugins/downloads' %>
-
-<% if @center %>
-  <table class="data width100" id="plugin-updates">
-    <thead>
-        <tr>
-          <th colspan="3"><h2>User-installed plugins</h2></th>
-        </tr>
-    </thead>
-    <tbody>
-    <% if @plugin_updates.empty? %>
-      <tr class="even">
-        <td colspan="3" >No updates</td>
-      </tr>
-    <% end %>
-    <% @plugin_updates.each do |update|
-    %>
-      <tr class="<%= cycle('even','odd', :name => 'user-plugins') -%>">
-        <td><%= h(update.getPlugin().getName()) -%></td>
-        <td>
-
-        </td>
-        <td>
-
-        </td>
-      </tr>
-    <% end %>
-    </tbody>
-  </table>
-  <br/>
-  <table class="data width100" id="system-updates">
-    <thead>
-        <tr>
-          <th colspan="2"><h2>System</h2></th>
-        </tr>
-    </thead>
-    <tbody>
-    <%
-      if @sonar_updates.empty? %>
-      <tr class="even">
-        <td colspan="3" >No updates</td>
-      </tr>
-    <% end %>
-    <% @sonar_updates.each do |update|
-         sonar_release=update.getRelease()
-    %>
-      <tr class="<%= cycle('even','odd', :name => 'system') -%>">
-        <td>Sonar <%= sonar_release.getVersion() -%></td>
-        <td><%= sonar_release.getDescription() -%></td>
-        <td>
-          <%= link_to 'Release Notes', sonar_release.getChangelogUrl(), :class => 'external' if sonar_release.getChangelogUrl() %> &nbsp;
-          <%= link_to 'Download', sonar_release.getDownloadUrl(), :class => 'external' if sonar_release.getDownloadUrl() %>
-        </td>
-      </tr>
-    <% end %>
-    </tbody>
-  </table>
-  <br/>
-<% end %>
-<%= render :partial => 'plugins/status', :locals => {:action => 'updates' } %>
-</div>
\ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_downloads.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_downloads.html.erb
new file mode 100644 (file)
index 0000000..8f9d1e8
--- /dev/null
@@ -0,0 +1,28 @@
+<script>
+  function showPlugin(key) {
+    $('show-' + key).hide();
+    $('detail-' + key).show();
+    return false;
+  }
+  function checkTermsConditions(key) {
+    var tc=$('tc-' + key)
+    if (tc!=null && !tc.checked) {
+      alert('Please accept the Terms and Conditions');
+      return false;
+    }
+    return true;
+  }
+</script>
+
+
+<% if @downloads.size>0 %>
+<form action="<%= ApplicationController.root_context -%>/plugins/cancel" method="post" class="warning">
+<p>Sonar needs to be restarted in order to install the following plugins: <ul>
+  <% @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
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_status.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_status.html.erb
new file mode 100644 (file)
index 0000000..01179af
--- /dev/null
@@ -0,0 +1,7 @@
+<p class="notes">
+  <% if @center.nil? %>
+    <p>Not connected to update center. Please check your internet connection and logs.</p>
+  <% else %>
+    Updated on <%= @center.getDate() %>. <%= link_to 'Refresh', :action => action, :reload => true %>
+  <% end %>
+</p>
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..f7cafd5
--- /dev/null
@@ -0,0 +1,89 @@
+<ul class="tabs">
+  <li>
+    <a href="<%= url_for :action => 'index' -%>">Installed</a>
+  </li>
+  <li>
+    <a href="<%= url_for :action => 'updates' -%>">Updates</a>
+  </li>
+  <li>
+    <a href="<%= url_for :action => 'available' -%>" class="selected">Available</a>
+  </li>
+</ul>
+<div class="tabs-panel">
+
+<%= render :partial => 'updatecenter/downloads' %>
+
+<% 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() %>
+              <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>
+              <% elsif update.requiresSonarUpgrade
+              %>
+                <p>
+                  Version: <%= update.getRelease().getVersion() -%> (not compatible, needs Sonar upgrade)
+                </p>
+              <%
+                end
+              %>
+            </div>
+          </td>
+        </tr>
+        <% end %>
+      </tbody>
+    </table><br/>
+  <% end %>
+<% end %>
+<%= render :partial => 'updatecenter/status', :locals => {:action => 'available' } %>
+</div>
\ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb
new file mode 100644 (file)
index 0000000..c3b8985
--- /dev/null
@@ -0,0 +1,66 @@
+<ul class="tabs">
+<li>
+<a href="<%= url_for :action => 'index' -%>" class="selected">Installed</a>
+</li>
+<li>
+<a href="<%= url_for :action => 'updates' -%>">Updates</a>
+</li>
+<li>
+<a href="<%= url_for :action => 'available' -%>">Available</a>
+</li>
+</ul>
+<div class="tabs-panel">
+
+<h2>User-installed plugins</h2>
+<table class="data width100" id="user-plugins">
+  <thead>
+    <tr>
+      <th>Plugin</th>
+      <th>Version</th>
+      <th>Description</th>
+      <th>Organization</th>
+      <th>Links</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="<%= cycle('even','odd', :name => 'user') -%> id="<%= u plugin.plugin_key -%>">
+          <td width="1%" nowrap><b><%= h(plugin.name) -%></b></td>
+          <td><%= plugin.version || '-'  %></td>
+          <td><%= plugin.description %></td>
+
+          <td>
+            <% if plugin.organization %>
+              <%= link_to_if plugin.organization_url, plugin.organization, plugin.organization_url, :class=>'external'  %>
+            <% end %>
+          </td>
+          <td><%= link_to 'Details', plugin.homepage, :class => 'external' if plugin.homepage %></td>
+        </tr>
+      <%  end %>
+    <%  end %>
+  </tbody>
+</table>
+<div class="break30"> </div>
+
+<h2>System plugins</h2>
+<table class="data width100" id="core-plugins">
+  <thead><tr>
+    <th>Plugin</th>
+    <th>Description</th>
+  </tr></thead>
+  <tbody>
+  <%
+    @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><%= plugin.description %></td>
+    </tr>
+  <% end %>
+  </tbody>
+</table>
+</div>
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..615d92f
--- /dev/null
@@ -0,0 +1,73 @@
+<ul class="tabs">
+  <li>
+    <a href="<%= url_for :action => 'index' -%>">Installed</a>
+  </li>
+  <li>
+    <a href="<%= url_for :action => 'updates' -%>" class="selected">Updates</a>
+  </li>
+  <li>
+    <a href="<%= url_for :action => 'available' -%>">Available</a>
+  </li>
+</ul>
+<div class="tabs-panel">
+<%= render :partial => 'updatecenter/downloads' %>
+
+<% if @center %>
+  <table class="data width100" id="plugin-updates">
+    <thead>
+        <tr>
+          <th colspan="3"><h2>User-installed plugins</h2></th>
+        </tr>
+    </thead>
+    <tbody>
+    <% if @plugin_updates.empty? %>
+      <tr class="even">
+        <td colspan="3" >No updates</td>
+      </tr>
+    <% end %>
+    <% @plugin_updates.each do |update|
+    %>
+      <tr class="<%= cycle('even','odd', :name => 'user-plugins') -%>">
+        <td><%= h(update.getPlugin().getName()) -%></td>
+        <td>
+
+        </td>
+        <td>
+
+        </td>
+      </tr>
+    <% end %>
+    </tbody>
+  </table>
+  <br/>
+  <table class="data width100" id="system-updates">
+    <thead>
+        <tr>
+          <th colspan="2"><h2>System</h2></th>
+        </tr>
+    </thead>
+    <tbody>
+    <%
+      if @sonar_updates.empty? %>
+      <tr class="even">
+        <td colspan="3" >No updates</td>
+      </tr>
+    <% end %>
+    <% @sonar_updates.each do |update|
+         sonar_release=update.getRelease()
+    %>
+      <tr class="<%= cycle('even','odd', :name => 'system') -%>">
+        <td>Sonar <%= sonar_release.getVersion() -%></td>
+        <td><%= sonar_release.getDescription() -%></td>
+        <td>
+          <%= link_to 'Release Notes', sonar_release.getChangelogUrl(), :class => 'external' if sonar_release.getChangelogUrl() %> &nbsp;
+          <%= link_to 'Download', sonar_release.getDownloadUrl(), :class => 'external' if sonar_release.getDownloadUrl() %>
+        </td>
+      </tr>
+    <% end %>
+    </tbody>
+  </table>
+  <br/>
+<% end %>
+<%= render :partial => 'updatecenter/status', :locals => {:action => 'updates' } %>
+</div>
\ No newline at end of file