Add a user preference to choose how comments/replies are displayed: in chronological or reverse chronological order (#589, #776).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1197 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
bbe8ea29e8
commit
e951d84584
35 files changed
+134
-17
No files matched your search
@@ -23,6 +23,7 @@ class Journal < ActiveRecord::Base
|
||||
|
||||
belongs_to :user
|
||||
has_many :details, :class_name => "JournalDetail", :dependent => :delete_all
|
||||
attr_accessor :indice
|
||||
|
||||
acts_as_searchable :columns => 'notes',
|
||||
:include => :issue,
|
||||
|
||||
@@ -144,6 +144,10 @@ class User < ActiveRecord::Base
|
||||
self.pref.time_zone.nil? ? nil : TimeZone[self.pref.time_zone]
|
||||
end
|
||||
|
||||
def wants_comments_in_reverse_order?
|
||||
self.pref[:comments_sorting] == 'desc'
|
||||
end
|
||||
|
||||
# Return user's RSS key (a 40 chars long string), used to access feeds
|
||||
def rss_key
|
||||
token = self.rss_token || Token.create(:user => self, :action => 'feeds')
|
||||
|
||||
@@ -46,4 +46,7 @@ class UserPreference < ActiveRecord::Base
|
||||
self.others.store attr_name, value
|
||||
end
|
||||
end
|
||||
|
||||
def comments_sorting; self[:comments_sorting] end
|
||||
def comments_sorting=(order); self[:comments_sorting]=order end
|
||||
end
|
||||
Reference in new issue
Block a user