##// END OF EJS Templates
Adds url and author_url plugin attributes (#2162)....
Jean-Philippe Lang -
r2039:5362a85f2bd7
parent child
Show More
@@ -1,14 +1,16
1 1 <h2><%= l(:label_plugins) %></h2>
2 2
3 3 <% if @plugins.any? %>
4 <table class="list">
4 <table class="list plugins">
5 5 <% @plugins.each do |plugin| %>
6 6 <tr class="<%= cycle('odd', 'even') %>">
7 <td><%=h plugin.name %></td>
8 <td><%=h plugin.description %></td>
9 <td><%=h plugin.author %></td>
10 <td><%=h plugin.version %></td>
11 <td><%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %></td>
7 <td><span class="name"><%=h plugin.name %></span>
8 <%= content_tag('span', h(plugin.description), :class => 'description') unless plugin.description.blank? %>
9 <%= content_tag('span', link_to(h(plugin.url), plugin.url), :class => 'url') unless plugin.url.blank? %>
10 </td>
11 <td class="author"><%= plugin.author_url.blank? ? h(plugin.author) : link_to(h(plugin.author), plugin.author_url) %></td>
12 <td class="version"><%=h plugin.version %></td>
13 <td class="configure"><%= link_to(l(:button_configure), :controller => 'settings', :action => 'plugin', :id => plugin.id) if plugin.configurable? %></td>
12 14 </tr>
13 15 <% end %>
14 16 </table>
@@ -57,7 +57,7 module Redmine #:nodoc:
57 57 end
58 58 end
59 59 end
60 def_field :name, :description, :author, :version, :settings
60 def_field :name, :description, :url, :author, :author_url, :version, :settings
61 61 attr_reader :id
62 62
63 63 # Plugin constructor
@@ -119,6 +119,12 tr.time-entry td.subject, tr.time-entry td.comments { text-align: left; white-sp
119 119 td.hours { text-align: right; font-weight: bold; padding-right: 0.5em; }
120 120 td.hours .hours-dec { font-size: 0.9em; }
121 121
122 table.plugins td { vertical-align: middle; }
123 table.plugins td.configure { text-align: right; padding-right: 1em; }
124 table.plugins span.name { font-weight: bold; display: block; margin-bottom: 6px; }
125 table.plugins span.description { display: block; font-size: 0.9em; }
126 table.plugins span.url { display: block; font-size: 0.9em; }
127
122 128 table.list tbody tr:hover { background-color:#ffffdd; }
123 129 table td {padding:2px;}
124 130 table p {margin:0;}
@@ -103,8 +103,8 class AdminControllerTest < Test::Unit::TestCase
103 103 assert_response :success
104 104 assert_template 'plugins'
105 105
106 assert_tag :td, :content => 'Foo plugin'
107 assert_tag :td, :content => 'Bar'
106 assert_tag :td, :child => { :tag => 'span', :content => 'Foo plugin' }
107 assert_tag :td, :child => { :tag => 'span', :content => 'Bar' }
108 108 end
109 109
110 110 def test_info
@@ -32,7 +32,9 class Redmine::PluginTest < Test::Unit::TestCase
32 32 def test_register
33 33 @klass.register :foo do
34 34 name 'Foo plugin'
35 url 'http://example.net/plugins/foo'
35 36 author 'John Smith'
37 author_url 'http://example.net/jsmith'
36 38 description 'This is a test plugin'
37 39 version '0.0.1'
38 40 settings :default => {'sample_setting' => 'value', 'foo'=>'bar'}, :partial => 'foo/settings'
@@ -44,7 +46,9 class Redmine::PluginTest < Test::Unit::TestCase
44 46 assert plugin.is_a?(Redmine::Plugin)
45 47 assert_equal :foo, plugin.id
46 48 assert_equal 'Foo plugin', plugin.name
49 assert_equal 'http://example.net/plugins/foo', plugin.url
47 50 assert_equal 'John Smith', plugin.author
51 assert_equal 'http://example.net/jsmith', plugin.author_url
48 52 assert_equal 'This is a test plugin', plugin.description
49 53 assert_equal '0.0.1', plugin.version
50 54 end
General Comments 0
You need to be logged in to leave comments. Login now