moving cost_type definition into plugin

pull/6827/head
Jens Ulferts 13 years ago
parent 80a6762f86
commit d64413a9ce
  1. 1
      init.rb
  2. 22
      lib/redmine_widgets/cost_types.rb

@ -5,6 +5,7 @@ require 'view_projects_show_sidebar_bottom_hook'
$LOAD_PATH << File.expand_path("../lib/redmine_widgets", __FILE__)
require 'simple_table'
require 'entry_table'
require 'cost_types'
Redmine::Plugin.register :redmine_reporting do
name 'Reporting Plugin'

@ -0,0 +1,22 @@
class Widget::CostTypes < Widget::Base
def render_with_options(options, &block)
@cost_types = options.delete(:cost_types)
@selected_type_id = options.delete(:selected_type_id)
super(options, &block)
end
def render
write contents
end
def contents
content_tag :div do
available_cost_type_tabs(@subject).map do |id, label|
type_selection = radio_button_tag("unit", id, id == @selected_type_id)
type_selection += label_tag "unit_#{id}", h(label)
type_selection
end.join("</br>")
end
end
end
Loading…
Cancel
Save