Commit 5362a85f authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

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
parent f9ce4ff5
<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>
......
......@@ -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
......
......@@ -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;}
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment