diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-14 18:18:19 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-14 18:18:19 +0000 |
commit | 8c7898bb5db0d29cd418eac3c6e27191cf3571ed (patch) | |
tree | aae5c57d61644de3c1d3786192ce7e2069c23e13 /lib | |
parent | b878a427f2928e600ca51d03fc47637fa85cf859 (diff) | |
download | redmine-8c7898bb5db0d29cd418eac3c6e27191cf3571ed.tar.gz redmine-8c7898bb5db0d29cd418eac3c6e27191cf3571ed.zip |
Let user choose columns and sort order of issue lists on "My page" (#1565).
git-svn-id: http://svn.redmine.org/redmine/trunk@16400 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/my_page.rb | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/redmine/my_page.rb b/lib/redmine/my_page.rb index 0c11459e4..06f750f4e 100644 --- a/lib/redmine/my_page.rb +++ b/lib/redmine/my_page.rb @@ -20,13 +20,13 @@ module Redmine include Redmine::I18n CORE_BLOCKS = { - 'issuesassignedtome' => :label_assigned_to_me_issues, - 'issuesreportedbyme' => :label_reported_issues, - 'issueswatched' => :label_watched_issues, - 'news' => :label_news_latest, - 'calendar' => :label_calendar, - 'documents' => :label_document_plural, - 'timelog' => :label_spent_time + 'issuesassignedtome' => {:label => :label_assigned_to_me_issues, :partial => 'my/blocks/issues'}, + 'issuesreportedbyme' => {:label => :label_reported_issues, :partial => 'my/blocks/issues'}, + 'issueswatched' => {:label => :label_watched_issues, :partial => 'my/blocks/issues'}, + 'news' => {:label => :label_news_latest, :partial => 'my/blocks/news'}, + 'calendar' => {:label => :label_calendar, :partial => 'my/blocks/calendar'}, + 'documents' => {:label => :label_document_plural, :partial => 'my/blocks/documents'}, + 'timelog' => {:label => :label_spent_time, :partial => 'my/blocks/timelog'} } # Returns the available blocks @@ -36,8 +36,9 @@ module Redmine def self.block_options options = [] - blocks.each do |k, v| - options << [l("my.blocks.#{v}", :default => [v, v.to_s.humanize]), k.dasherize] + blocks.each do |block, block_options| + label = block_options[:label] + options << [l("my.blocks.#{label}", :default => [label, label.to_s.humanize]), block.dasherize] end options end @@ -46,7 +47,7 @@ module Redmine def self.additional_blocks @@additional_blocks ||= Dir.glob("#{Redmine::Plugin.directory}/*/app/views/my/blocks/_*.{rhtml,erb}").inject({}) do |h,file| name = File.basename(file).split('.').first.gsub(/^_/, '') - h[name] = name.to_sym + h[name] = {:label => name.to_sym, :partial => "my/blocks/#{name}"} h end end |