]> source.dussan.org Git - redmine.git/commitdiff
Adds url and author_url plugin attributes (#2162).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 16 Nov 2008 17:12:02 +0000 (17:12 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 16 Nov 2008 17:12:02 +0000 (17:12 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2041 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/admin/plugins.rhtml
lib/redmine/plugin.rb
public/stylesheets/application.css
test/functional/admin_controller_test.rb
test/unit/lib/redmine/plugin_test.rb

index 9cabd42ae56a47fd171d4eb061709c26e4d176e4..4ee6c142c5d5558d3a8e37d359707b92e722be25 100644 (file)
@@ -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>
index ad8ed7bbbc5d7463e2bdbd1496dac0765fab2ad3..ccd804f063b194a78127abe2e76d1e1fc81616d5 100644 (file)
@@ -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
index a16315254641a6f689a0e88bc9d5d63ee8f2176c..a10c3682ae0742c3d9f16979b033ba93cac3ff67 100644 (file)
@@ -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;}
index 2bbd8fe9746fef1abe14ef9b1757517a502e48eb..569ed5589438eeb0fd880b8a020c8d25a3254d6c 100644 (file)
@@ -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
index 432fe0bfe5a0809c801d8310b7af3a08869f125a..48e868e527430a195cd591b50b193e0c438410d9 100644 (file)
@@ -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