@@ -92,6 +92,8 class IssuesController < ApplicationController | |||
|
92 | 92 | def show |
|
93 | 93 | @custom_values = @project.custom_fields_for_issues(@issue.tracker).collect { |x| @issue.custom_values.find_by_custom_field_id(x.id) || CustomValue.new(:custom_field => x, :customized => @issue) } |
|
94 | 94 | @journals = @issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on ASC") |
|
95 | @journals.each_with_index {|j,i| j.indice = i+1} | |
|
96 | @journals.reverse! if User.current.wants_comments_in_reverse_order? | |
|
95 | 97 | @allowed_statuses = @issue.new_statuses_allowed_to(User.current) |
|
96 | 98 | @edit_allowed = User.current.allowed_to?(:edit_issues, @project) |
|
97 | 99 | @activities = Enumeration::get_values('ACTI') |
@@ -29,6 +29,8 class MessagesController < ApplicationController | |||
|
29 | 29 | |
|
30 | 30 | # Show a topic and its replies |
|
31 | 31 | def show |
|
32 | @replies = @topic.children | |
|
33 | @replies.reverse! if User.current.wants_comments_in_reverse_order? | |
|
32 | 34 | @reply = Message.new(:subject => "RE: #{@message.subject}") |
|
33 | 35 | render :action => "show", :layout => false if request.xhr? |
|
34 | 36 | end |
@@ -36,6 +36,8 class NewsController < ApplicationController | |||
|
36 | 36 | end |
|
37 | 37 | |
|
38 | 38 | def show |
|
39 | @comments = @news.comments | |
|
40 | @comments.reverse! if User.current.wants_comments_in_reverse_order? | |
|
39 | 41 | end |
|
40 | 42 | |
|
41 | 43 | def new |
@@ -23,6 +23,7 class Journal < ActiveRecord::Base | |||
|
23 | 23 | |
|
24 | 24 | belongs_to :user |
|
25 | 25 | has_many :details, :class_name => "JournalDetail", :dependent => :delete_all |
|
26 | attr_accessor :indice | |
|
26 | 27 | |
|
27 | 28 | acts_as_searchable :columns => 'notes', |
|
28 | 29 | :include => :issue, |
@@ -144,6 +144,10 class User < ActiveRecord::Base | |||
|
144 | 144 | self.pref.time_zone.nil? ? nil : TimeZone[self.pref.time_zone] |
|
145 | 145 | end |
|
146 | 146 | |
|
147 | def wants_comments_in_reverse_order? | |
|
148 | self.pref[:comments_sorting] == 'desc' | |
|
149 | end | |
|
150 | ||
|
147 | 151 | # Return user's RSS key (a 40 chars long string), used to access feeds |
|
148 | 152 | def rss_key |
|
149 | 153 | token = self.rss_token || Token.create(:user => self, :action => 'feeds') |
@@ -46,4 +46,7 class UserPreference < ActiveRecord::Base | |||
|
46 | 46 | self.others.store attr_name, value |
|
47 | 47 | end |
|
48 | 48 | end |
|
49 | ||
|
50 | def comments_sorting; self[:comments_sorting] end | |
|
51 | def comments_sorting=(order); self[:comments_sorting]=order end | |
|
49 | 52 | end |
@@ -1,8 +1,7 | |||
|
1 | <% note_id = 1 %> | |
|
2 | 1 | <% for journal in journals %> |
|
3 | 2 | <div id="change-<%= journal.id %>"> |
|
4 |
<h4><div style="float:right;"><%= link_to "##{ |
|
|
5 |
<%= content_tag('a', '', :name => "note-#{ |
|
|
3 | <h4><div style="float:right;"><%= link_to "##{journal.indice}", :anchor => "note-#{journal.indice}" %></div> | |
|
4 | <%= content_tag('a', '', :name => "note-#{journal.indice}")%> | |
|
6 | 5 | <%= format_time(journal.created_on) %> - <%= journal.user.name %></h4> |
|
7 | 6 | <ul> |
|
8 | 7 | <% for detail in journal.details %> |
@@ -11,5 +10,4 | |||
|
11 | 10 | </ul> |
|
12 | 11 | <%= render_notes(journal) unless journal.notes.blank? %> |
|
13 | 12 | </div> |
|
14 | <% note_id += 1 %> | |
|
15 | 13 | <% end %> |
@@ -1,6 +1,6 | |||
|
1 | 1 | <h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> » <%=h @message.subject %></h2> |
|
2 | 2 | |
|
3 | 3 | <% form_for :message, @message, :url => {:action => 'edit'}, :html => {:multipart => true} do |f| %> |
|
4 | <%= render :partial => 'form', :locals => {:f => f} %> | |
|
4 | <%= render :partial => 'form', :locals => {:f => f, :replying => !@message.parent.nil?} %> | |
|
5 | 5 | <%= submit_tag l(:button_save) %> |
|
6 | 6 | <% end %> |
@@ -15,11 +15,11 | |||
|
15 | 15 | <br /> |
|
16 | 16 | |
|
17 | 17 | <h3 class="icon22 icon22-comment"><%= l(:label_reply_plural) %></h3> |
|
18 |
<% @ |
|
|
18 | <% @replies.each do |message| %> | |
|
19 | 19 | <a name="<%= "message-#{message.id}" %>"></a> |
|
20 | 20 | <div class="contextual"> |
|
21 |
<%= link_to_if_authorized |
|
|
22 |
<%= link_to_if_authorized |
|
|
21 | <%= link_to_if_authorized image_tag('edit.png'), {:action => 'edit', :id => message}, :title => l(:button_edit) %> | |
|
22 | <%= link_to_if_authorized image_tag('delete.png'), {:action => 'destroy', :id => message}, :method => :post, :confirm => l(:text_are_you_sure), :title => l(:button_delete) %> | |
|
23 | 23 | </div> |
|
24 | 24 | <div class="message reply"> |
|
25 | 25 | <h4><%=h message.subject %> - <%= authoring message.created_on, message.author %></h4> |
@@ -15,11 +15,6 | |||
|
15 | 15 | <p><%= f.text_field :lastname, :required => true %></p> |
|
16 | 16 | <p><%= f.text_field :mail, :required => true %></p> |
|
17 | 17 | <p><%= f.select :language, lang_options_for_select %></p> |
|
18 | ||
|
19 | <% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %> | |
|
20 | <p><%= pref_fields.select :time_zone, TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %></p> | |
|
21 | <p><%= pref_fields.check_box :hide_mail %></p> | |
|
22 | <% end %> | |
|
23 | 18 | </div> |
|
24 | 19 | |
|
25 | 20 | <%= submit_tag l(:button_save) %> |
@@ -38,6 +33,15 | |||
|
38 | 33 | <% end %> |
|
39 | 34 | <p><label><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified] %> <%= l(:label_user_mail_no_self_notified) %></label></p> |
|
40 | 35 | </div> |
|
36 | ||
|
37 | <h3><%=l(:label_preferences)%></h3> | |
|
38 | <div class="box tabular"> | |
|
39 | <% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %> | |
|
40 | <p><%= pref_fields.check_box :hide_mail %></p> | |
|
41 | <p><%= pref_fields.select :time_zone, TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %></p> | |
|
42 | <p><%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %></p> | |
|
43 | <% end %> | |
|
44 | </div> | |
|
41 | 45 | </div> |
|
42 | 46 | <% end %> |
|
43 | 47 |
@@ -34,14 +34,15 | |||
|
34 | 34 | |
|
35 | 35 | <div id="comments" style="margin-bottom:16px;"> |
|
36 | 36 | <h3 class="icon22 icon22-comment"><%= l(:label_comment_plural) %></h3> |
|
37 |
<% @ |
|
|
37 | <% @comments.each do |comment| %> | |
|
38 | 38 | <% next if comment.new_record? %> |
|
39 | <h4><%= authoring comment.created_on, comment.author %></h4> | |
|
40 | 39 | <div class="contextual"> |
|
41 |
|
|
|
40 | <%= link_to_if_authorized image_tag('delete.png'), {:controller => 'news', :action => 'destroy_comment', :id => @news, :comment_id => comment}, | |
|
41 | :confirm => l(:text_are_you_sure), :method => :post, :title => l(:button_delete) %> | |
|
42 | 42 | </div> |
|
43 | <h4><%= authoring comment.created_on, comment.author %></h4> | |
|
43 | 44 | <%= textilizable(comment.comments) %> |
|
44 |
<% end if @ |
|
|
45 | <% end if @comments.any? %> | |
|
45 | 46 | </div> |
|
46 | 47 | |
|
47 | 48 | <% if authorize_for 'news', 'add_comment' %> |
@@ -608,3 +608,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
608 | 608 | text_destroy_time_entries: Delete reported hours |
|
609 | 609 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
610 | 610 | setting_activity_days_default: Days displayed on project activity |
|
611 | label_chronological_order: In chronological order | |
|
612 | field_comments_sorting: Afficher les commentaires | |
|
613 | label_reverse_chronological_order: In reverse chronological order | |
|
614 | label_preferences: Preferences |
@@ -608,3 +608,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
608 | 608 | text_destroy_time_entries: Delete reported hours |
|
609 | 609 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
610 | 610 | setting_activity_days_default: Days displayed on project activity |
|
611 | label_chronological_order: In chronological order | |
|
612 | field_comments_sorting: Afficher les commentaires | |
|
613 | label_reverse_chronological_order: In reverse chronological order | |
|
614 | label_preferences: Preferences |
@@ -609,3 +609,7 enumeration_issue_priorities: Ticket-Prioritäten | |||
|
609 | 609 | enumeration_doc_categories: Dokumentenkategorien |
|
610 | 610 | enumeration_activities: Aktivitäten (Zeiterfassung) |
|
611 | 611 | setting_activity_days_default: Days displayed on project activity |
|
612 | label_chronological_order: In chronological order | |
|
613 | field_comments_sorting: Afficher les commentaires | |
|
614 | label_reverse_chronological_order: In reverse chronological order | |
|
615 | label_preferences: Preferences |
@@ -177,6 +177,7 field_column_names: Columns | |||
|
177 | 177 | field_time_zone: Time zone |
|
178 | 178 | field_searchable: Searchable |
|
179 | 179 | field_default_value: Default value |
|
180 | field_comments_sorting: Afficher les commentaires | |
|
180 | 181 | |
|
181 | 182 | setting_app_title: Application title |
|
182 | 183 | setting_app_subtitle: Application subtitle |
@@ -501,6 +502,9 label_ldap_authentication: LDAP authentication | |||
|
501 | 502 | label_downloads_abbr: D/L |
|
502 | 503 | label_optional_description: Optional description |
|
503 | 504 | label_add_another_file: Add another file |
|
505 | label_preferences: Preferences | |
|
506 | label_chronological_order: In chronological order | |
|
507 | label_reverse_chronological_order: In reverse chronological order | |
|
504 | 508 | |
|
505 | 509 | button_login: Login |
|
506 | 510 | button_submit: Submit |
@@ -611,3 +611,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
611 | 611 | text_destroy_time_entries: Delete reported hours |
|
612 | 612 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
613 | 613 | setting_activity_days_default: Days displayed on project activity |
|
614 | label_chronological_order: In chronological order | |
|
615 | field_comments_sorting: Afficher les commentaires | |
|
616 | label_reverse_chronological_order: In reverse chronological order | |
|
617 | label_preferences: Preferences |
@@ -612,3 +612,7 text_destroy_time_entries: Delete reported hours | |||
|
612 | 612 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
613 | 613 | label_on: 'on' |
|
614 | 614 | setting_activity_days_default: Days displayed on project activity |
|
615 | label_chronological_order: In chronological order | |
|
616 | field_comments_sorting: Afficher les commentaires | |
|
617 | label_reverse_chronological_order: In reverse chronological order | |
|
618 | label_preferences: Preferences |
@@ -177,6 +177,7 field_column_names: Colonnes | |||
|
177 | 177 | field_time_zone: Fuseau horaire |
|
178 | 178 | field_searchable: Utilisé pour les recherches |
|
179 | 179 | field_default_value: Valeur par défaut |
|
180 | field_comments_sorting: Afficher les commentaires | |
|
180 | 181 | |
|
181 | 182 | setting_app_title: Titre de l'application |
|
182 | 183 | setting_app_subtitle: Sous-titre de l'application |
@@ -501,6 +502,9 label_ldap_authentication: Authentification LDAP | |||
|
501 | 502 | label_downloads_abbr: D/L |
|
502 | 503 | label_optional_description: Description facultative |
|
503 | 504 | label_add_another_file: Ajouter un autre fichier |
|
505 | label_preferences: Préférences | |
|
506 | label_chronological_order: Dans l'ordre chronologique | |
|
507 | label_reverse_chronological_order: Dans l'ordre chronologique inverse | |
|
504 | 508 | |
|
505 | 509 | button_login: Connexion |
|
506 | 510 | button_submit: Soumettre |
@@ -608,3 +608,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
608 | 608 | text_destroy_time_entries: Delete reported hours |
|
609 | 609 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
610 | 610 | setting_activity_days_default: Days displayed on project activity |
|
611 | label_chronological_order: In chronological order | |
|
612 | field_comments_sorting: Afficher les commentaires | |
|
613 | label_reverse_chronological_order: In reverse chronological order | |
|
614 | label_preferences: Preferences |
@@ -608,3 +608,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
608 | 608 | text_destroy_time_entries: Delete reported hours |
|
609 | 609 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
610 | 610 | setting_activity_days_default: Days displayed on project activity |
|
611 | label_chronological_order: In chronological order | |
|
612 | field_comments_sorting: Afficher les commentaires | |
|
613 | label_reverse_chronological_order: In reverse chronological order | |
|
614 | label_preferences: Preferences |
@@ -609,3 +609,7 label_optional_description: Optional description | |||
|
609 | 609 | text_destroy_time_entries: Delete reported hours |
|
610 | 610 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
611 | 611 | setting_activity_days_default: Days displayed on project activity |
|
612 | label_chronological_order: In chronological order | |
|
613 | field_comments_sorting: Afficher les commentaires | |
|
614 | label_reverse_chronological_order: In reverse chronological order | |
|
615 | label_preferences: Preferences |
@@ -608,3 +608,7 label_last_month: last month | |||
|
608 | 608 | text_destroy_time_entries: Delete reported hours |
|
609 | 609 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
610 | 610 | setting_activity_days_default: Days displayed on project activity |
|
611 | label_chronological_order: In chronological order | |
|
612 | field_comments_sorting: Afficher les commentaires | |
|
613 | label_reverse_chronological_order: In reverse chronological order | |
|
614 | label_preferences: Preferences |
@@ -609,3 +609,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
609 | 609 | text_destroy_time_entries: Delete reported hours |
|
610 | 610 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
611 | 611 | setting_activity_days_default: Days displayed on project activity |
|
612 | label_chronological_order: In chronological order | |
|
613 | field_comments_sorting: Afficher les commentaires | |
|
614 | label_reverse_chronological_order: In reverse chronological order | |
|
615 | label_preferences: Preferences |
@@ -609,3 +609,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
609 | 609 | text_destroy_time_entries: Delete reported hours |
|
610 | 610 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
611 | 611 | setting_activity_days_default: Days displayed on project activity |
|
612 | label_chronological_order: In chronological order | |
|
613 | field_comments_sorting: Afficher les commentaires | |
|
614 | label_reverse_chronological_order: In reverse chronological order | |
|
615 | label_preferences: Preferences |
@@ -608,3 +608,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
608 | 608 | text_destroy_time_entries: Delete reported hours |
|
609 | 609 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
610 | 610 | setting_activity_days_default: Days displayed on project activity |
|
611 | label_chronological_order: In chronological order | |
|
612 | field_comments_sorting: Afficher les commentaires | |
|
613 | label_reverse_chronological_order: In reverse chronological order | |
|
614 | label_preferences: Preferences |
@@ -608,3 +608,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
608 | 608 | text_destroy_time_entries: Delete reported hours |
|
609 | 609 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
610 | 610 | setting_activity_days_default: Days displayed on project activity |
|
611 | label_chronological_order: In chronological order | |
|
612 | field_comments_sorting: Afficher les commentaires | |
|
613 | label_reverse_chronological_order: In reverse chronological order | |
|
614 | label_preferences: Preferences |
@@ -608,3 +608,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
608 | 608 | text_destroy_time_entries: Delete reported hours |
|
609 | 609 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
610 | 610 | setting_activity_days_default: Days displayed on project activity |
|
611 | label_chronological_order: In chronological order | |
|
612 | field_comments_sorting: Afficher les commentaires | |
|
613 | label_reverse_chronological_order: In reverse chronological order | |
|
614 | label_preferences: Preferences |
@@ -608,3 +608,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
608 | 608 | text_destroy_time_entries: Delete reported hours |
|
609 | 609 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
610 | 610 | setting_activity_days_default: Days displayed on project activity |
|
611 | label_chronological_order: In chronological order | |
|
612 | field_comments_sorting: Afficher les commentaires | |
|
613 | label_reverse_chronological_order: In reverse chronological order | |
|
614 | label_preferences: Preferences |
@@ -612,3 +612,7 text_assign_time_entries_to_project: Прикрепить зарегистрир | |||
|
612 | 612 | text_destroy_time_entries: Удалить зарегистрированное время |
|
613 | 613 | text_reassign_time_entries: 'Перенести зарегистрированное время на следующую задачу:' |
|
614 | 614 | setting_activity_days_default: Days displayed on project activity |
|
615 | label_chronological_order: In chronological order | |
|
616 | field_comments_sorting: Afficher les commentaires | |
|
617 | label_reverse_chronological_order: In reverse chronological order | |
|
618 | label_preferences: Preferences |
@@ -609,3 +609,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
609 | 609 | text_destroy_time_entries: Delete reported hours |
|
610 | 610 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
611 | 611 | setting_activity_days_default: Days displayed on project activity |
|
612 | label_chronological_order: In chronological order | |
|
613 | field_comments_sorting: Afficher les commentaires | |
|
614 | label_reverse_chronological_order: In reverse chronological order | |
|
615 | label_preferences: Preferences |
@@ -609,3 +609,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
609 | 609 | text_destroy_time_entries: Delete reported hours |
|
610 | 610 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
611 | 611 | setting_activity_days_default: Days displayed on project activity |
|
612 | label_chronological_order: In chronological order | |
|
613 | field_comments_sorting: Afficher les commentaires | |
|
614 | label_reverse_chronological_order: In reverse chronological order | |
|
615 | label_preferences: Preferences |
@@ -610,3 +610,7 text_assign_time_entries_to_project: Assign reported hours to the project | |||
|
610 | 610 | text_destroy_time_entries: Delete reported hours |
|
611 | 611 | text_reassign_time_entries: 'Reassign reported hours to this issue:' |
|
612 | 612 | setting_activity_days_default: Days displayed on project activity |
|
613 | label_chronological_order: In chronological order | |
|
614 | field_comments_sorting: Afficher les commentaires | |
|
615 | label_reverse_chronological_order: In reverse chronological order | |
|
616 | label_preferences: Preferences |
@@ -609,3 +609,7 enumeration_issue_priorities: 項目優先權 | |||
|
609 | 609 | enumeration_doc_categories: 文件分類 |
|
610 | 610 | enumeration_activities: 活動 (time tracking) |
|
611 | 611 | setting_activity_days_default: Days displayed on project activity |
|
612 | label_chronological_order: In chronological order | |
|
613 | field_comments_sorting: Afficher les commentaires | |
|
614 | label_reverse_chronological_order: In reverse chronological order | |
|
615 | label_preferences: Preferences |
@@ -609,3 +609,7 enumeration_issue_priorities: 问题优先级 | |||
|
609 | 609 | enumeration_doc_categories: 文档类别 |
|
610 | 610 | enumeration_activities: 活动(时间跟踪) |
|
611 | 611 | setting_activity_days_default: Days displayed on project activity |
|
612 | label_chronological_order: In chronological order | |
|
613 | field_comments_sorting: Afficher les commentaires | |
|
614 | label_reverse_chronological_order: In reverse chronological order | |
|
615 | label_preferences: Preferences |
@@ -144,4 +144,12 class UserTest < Test::Unit::TestCase | |||
|
144 | 144 | @jsmith.reload |
|
145 | 145 | assert !@jsmith.projects.first.recipients.include?(@jsmith.mail) |
|
146 | 146 | end |
|
147 | ||
|
148 | def test_comments_sorting_preference | |
|
149 | assert !@jsmith.wants_comments_in_reverse_order? | |
|
150 | @jsmith.pref.comments_sorting = 'asc' | |
|
151 | assert !@jsmith.wants_comments_in_reverse_order? | |
|
152 | @jsmith.pref.comments_sorting = 'desc' | |
|
153 | assert @jsmith.wants_comments_in_reverse_order? | |
|
154 | end | |
|
147 | 155 | end |
General Comments 0
You need to be logged in to leave comments.
Login now