3 Commits
5 changed files with 37 additions and 19 deletions
+1 -1
View File
@@ -1 +1 @@
0.2.1 0.3.0
+3
View File
@@ -0,0 +1,3 @@
#admin-menu a.rate-caches {
background-image: url('../images/database_refresh.png');
}
+10 -3
View File
@@ -1,4 +1,11 @@
ActionController::Routing::Routes.draw do |map| if Gem::Version.new("3.0") > Gem::Version.new(Rails.version) then
map.resources :rates ActionController::Routing::Routes.draw do |map|
map.connect 'rate_caches', :conditions => {:method => :put}, :controller => 'rate_caches', :action => 'update' map.resources :rates
map.connect "rate_caches", :conditions => { :method => :put }, :controller => "rate_caches", :action => "update"
end
else
RedmineApp::Application.routes.draw do
resources :rates
match :rate_caches, :to => "rate_caches#update", :method => :put
end
end end
+22 -14
View File
@@ -1,20 +1,28 @@
require 'redmine' require 'redmine'
# Patches to the Redmine core Rails.logger.info 'Starting Rate plugin for Redmine'
require 'dispatcher'
Dispatcher.to_prepare :redmine_rate do require_dependency 'application_controller'
gem 'lockfile' require_dependency 'time_entry'
require_dependency 'users_helper'
require_dependency 'application_controller' if Gem::Version.new("3.0") > Gem::Version.new(Rails.version) then
ApplicationController.send(:include, RateHelper) require 'dispatcher'
ApplicationController.send(:helper, :rate) Distpatcher.to_prepare :redmine_rate do
gem 'lockfile'
require_dependency 'time_entry' ApplicationController.send(:include, RateHelper)
TimeEntry.send(:include, RateTimeEntryPatch) ApplicationController.send(:helper, :rate)
TimeEntry.send(:include, RateTimeEntryPatch)
require_dependency 'users_helper' UsersHelper.send(:include, RateUsersHelperPatch) unless UsersHelper.included_modules.include?(RateUsersHelperPatch)
UsersHelper.send(:include, RateUsersHelperPatch) unless UsersHelper.included_modules.include?(RateUsersHelperPatch) end
else
ActionDispatch::Callbacks.to_prepare do
gem 'lockfile'
ApplicationController.send(:include, RateHelper)
ApplicationController.send(:helper, :rate)
TimeEntry.send(:include, RateTimeEntryPatch)
UsersHelper.send(:include, RateUsersHelperPatch) unless UsersHelper.included_modules.include?(RateUsersHelperPatch)
end
end end
# Hooks # Hooks
@@ -27,7 +35,7 @@ Redmine::Plugin.register :redmine_rate do
url 'https://projects.littlestreamsoftware.com/projects/redmine-rate' url 'https://projects.littlestreamsoftware.com/projects/redmine-rate'
author_url 'http://www.littlestreamsoftware.com' author_url 'http://www.littlestreamsoftware.com'
description "The Rate plugin provides an API that can be used to find the rate for a Member of a Project at a specific date. It also stores historical rate data so calculations will remain correct in the future." description "The Rate plugin provides an API that can be used to find the rate for a Member of a Project at a specific date. It also stores historical rate data so calculations will remain correct in the future."
version '0.2.1' version '0.3.0'
requires_redmine :version_or_higher => '1.0.0' requires_redmine :version_or_higher => '1.0.0'
@@ -2,7 +2,7 @@ module RedmineRate
module Hooks module Hooks
class ViewLayoutsBaseHtmlHeadHook < Redmine::Hook::ViewListener class ViewLayoutsBaseHtmlHeadHook < Redmine::Hook::ViewListener
def view_layouts_base_html_head(context={}) def view_layouts_base_html_head(context={})
return content_tag(:style, "#admin-menu a.rate-caches { background-image: url('#{image_path('database_refresh.png', :plugin => 'redmine_rate')}'); }", :type => 'text/css') stylesheet_link_tag "rate.css", :plugin => "redmine_rate"
end end
end end
end end