From: Jean-Philippe Lang Date: Sun, 16 Nov 2008 17:12:02 +0000 (+0000) Subject: Adds url and author_url plugin attributes (#2162). X-Git-Tag: 0.8.0-RC1~56 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5362a85f2bd7cf6dd4e6ca42f5899f61bb875203;p=redmine.git Adds url and author_url plugin attributes (#2162). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2041 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/views/admin/plugins.rhtml b/app/views/admin/plugins.rhtml index 9cabd42ae..4ee6c142c 100644 --- a/app/views/admin/plugins.rhtml +++ b/app/views/admin/plugins.rhtml @@ -1,14 +1,16 @@

<%= l(:label_plugins) %>

<% if @plugins.any? %> - +
<% @plugins.each do |plugin| %> - - - - - + + + + <% end %>
<%=h plugin.name %><%=h plugin.description %><%=h plugin.author %><%=h plugin.version %><%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %><%=h plugin.name %> + <%= content_tag('span', h(plugin.description), :class => 'description') unless plugin.description.blank? %> + <%= content_tag('span', link_to(h(plugin.url), plugin.url), :class => 'url') unless plugin.url.blank? %> + <%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %><%=h plugin.version %><%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %>
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index ad8ed7bbb..ccd804f06 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -57,7 +57,7 @@ module Redmine #:nodoc: end end end - def_field :name, :description, :author, :version, :settings + def_field :name, :description, :url, :author, :author_url, :version, :settings attr_reader :id # Plugin constructor diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index a16315254..a10c3682a 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -119,6 +119,12 @@ tr.time-entry td.subject, tr.time-entry td.comments { text-align: left; white-sp td.hours { text-align: right; font-weight: bold; padding-right: 0.5em; } td.hours .hours-dec { font-size: 0.9em; } +table.plugins td { vertical-align: middle; } +table.plugins td.configure { text-align: right; padding-right: 1em; } +table.plugins span.name { font-weight: bold; display: block; margin-bottom: 6px; } +table.plugins span.description { display: block; font-size: 0.9em; } +table.plugins span.url { display: block; font-size: 0.9em; } + table.list tbody tr:hover { background-color:#ffffdd; } table td {padding:2px;} table p {margin:0;} diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb index 2bbd8fe97..569ed5589 100644 --- a/test/functional/admin_controller_test.rb +++ b/test/functional/admin_controller_test.rb @@ -103,8 +103,8 @@ class AdminControllerTest < Test::Unit::TestCase assert_response :success assert_template 'plugins' - assert_tag :td, :content => 'Foo plugin' - assert_tag :td, :content => 'Bar' + assert_tag :td, :child => { :tag => 'span', :content => 'Foo plugin' } + assert_tag :td, :child => { :tag => 'span', :content => 'Bar' } end def test_info diff --git a/test/unit/lib/redmine/plugin_test.rb b/test/unit/lib/redmine/plugin_test.rb index 432fe0bfe..48e868e52 100644 --- a/test/unit/lib/redmine/plugin_test.rb +++ b/test/unit/lib/redmine/plugin_test.rb @@ -32,7 +32,9 @@ class Redmine::PluginTest < Test::Unit::TestCase def test_register @klass.register :foo do name 'Foo plugin' + url 'http://example.net/plugins/foo' author 'John Smith' + author_url 'http://example.net/jsmith' description 'This is a test plugin' version '0.0.1' settings :default => {'sample_setting' => 'value', 'foo'=>'bar'}, :partial => 'foo/settings' @@ -44,7 +46,9 @@ class Redmine::PluginTest < Test::Unit::TestCase assert plugin.is_a?(Redmine::Plugin) assert_equal :foo, plugin.id assert_equal 'Foo plugin', plugin.name + assert_equal 'http://example.net/plugins/foo', plugin.url assert_equal 'John Smith', plugin.author + assert_equal 'http://example.net/jsmith', plugin.author_url assert_equal 'This is a test plugin', plugin.description assert_equal '0.0.1', plugin.version end