<%= textilizable(comment.comments) %>
-<% end if @news.comments_count > 0 %>
+<% end if @comments.any? %>
<% if authorize_for 'news', 'add_comment' %>
diff --git a/lang/bg.yml b/lang/bg.yml
index a99a8888..11e18b84 100644
--- a/lang/bg.yml
+++ b/lang/bg.yml
@@ -608,3 +608,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/cs.yml b/lang/cs.yml
index 5036b6b4..ccf93fb9 100644
--- a/lang/cs.yml
+++ b/lang/cs.yml
@@ -608,3 +608,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/de.yml b/lang/de.yml
index 3d0db927..bdbe549c 100644
--- a/lang/de.yml
+++ b/lang/de.yml
@@ -609,3 +609,7 @@ enumeration_issue_priorities: Ticket-Prioritäten
enumeration_doc_categories: Dokumentenkategorien
enumeration_activities: Aktivitäten (Zeiterfassung)
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/en.yml b/lang/en.yml
index a23d1b02..0445834f 100644
--- a/lang/en.yml
+++ b/lang/en.yml
@@ -177,6 +177,7 @@ field_column_names: Columns
field_time_zone: Time zone
field_searchable: Searchable
field_default_value: Default value
+field_comments_sorting: Afficher les commentaires
setting_app_title: Application title
setting_app_subtitle: Application subtitle
@@ -501,6 +502,9 @@ label_ldap_authentication: LDAP authentication
label_downloads_abbr: D/L
label_optional_description: Optional description
label_add_another_file: Add another file
+label_preferences: Preferences
+label_chronological_order: In chronological order
+label_reverse_chronological_order: In reverse chronological order
button_login: Login
button_submit: Submit
diff --git a/lang/es.yml b/lang/es.yml
index 66238934..d137054d 100644
--- a/lang/es.yml
+++ b/lang/es.yml
@@ -611,3 +611,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/fi.yml b/lang/fi.yml
index d85629e1..b2ad672f 100644
--- a/lang/fi.yml
+++ b/lang/fi.yml
@@ -612,3 +612,7 @@ text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
label_on: 'on'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/fr.yml b/lang/fr.yml
index 85e699c3..b992ceff 100644
--- a/lang/fr.yml
+++ b/lang/fr.yml
@@ -177,6 +177,7 @@ field_column_names: Colonnes
field_time_zone: Fuseau horaire
field_searchable: Utilisé pour les recherches
field_default_value: Valeur par défaut
+field_comments_sorting: Afficher les commentaires
setting_app_title: Titre de l'application
setting_app_subtitle: Sous-titre de l'application
@@ -501,6 +502,9 @@ label_ldap_authentication: Authentification LDAP
label_downloads_abbr: D/L
label_optional_description: Description facultative
label_add_another_file: Ajouter un autre fichier
+label_preferences: Préférences
+label_chronological_order: Dans l'ordre chronologique
+label_reverse_chronological_order: Dans l'ordre chronologique inverse
button_login: Connexion
button_submit: Soumettre
diff --git a/lang/he.yml b/lang/he.yml
index fe31e860..66a493bb 100644
--- a/lang/he.yml
+++ b/lang/he.yml
@@ -608,3 +608,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/it.yml b/lang/it.yml
index f207c2e1..c47729c5 100644
--- a/lang/it.yml
+++ b/lang/it.yml
@@ -608,3 +608,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/ja.yml b/lang/ja.yml
index f00fc4d8..37392dd7 100644
--- a/lang/ja.yml
+++ b/lang/ja.yml
@@ -609,3 +609,7 @@ label_optional_description: Optional description
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/ko.yml b/lang/ko.yml
index cf25e23e..5685d063 100644
--- a/lang/ko.yml
+++ b/lang/ko.yml
@@ -608,3 +608,7 @@ label_last_month: last month
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/lt.yml b/lang/lt.yml
index b5012076..c783f576 100644
--- a/lang/lt.yml
+++ b/lang/lt.yml
@@ -609,3 +609,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/nl.yml b/lang/nl.yml
index 2d8a6aa0..6d650456 100644
--- a/lang/nl.yml
+++ b/lang/nl.yml
@@ -609,3 +609,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/pl.yml b/lang/pl.yml
index 57559aed..bf8f3f1b 100644
--- a/lang/pl.yml
+++ b/lang/pl.yml
@@ -608,3 +608,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/pt-br.yml b/lang/pt-br.yml
index 35f490b8..9ddd6f94 100644
--- a/lang/pt-br.yml
+++ b/lang/pt-br.yml
@@ -608,3 +608,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/pt.yml b/lang/pt.yml
index c07364f7..63972d04 100644
--- a/lang/pt.yml
+++ b/lang/pt.yml
@@ -608,3 +608,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/ro.yml b/lang/ro.yml
index 68de767a..9d374af5 100644
--- a/lang/ro.yml
+++ b/lang/ro.yml
@@ -608,3 +608,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/ru.yml b/lang/ru.yml
index 39a30fd3..d5b67f96 100644
--- a/lang/ru.yml
+++ b/lang/ru.yml
@@ -612,3 +612,7 @@ text_assign_time_entries_to_project: Прикрепить зарегистрир
text_destroy_time_entries: Удалить зарегистрированное время
text_reassign_time_entries: 'Перенести зарегистрированное время на следующую задачу:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/sr.yml b/lang/sr.yml
index 5e693c09..edef5f7f 100644
--- a/lang/sr.yml
+++ b/lang/sr.yml
@@ -609,3 +609,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/sv.yml b/lang/sv.yml
index 1b4698f3..f3940759 100644
--- a/lang/sv.yml
+++ b/lang/sv.yml
@@ -609,3 +609,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/uk.yml b/lang/uk.yml
index c2645418..d8e4a7a6 100644
--- a/lang/uk.yml
+++ b/lang/uk.yml
@@ -610,3 +610,7 @@ text_assign_time_entries_to_project: Assign reported hours to the project
text_destroy_time_entries: Delete reported hours
text_reassign_time_entries: 'Reassign reported hours to this issue:'
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/zh-tw.yml b/lang/zh-tw.yml
index 5d504081..eb1a5e30 100644
--- a/lang/zh-tw.yml
+++ b/lang/zh-tw.yml
@@ -609,3 +609,7 @@ enumeration_issue_priorities: 項目優先權
enumeration_doc_categories: 文件分類
enumeration_activities: 活動 (time tracking)
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/lang/zh.yml b/lang/zh.yml
index 8646d47c..e7d79093 100644
--- a/lang/zh.yml
+++ b/lang/zh.yml
@@ -609,3 +609,7 @@ enumeration_issue_priorities: 问题优先级
enumeration_doc_categories: 文档类别
enumeration_activities: 活动(时间跟踪)
setting_activity_days_default: Days displayed on project activity
+label_chronological_order: In chronological order
+field_comments_sorting: Afficher les commentaires
+label_reverse_chronological_order: In reverse chronological order
+label_preferences: Preferences
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index 845a34af..3209f261 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -144,4 +144,12 @@ class UserTest < Test::Unit::TestCase
@jsmith.reload
assert !@jsmith.projects.first.recipients.include?(@jsmith.mail)
end
+
+ def test_comments_sorting_preference
+ assert !@jsmith.wants_comments_in_reverse_order?
+ @jsmith.pref.comments_sorting = 'asc'
+ assert !@jsmith.wants_comments_in_reverse_order?
+ @jsmith.pref.comments_sorting = 'desc'
+ assert @jsmith.wants_comments_in_reverse_order?
+ end
end
<%= l(:label_comment_plural) %>
-<% @news.comments.each do |comment| %> +<% @comments.each do |comment| %> <% next if comment.new_record? %> -<%= authoring comment.created_on, comment.author %>
<%= authoring comment.created_on, comment.author %>
<%= textilizable(comment.comments) %> -<% end if @news.comments_count > 0 %> +<% end if @comments.any? %>