From: Jean-Philippe Lang Date: Sun, 16 Nov 2008 11:58:41 +0000 (+0000) Subject: Moves plugin list to its own administration menu item. X-Git-Tag: 0.8.0-RC1~60 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=94b5bbcb5d225ec1bfe29e6aa4e8b8eb7d137abf;p=redmine.git Moves plugin list to its own administration menu item. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2037 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 777c31d70..90ec59098 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -49,6 +49,10 @@ class AdminController < ApplicationController render :action => "projects", :layout => false if request.xhr? end + def plugins + @plugins = Redmine::Plugin.registered_plugins + end + # Loads the default configuration # (roles, trackers, statuses, workflow, enumerations) def default_configuration @@ -84,6 +88,5 @@ class AdminController < ApplicationController :file_repository_writable => File.writable?(Attachment.storage_path), :rmagick_available => Object.const_defined?(:Magick) } - @plugins = Redmine::Plugin.registered_plugins end end diff --git a/app/views/admin/index.rhtml b/app/views/admin/index.rhtml index e2d160730..323641744 100644 --- a/app/views/admin/index.rhtml +++ b/app/views/admin/index.rhtml @@ -40,6 +40,10 @@ :class => ["icon22", "icon22-#{item.name}"].join(' ') %> <% end -%> +

+<%= link_to l(:label_plugins), :controller => 'admin', :action => 'plugins' %> +

+

<%= link_to l(:label_information_plural), :controller => 'admin', :action => 'info' %>

diff --git a/app/views/admin/info.rhtml b/app/views/admin/info.rhtml index 05c27f5ac..141746888 100644 --- a/app/views/admin/info.rhtml +++ b/app/views/admin/info.rhtml @@ -8,20 +8,4 @@ <%= l(:text_rmagick_available) %><%= image_tag (@flags[:rmagick_available] ? 'true.png' : 'false.png'), :style => "vertical-align:bottom;" %> -<% if @plugins.any? %> -  -

<%= l(:label_plugins) %>

- - <% @plugins.keys.sort {|x,y| x.to_s <=> y.to_s}.each do |plugin| %> - - - - - - - - <% end %> -
<%=h @plugins[plugin].name %><%=h @plugins[plugin].description %><%=h @plugins[plugin].author %><%=h @plugins[plugin].version %><%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.to_s) if @plugins[plugin].configurable? %>
-<% end %> - <% html_title(l(:label_information_plural)) -%> diff --git a/app/views/admin/plugins.rhtml b/app/views/admin/plugins.rhtml new file mode 100644 index 000000000..5a208fe02 --- /dev/null +++ b/app/views/admin/plugins.rhtml @@ -0,0 +1,17 @@ +

<%= l(:label_plugins) %>

+ +<% if @plugins.any? %> + + <% @plugins.keys.sort {|x,y| x.to_s <=> y.to_s}.each do |plugin| %> + + + + + + + + <% end %> +
<%=h @plugins[plugin].name %><%=h @plugins[plugin].description %><%=h @plugins[plugin].author %><%=h @plugins[plugin].version %><%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.to_s) if @plugins[plugin].configurable? %>
+<% else %> +

<%= l(:label_no_data) %>

+<% end %> diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb index 7c2626082..9cb2d07f0 100644 --- a/test/functional/admin_controller_test.rb +++ b/test/functional/admin_controller_test.rb @@ -78,6 +78,12 @@ class AdminControllerTest < Test::Unit::TestCase user = User.find(1) assert_equal [user.mail], mail.bcc end + + def test_plugins + get :plugins + assert_response :success + assert_template 'plugins' + end def test_info get :info @@ -85,6 +91,8 @@ class AdminControllerTest < Test::Unit::TestCase assert_template 'info' end + private + def delete_configuration_data Role.delete_all('builtin = 0') Tracker.delete_all