Compare commits
11 Commits
v0.2.1
...
redmine-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e57c81ff21 | ||
|
|
bbe55e098a | ||
|
|
dd3bcd9dce | ||
|
|
75437c43bb | ||
|
|
8e12d37cc6 | ||
|
|
a9dcecc838 | ||
|
|
f42b419bf3 | ||
|
|
8288455356 | ||
|
|
dc8c5eefd2 | ||
|
|
00453672c6 | ||
|
|
268b1b7107 |
1
.github_origin
Normal file
1
.github_origin
Normal file
@@ -0,0 +1 @@
|
||||
https://github.com/edavis10/redmine_rate.git
|
||||
4
Rakefile
4
Rakefile
@@ -19,7 +19,6 @@ begin
|
||||
s.homepage = "https://projects.littlestreamsoftware.com/projects/redmine-rate"
|
||||
s.description = "The Rate plugin stores billing rates for Users. It also provides an API that can be used to find the rate for a Member of a Project at a specific date."
|
||||
s.authors = ["Eric Davis"]
|
||||
s.rubyforge_project = "redmine_rate" # TODO
|
||||
s.files = FileList[
|
||||
"[A-Z]*",
|
||||
"init.rb",
|
||||
@@ -29,9 +28,6 @@ begin
|
||||
]
|
||||
end
|
||||
Jeweler::GemcutterTasks.new
|
||||
Jeweler::RubyforgeTasks.new do |rubyforge|
|
||||
rubyforge.doc_task = "rdoc"
|
||||
end
|
||||
rescue LoadError
|
||||
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
||||
end
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
module RateSortHelperPatch
|
||||
def self.included(base) # :nodoc:
|
||||
base.send(:include, InstanceMethods)
|
||||
end
|
||||
|
||||
module InstanceMethods
|
||||
module RateHelper
|
||||
# Allows more parameters than the standard sort_header_tag
|
||||
def rate_sort_header_tag(column, options = {})
|
||||
caption = options.delete(:caption) || titleize(Inflector::humanize(column))
|
||||
caption = options.delete(:caption) || titleize(ActiveSupport::Inflector::humanize(column))
|
||||
default_order = options.delete(:default_order) || 'asc'
|
||||
options[:title]= l(:label_sort_by, "\"#{caption}\"") unless options[:title]
|
||||
content_tag('th',
|
||||
@@ -80,7 +75,7 @@ module RateSortHelperPatch
|
||||
icon = nil
|
||||
order = default_order
|
||||
end
|
||||
caption = titleize(Inflector::humanize(column)) unless caption
|
||||
caption = titleize(ActiveSupport::Inflector::humanize(column)) unless caption
|
||||
|
||||
sort_options = { :sort_key => column, :sort_order => order }
|
||||
# don't reuse params if filters are present
|
||||
@@ -98,5 +93,4 @@ module RateSortHelperPatch
|
||||
(icon ? nbsp(2) + image_tag(icon) : '')
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
3
assets/stylesheets/rate.css
Normal file
3
assets/stylesheets/rate.css
Normal file
@@ -0,0 +1,3 @@
|
||||
#admin-menu a.rate-caches {
|
||||
background-image: url('../images/database_refresh.png');
|
||||
}
|
||||
18
config/locales/cs.yml
Normal file
18
config/locales/cs.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
cs:
|
||||
rate_label_rates: Míra
|
||||
rate_label_rate: Míra
|
||||
rate_label_rate_history: Historie míry
|
||||
rate_label_new_rate: Nová míra
|
||||
rate_label_currency: Kč
|
||||
rate_error_user_not_found: Uživatel nebyl nalezen
|
||||
rate_label_set_rate: Nastavit míru
|
||||
rate_label_default: Výchozí míra
|
||||
rate_cost: Cena
|
||||
text_rate_caches_panel: "Míra mezipaměti"
|
||||
text_no_cache_run: "nebyla nalezena žádná běžící mezipaměť"
|
||||
text_last_caching_run: "Poslední spuštěná mezipaměť: "
|
||||
text_last_cache_clearing_run: "Poslední čištění mezipaměti: "
|
||||
text_load_missing_caches: "Nahrát chybějící mezipaměť"
|
||||
text_clear_and_load_all_caches: "Vyčistit a nahrát všechny mezipaměti"
|
||||
text_caches_loaded_successfully: "Mezipaměti byly nahrány"
|
||||
permission_view_rate: "Zobrazit míry"
|
||||
@@ -1,4 +1,11 @@
|
||||
ActionController::Routing::Routes.draw do |map|
|
||||
map.resources :rates
|
||||
map.connect 'rate_caches', :conditions => {:method => :put}, :controller => 'rate_caches', :action => 'update'
|
||||
if Gem::Version.new("3.0") > Gem::Version.new(Rails.version) then
|
||||
ActionController::Routing::Routes.draw do |map|
|
||||
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
|
||||
|
||||
35
init.rb
35
init.rb
@@ -1,19 +1,28 @@
|
||||
require 'redmine'
|
||||
|
||||
# Patches to the Redmine core
|
||||
require 'dispatcher'
|
||||
Rails.logger.info 'Starting Rate plugin for Redmine'
|
||||
|
||||
Dispatcher.to_prepare :redmine_rate do
|
||||
gem 'lockfile'
|
||||
require_dependency 'application_controller'
|
||||
require_dependency 'time_entry'
|
||||
require_dependency 'users_helper'
|
||||
|
||||
require_dependency 'sort_helper'
|
||||
SortHelper.send(:include, RateSortHelperPatch)
|
||||
|
||||
require_dependency 'time_entry'
|
||||
TimeEntry.send(:include, RateTimeEntryPatch)
|
||||
|
||||
require_dependency 'users_helper'
|
||||
UsersHelper.send(:include, RateUsersHelperPatch) unless UsersHelper.included_modules.include?(RateUsersHelperPatch)
|
||||
if Gem::Version.new("3.0") > Gem::Version.new(Rails.version) then
|
||||
require 'dispatcher'
|
||||
Distpatcher.to_prepare :redmine_rate 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
|
||||
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
|
||||
|
||||
# Hooks
|
||||
@@ -26,7 +35,7 @@ Redmine::Plugin.register :redmine_rate do
|
||||
url 'https://projects.littlestreamsoftware.com/projects/redmine-rate'
|
||||
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."
|
||||
version '0.2.1'
|
||||
version '0.3.0'
|
||||
|
||||
requires_redmine :version_or_higher => '1.0.0'
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ module RedmineRate
|
||||
module Hooks
|
||||
class ViewLayoutsBaseHtmlHeadHook < Redmine::Hook::ViewListener
|
||||
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
|
||||
|
||||
@@ -79,7 +79,6 @@ Gem::Specification.new do |s|
|
||||
s.homepage = %q{https://projects.littlestreamsoftware.com/projects/redmine-rate}
|
||||
s.rdoc_options = ["--charset=UTF-8"]
|
||||
s.require_paths = ["lib"]
|
||||
s.rubyforge_project = %q{redmine_rate}
|
||||
s.rubygems_version = %q{1.3.7}
|
||||
s.summary = %q{A Rate plugin for Redmine to store billing rate for user.}
|
||||
s.test_files = [
|
||||
|
||||
Reference in New Issue
Block a user