summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-11-16 17:12:02 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-11-16 17:12:02 +0000
commit5362a85f2bd7cf6dd4e6ca42f5899f61bb875203 (patch)
tree37deee65c171858e5dc5e264d97126e76262daf5
parentf9ce4ff559a1f41dea6981c8cc37cd7e9f71e521 (diff)
downloadredmine-5362a85f2bd7cf6dd4e6ca42f5899f61bb875203.tar.gz
redmine-5362a85f2bd7cf6dd4e6ca42f5899f61bb875203.zip
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
-rw-r--r--app/views/admin/plugins.rhtml14
-rw-r--r--lib/redmine/plugin.rb2
-rw-r--r--public/stylesheets/application.css6
-rw-r--r--test/functional/admin_controller_test.rb4
-rw-r--r--test/unit/lib/redmine/plugin_test.rb4
5 files changed, 21 insertions, 9 deletions
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 @@
<h2><%= l(:label_plugins) %></h2>
<% if @plugins.any? %>
-<table class="list">
+<table class="list plugins">
<% @plugins.each do |plugin| %>
<tr class="<%= cycle('odd', 'even') %>">
- <td><%=h plugin.name %></td>
- <td><%=h plugin.description %></td>
- <td><%=h plugin.author %></td>
- <td><%=h plugin.version %></td>
- <td><%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %></td>
+ <td><span class="name"><%=h plugin.name %></span>
+ <%= 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? %>
+ </td>
+ <td class="author"><%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %></td>
+ <td class="version"><%=h plugin.version %></td>
+ <td class="configure"><%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %></td>
</tr>
<% end %>
</table>
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