diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index 662e22ee8..5bf86ebeb 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -258,10 +258,8 @@ module QueriesHelper link_to value, issue_path(item) when :parent, :'issue.parent' value ? (value.visible? ? link_to_issue(value, :subject => false) : "##{value.id}") : '' - when :description - item.description? ? content_tag('div', textilizable(item, :description), :class => "wiki") : '' - when :last_notes - item.last_notes.present? ? content_tag('div', textilizable(item, :last_notes), :class => "wiki") : '' + when :description, :last_notes, :comments + item.send(column.name).present? ? content_tag('div', textilizable(item, column.name), :class => 'wiki') : '' when :done_ratio progress_bar(value) when :relations diff --git a/app/views/issues/tabs/_time_entries.html.erb b/app/views/issues/tabs/_time_entries.html.erb index 1807475bd..f6caefbab 100644 --- a/app/views/issues/tabs/_time_entries.html.erb +++ b/app/views/issues/tabs/_time_entries.html.erb @@ -25,8 +25,8 @@ <%= l_hours_short time_entry.hours %> -

<%= time_entry.comments %>

+

<%= textilizable time_entry.comments %>

<%= call_hook(:view_issues_history_time_entry_bottom, { :time_entry => time_entry }) %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/timelog/_form.html.erb b/app/views/timelog/_form.html.erb index 3a0543e7c..2af369e47 100644 --- a/app/views/timelog/_form.html.erb +++ b/app/views/timelog/_form.html.erb @@ -27,8 +27,12 @@ <% end %>

<%= f.date_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %>

<%= f.hours_field :hours, :size => 6, :required => true %>

-

<%= f.text_field :comments, :size => 100, :maxlength => 1024, :required => Setting.timelog_required_fields.include?('comments') %>

<%= f.select :activity_id, activity_collection_for_select_options(@time_entry), :required => true %>

+

<%= f.text_area :comments, + :class => 'wiki-edit', + :cols => 60, + :rows => [[5, @time_entry.comments.to_s.length / 50].max, 10].min, + :maxlength => 1024 %>

<% @time_entry.editable_custom_field_values.each do |value| %>

<%= custom_field_tag_with_label :time_entry, value %>

<% if value.custom_field.full_text_formatting? %> @@ -38,6 +42,8 @@ <%= call_hook(:view_timelog_edit_form_bottom, { :time_entry => @time_entry, :form => f }) %> +<%= wikitoolbar_for 'time_entry_comments' %> + <%= javascript_tag do %> $(document).ready(function(){ $('#time_entry_project_id').change(function(){ diff --git a/test/helpers/queries_helper_test.rb b/test/helpers/queries_helper_test.rb index b2943bd03..2451f431a 100644 --- a/test/helpers/queries_helper_test.rb +++ b/test/helpers/queries_helper_test.rb @@ -105,4 +105,21 @@ class QueriesHelperTest < Redmine::HelperTest assert_include "Non", csv end end + + def test_column_value_should_textilize_item + with_settings :text_formatting => 'textile' do + column = QueryColumn.new(:description) + item = Issue.generate!(:description => '*issue description*') + value = column.value_object(item) + assert_select_in column_value(column, item, value), 'div.wiki>p>strong', :text => 'issue description' + column = QueryColumn.new(:last_notes) + Journal.generate!(journalized: item, notes: '*last note*') + value = column.value_object(item) + assert_select_in column_value(column, item, value), 'div.wiki>p>strong', :text => 'last note' + column = QueryColumn.new(:comments) + item = TimeEntry.generate!(:comments => '*time entry comments*') + value = column.value_object(item) + assert_select_in column_value(column, item, value), 'div.wiki>p>strong', :text => 'time entry comments' + end + end end