From: Godin Date: Mon, 25 Oct 2010 12:47:12 +0000 (+0000) Subject: SONAR-1563: Rename domain to "updatecenter" X-Git-Tag: 2.6~759 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4e65e4bcd7a2c3518e9188a68560feaf03f3ab09;p=sonarqube.git SONAR-1563: Rename domain to "updatecenter" --- 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 index ede4810febf..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/plugins_controller.rb +++ /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]< '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 index 00000000000..28c89ac0d68 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/updatecenter_controller.rb @@ -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]< '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/views/layouts/_layout.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb index e223aab7811..8a2a24bb8ff 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb @@ -74,7 +74,7 @@
  • Settings
  • Backup
  • System info
  • -
  • Upgrades (BETA)
  • +
  • Upgrades (BETA)
  • <% 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 index 8f9d1e8a836..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/_downloads.html.erb +++ /dev/null @@ -1,28 +0,0 @@ - - - -<% if @downloads.size>0 %> -
    -

    Sonar needs to be restarted in order to install the following plugins:

      - <% @downloads.each do |download| -%> -
    • <%= download -%>
    • - <% end %> -
    - -

    -
    -<% 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 index 01179af82e8..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/_status.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -

    - <% if @center.nil? %> -

    Not connected to update center. Please check your internet connection and logs.

    - <% else %> - Updated on <%= @center.getDate() %>. <%= link_to 'Refresh', :action => action, :reload => true %> - <% end %> -

    \ 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 index 4e2e0e3071b..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/available.html.erb +++ /dev/null @@ -1,89 +0,0 @@ - -
    - -<%= render :partial => 'plugins/downloads' %> - -<% if @center %> - <% @updates_by_category.keys.sort_by{|c| c.downcase }.each do |category| - updates=@updates_by_category[category] - %> - - - - - - - - <% updates.each do |update| - plugin=update.getPlugin() - %> - - - - - <% end %> - -

    <%= category -%>

    - <%= h(plugin.getName()) -%> - - <%= plugin.getDescription() %> More - -

    - <% end %> -<% end %> -<%= render :partial => 'plugins/status', :locals => {:action => 'available' } %> -
    \ 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 index c3b89859719..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/index.html.erb +++ /dev/null @@ -1,66 +0,0 @@ - -
    - -

    User-installed plugins

    - - - - - - - - - - - - <% if @user_plugins.empty? %> - - <% else - @user_plugins.each do |plugin| - %> - "> - - - - - - - - <% end %> - <% end %> - -
    PluginVersionDescriptionOrganizationLinks
    No plugins
    <%= h(plugin.name) -%><%= plugin.version || '-' %><%= plugin.description %> - <% if plugin.organization %> - <%= link_to_if plugin.organization_url, plugin.organization, plugin.organization_url, :class=>'external' %> - <% end %> - <%= link_to 'Details', plugin.homepage, :class => 'external' if plugin.homepage %>
    -
    - -

    System plugins

    - - - - - - - <% - @core_plugins.each do |plugin| - %> - - - - - <% end %> - -
    PluginDescription
    <%= plugin.name -%><%= plugin.description %>
    -
    \ 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 index ad470b38b1a..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/plugins/updates.html.erb +++ /dev/null @@ -1,73 +0,0 @@ - -
    -<%= render :partial => 'plugins/downloads' %> - -<% if @center %> - - - - - - - - <% if @plugin_updates.empty? %> - - - - <% end %> - <% @plugin_updates.each do |update| - %> - - - - - - <% end %> - -

    User-installed plugins

    No updates
    <%= h(update.getPlugin().getName()) -%> - - - -
    -
    - - - - - - - - <% - if @sonar_updates.empty? %> - - - - <% end %> - <% @sonar_updates.each do |update| - sonar_release=update.getRelease() - %> - - - - - - <% end %> - -

    System

    No updates
    Sonar <%= sonar_release.getVersion() -%><%= sonar_release.getDescription() -%> - <%= link_to 'Release Notes', sonar_release.getChangelogUrl(), :class => 'external' if sonar_release.getChangelogUrl() %>   - <%= link_to 'Download', sonar_release.getDownloadUrl(), :class => 'external' if sonar_release.getDownloadUrl() %> -
    -
    -<% end %> -<%= render :partial => 'plugins/status', :locals => {:action => 'updates' } %> -
    \ 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 index 00000000000..8f9d1e8a836 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_downloads.html.erb @@ -0,0 +1,28 @@ + + + +<% if @downloads.size>0 %> +
    +

    Sonar needs to be restarted in order to install the following plugins:

      + <% @downloads.each do |download| -%> +
    • <%= download -%>
    • + <% end %> +
    + +

    +
    +<% 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 index 00000000000..01179af82e8 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/_status.html.erb @@ -0,0 +1,7 @@ +

    + <% if @center.nil? %> +

    Not connected to update center. Please check your internet connection and logs.

    + <% else %> + Updated on <%= @center.getDate() %>. <%= link_to 'Refresh', :action => action, :reload => true %> + <% end %> +

    \ 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 index 00000000000..f7cafd53e42 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb @@ -0,0 +1,89 @@ + +
    + +<%= render :partial => 'updatecenter/downloads' %> + +<% if @center %> + <% @updates_by_category.keys.sort_by{|c| c.downcase }.each do |category| + updates=@updates_by_category[category] + %> + + + + + + + + <% updates.each do |update| + plugin=update.getPlugin() + %> + + + + + <% end %> + +

    <%= category -%>

    + <%= h(plugin.getName()) -%> + + <%= plugin.getDescription() %> More + +

    + <% end %> +<% end %> +<%= render :partial => 'updatecenter/status', :locals => {:action => 'available' } %> +
    \ 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 index 00000000000..c3b89859719 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb @@ -0,0 +1,66 @@ + +
    + +

    User-installed plugins

    + + + + + + + + + + + + <% if @user_plugins.empty? %> + + <% else + @user_plugins.each do |plugin| + %> + "> + + + + + + + + <% end %> + <% end %> + +
    PluginVersionDescriptionOrganizationLinks
    No plugins
    <%= h(plugin.name) -%><%= plugin.version || '-' %><%= plugin.description %> + <% if plugin.organization %> + <%= link_to_if plugin.organization_url, plugin.organization, plugin.organization_url, :class=>'external' %> + <% end %> + <%= link_to 'Details', plugin.homepage, :class => 'external' if plugin.homepage %>
    +
    + +

    System plugins

    + + + + + + + <% + @core_plugins.each do |plugin| + %> + + + + + <% end %> + +
    PluginDescription
    <%= plugin.name -%><%= plugin.description %>
    +
    \ 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 index 00000000000..615d92fb0af --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb @@ -0,0 +1,73 @@ + +
    +<%= render :partial => 'updatecenter/downloads' %> + +<% if @center %> + + + + + + + + <% if @plugin_updates.empty? %> + + + + <% end %> + <% @plugin_updates.each do |update| + %> + + + + + + <% end %> + +

    User-installed plugins

    No updates
    <%= h(update.getPlugin().getName()) -%> + + + +
    +
    + + + + + + + + <% + if @sonar_updates.empty? %> + + + + <% end %> + <% @sonar_updates.each do |update| + sonar_release=update.getRelease() + %> + + + + + + <% end %> + +

    System

    No updates
    Sonar <%= sonar_release.getVersion() -%><%= sonar_release.getDescription() -%> + <%= link_to 'Release Notes', sonar_release.getChangelogUrl(), :class => 'external' if sonar_release.getChangelogUrl() %>   + <%= link_to 'Download', sonar_release.getDownloadUrl(), :class => 'external' if sonar_release.getDownloadUrl() %> +
    +
    +<% end %> +<%= render :partial => 'updatecenter/status', :locals => {:action => 'updates' } %> +
    \ No newline at end of file