<%= 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 a99a888..11e18b8 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 5036b6b..ccf93fb 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 3d0db92..bdbe549 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 a23d1b0..0445834 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 6623893..d137054 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 d85629e..b2ad672 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 85e699c..b992cef 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 fe31e86..66a493b 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 f207c2e..c47729c 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 f00fc4d..37392dd 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 cf25e23..5685d06 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 b501207..c783f57 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 2d8a6aa..6d65045 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 57559ae..bf8f3f1 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 35f490b..9ddd6f9 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 c07364f..63972d0 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 68de767..9d374af 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 39a30fd..d5b67f9 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 5e693c0..edef5f7 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 1b4698f..f394075 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 c264541..d8e4a7a 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 5d50408..eb1a5e3 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 8646d47..e7d7909 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 845a34a..3209f26 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? %>