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
This commit is contained in:
parent
f9ce4ff559
commit
5362a85f2b
|
@ -1,14 +1,16 @@
|
||||||
<h2><%= l(:label_plugins) %></h2>
|
<h2><%= l(:label_plugins) %></h2>
|
||||||
|
|
||||||
<% if @plugins.any? %>
|
<% if @plugins.any? %>
|
||||||
<table class="list">
|
<table class="list plugins">
|
||||||
<% @plugins.each do |plugin| %>
|
<% @plugins.each do |plugin| %>
|
||||||
<tr class="<%= cycle('odd', 'even') %>">
|
<tr class="<%= cycle('odd', 'even') %>">
|
||||||
<td><%=h plugin.name %></td>
|
<td><span class="name"><%=h plugin.name %></span>
|
||||||
<td><%=h plugin.description %></td>
|
<%= content_tag('span', h(plugin.description), :class => 'description') unless plugin.description.blank? %>
|
||||||
<td><%=h plugin.author %></td>
|
<%= content_tag('span', link_to(h(plugin.url), plugin.url), :class => 'url') unless plugin.url.blank? %>
|
||||||
<td><%=h plugin.version %></td>
|
</td>
|
||||||
<td><%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %></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>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -57,7 +57,7 @@ module Redmine #:nodoc:
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def_field :name, :description, :author, :version, :settings
|
def_field :name, :description, :url, :author, :author_url, :version, :settings
|
||||||
attr_reader :id
|
attr_reader :id
|
||||||
|
|
||||||
# Plugin constructor
|
# 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 { text-align: right; font-weight: bold; padding-right: 0.5em; }
|
||||||
td.hours .hours-dec { font-size: 0.9em; }
|
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.list tbody tr:hover { background-color:#ffffdd; }
|
||||||
table td {padding:2px;}
|
table td {padding:2px;}
|
||||||
table p {margin:0;}
|
table p {margin:0;}
|
||||||
|
|
|
@ -103,8 +103,8 @@ class AdminControllerTest < Test::Unit::TestCase
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'plugins'
|
assert_template 'plugins'
|
||||||
|
|
||||||
assert_tag :td, :content => 'Foo plugin'
|
assert_tag :td, :child => { :tag => 'span', :content => 'Foo plugin' }
|
||||||
assert_tag :td, :content => 'Bar'
|
assert_tag :td, :child => { :tag => 'span', :content => 'Bar' }
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_info
|
def test_info
|
||||||
|
|
|
@ -32,7 +32,9 @@ class Redmine::PluginTest < Test::Unit::TestCase
|
||||||
def test_register
|
def test_register
|
||||||
@klass.register :foo do
|
@klass.register :foo do
|
||||||
name 'Foo plugin'
|
name 'Foo plugin'
|
||||||
|
url 'http://example.net/plugins/foo'
|
||||||
author 'John Smith'
|
author 'John Smith'
|
||||||
|
author_url 'http://example.net/jsmith'
|
||||||
description 'This is a test plugin'
|
description 'This is a test plugin'
|
||||||
version '0.0.1'
|
version '0.0.1'
|
||||||
settings :default => {'sample_setting' => 'value', 'foo'=>'bar'}, :partial => 'foo/settings'
|
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 plugin.is_a?(Redmine::Plugin)
|
||||||
assert_equal :foo, plugin.id
|
assert_equal :foo, plugin.id
|
||||||
assert_equal 'Foo plugin', plugin.name
|
assert_equal 'Foo plugin', plugin.name
|
||||||
|
assert_equal 'http://example.net/plugins/foo', plugin.url
|
||||||
assert_equal 'John Smith', plugin.author
|
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 'This is a test plugin', plugin.description
|
||||||
assert_equal '0.0.1', plugin.version
|
assert_equal '0.0.1', plugin.version
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue