diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb index f86fb07eba..a06339e01e 100644 --- a/app/views/issues/_edit.html.erb +++ b/app/views/issues/_edit.html.erb @@ -21,7 +21,13 @@

<%= time_entry.select :activity_id, activity_collection_for_select_options %>

-

<%= time_entry.text_field :comments, :size => 60 %>

+

+ <%= time_entry.textarea :comments, :cols => 60, :rows => 3, + :maxlength => 1024, + :class => 'wiki-edit', + :data => wiki_textarea_stimulus_attributes %> +

+ <%= wikitoolbar_for 'time_entry_comments', preview_issue_path(:project_id => @project, :issue_id => @issue) %> <% @time_entry.editable_custom_field_values.each do |value| %>

<%= custom_field_tag_with_label :time_entry, value %>

<% end %> diff --git a/app/views/my/blocks/_timelog.html.erb b/app/views/my/blocks/_timelog.html.erb index cfcfc1824b..eb1461047a 100644 --- a/app/views/my/blocks/_timelog.html.erb +++ b/app/views/my/blocks/_timelog.html.erb @@ -52,7 +52,7 @@ <%= entry.activity %> <%= entry.project %> <%= h(' - ') + link_to_issue(entry.issue, :truncate => 50) if entry.issue %> - <%= entry.comments %> + <%= content_tag('div', textilizable(entry, :comments), :class => 'wiki') if entry.comments.present? %> <%= html_hours(format_hours(entry.hours)) %> <%= link_to_context_menu %> diff --git a/app/views/timelog/bulk_edit.html.erb b/app/views/timelog/bulk_edit.html.erb index 4f496470a8..fbf71316ea 100644 --- a/app/views/timelog/bulk_edit.html.erb +++ b/app/views/timelog/bulk_edit.html.erb @@ -65,8 +65,12 @@

- <%= text_field(:time_entry, :comments, :size => 100, :value => @time_entry_params[:comments]) %> + <%= textarea_tag 'time_entry[comments]', @time_entry_params[:comments], + :cols => 60, :rows => 3, + :maxlength => 1024, :class => 'wiki-edit', + :data => wiki_textarea_stimulus_attributes %>

+ <%= wikitoolbar_for 'time_entry_comments', (@project ? preview_issue_path(:project_id => @project) : preview_text_path) %> <% @custom_fields.each do |custom_field| %>

diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 8a6f4e978b..6929a87996 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -6363,7 +6363,8 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select 'select[name=?]', 'time_entry[activity_id]' do assert_select 'option[value="10"][selected=selected]', :text => 'Development' end - assert_select 'input[name=?][value=test_get_edit_with_params]', 'time_entry[comments]' + assert_select 'textarea.wiki-edit[name=?]', 'time_entry[comments]', :text => 'test_get_edit_with_params' + assert_select 'script', :text => /new jsToolBar\(document\.getElementById\('time_entry_comments'\)\)/ end def test_get_edit_with_multi_custom_field @@ -7317,7 +7318,7 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select_error /Activity cannot be blank/ assert_select_error /Hours cannot be blank/ assert_select 'textarea[name=?]', 'issue[notes]', :text => notes - assert_select 'input[name=?][value=?]', 'time_entry[comments]', 'this is my comment' + assert_select 'textarea[name=?]', 'time_entry[comments]', :text => 'this is my comment' end def test_put_with_spent_time_when_assigned_to_of_private_issue_is_update_at_the_same_time diff --git a/test/functional/issues_controller_transaction_test.rb b/test/functional/issues_controller_transaction_test.rb index 8937125496..49c4c89d48 100644 --- a/test/functional/issues_controller_transaction_test.rb +++ b/test/functional/issues_controller_transaction_test.rb @@ -327,7 +327,7 @@ class IssuesControllerTransactionTest < Redmine::ControllerTest end assert_select 'input[name=?][value=?]', 'time_entry[hours]', '2:30' - assert_select 'input[name=?][value=?]', 'time_entry[comments]', 'should not be added' + assert_select 'textarea[name=?]', 'time_entry[comments]', :text => 'should not be added' assert_select 'select[name=?]', 'time_entry[activity_id]' do assert_select 'option[value=?][selected=selected]', TimeEntryActivity.first.id.to_s end diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb index 92fbb9643f..7904373438 100644 --- a/test/functional/my_controller_test.rb +++ b/test/functional/my_controller_test.rb @@ -43,21 +43,26 @@ class MyControllerTest < Redmine::ControllerTest with_issue = TimeEntry.create!( :user => User.find(2), :spent_on => Date.yesterday, - :hours => 2.5, :activity_id => 10, :issue_id => 1 + :hours => 2.5, :activity_id => 10, :issue_id => 1, + :comments => '*formatted*' ) without_issue = TimeEntry.create!( :user => User.find(2), :spent_on => Date.yesterday, :hours => 3.5, :activity_id => 10, :project_id => 1 ) - get :page + with_settings :text_formatting => 'textile' do + get :page + end assert_response :success assert_select "tr#time-entry-#{with_issue.id}" do assert_select 'td.subject a[href="/issues/1"]' assert_select 'td.hours', :text => '2:30' + assert_select 'td.comments div.wiki strong', :text => 'formatted' end assert_select "tr#time-entry-#{without_issue.id}" do assert_select 'td.hours', :text => '3:30' + assert_select 'td.comments div.wiki', 0 end end diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index bf796f73f8..4d3f426c62 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -752,6 +752,8 @@ class TimelogControllerTest < Redmine::ControllerTest # System wide custom field assert_select 'select[name=?]', 'time_entry[custom_field_values][10]' + assert_select 'textarea.wiki-edit[name=?]', 'time_entry[comments]', :text => '' + # Activities assert_select 'select[name=?]', 'time_entry[activity_id]' do assert_select 'option[value=""]', :text => '(No change)'