Project

General

Profile

Feature #202 » textilization_for_spent_time_comments_with_test-fix-21.patch

Takenori TAKAKI, 2023-10-12 07:07

View differences:

app/helpers/queries_helper.rb
258 258
        link_to value, issue_path(item)
259 259
      when :parent, :'issue.parent'
260 260
        value ? (value.visible? ? link_to_issue(value, :subject => false) : "##{value.id}") : ''
261
      when :description
262
        item.description? ? content_tag('div', textilizable(item, :description), :class => "wiki") : ''
263
      when :last_notes
264
        item.last_notes.present? ? content_tag('div', textilizable(item, :last_notes), :class => "wiki") : ''
261
      when :description, :last_notes, :comments
262
        item.send(column.name).present? ? content_tag('div', textilizable(item, column.name), :class => 'wiki') : ''
265 263
      when :done_ratio
266 264
        progress_bar(value)
267 265
      when :relations
app/views/issues/tabs/_time_entries.html.erb
25 25
        <%= l_hours_short time_entry.hours %>
26 26
      </li>
27 27
    </ul>
28
    <p><%= time_entry.comments %></p>
28
    <p><%= textilizable time_entry.comments %></p>
29 29
    </div>
30 30
  </div>
31 31
  <%= call_hook(:view_issues_history_time_entry_bottom, { :time_entry => time_entry }) %>
32
<% end %>
32
<% end %>
app/views/timelog/_form.html.erb
27 27
  <% end %>
28 28
  <p><%= f.date_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
29 29
  <p><%= f.hours_field :hours, :size => 6, :required => true %></p>
30
  <p><%= f.text_field :comments, :size => 100, :maxlength => 1024, :required => Setting.timelog_required_fields.include?('comments') %></p>
31 30
  <p><%= f.select :activity_id, activity_collection_for_select_options(@time_entry), :required => true %></p>
31
  <p><%= f.text_area :comments,
32
                     :class => 'wiki-edit',
33
                     :cols => 60,
34
                     :rows => [[5, @time_entry.comments.to_s.length / 50].max, 10].min,
35
                     :maxlength => 1024 %></p>
32 36
  <% @time_entry.editable_custom_field_values.each do |value| %>
33 37
    <p><%= custom_field_tag_with_label :time_entry, value %></p>
34 38
    <% if value.custom_field.full_text_formatting? %>
......
38 42
  <%= call_hook(:view_timelog_edit_form_bottom, { :time_entry => @time_entry, :form => f }) %>
39 43
</div>
40 44

  
45
<%= wikitoolbar_for 'time_entry_comments' %>
46

  
41 47
<%= javascript_tag do %>
42 48
  $(document).ready(function(){
43 49
    $('#time_entry_project_id').change(function(){
test/helpers/queries_helper_test.rb
105 105
      assert_include "Non", csv
106 106
    end
107 107
  end
108

  
109
  def test_column_value_should_textilize_item
110
    with_settings :text_formatting => 'textile' do
111
      column = QueryColumn.new(:description)
112
      item = Issue.generate!(:description => '*issue description*')
113
      value = column.value_object(item)
114
      assert_select_in column_value(column, item, value), 'div.wiki>p>strong', :text => 'issue description'
115
      column = QueryColumn.new(:last_notes)
116
      Journal.generate!(journalized: item, notes: '*last note*')
117
      value = column.value_object(item)
118
      assert_select_in column_value(column, item, value), 'div.wiki>p>strong', :text => 'last note'
119
      column = QueryColumn.new(:comments)
120
      item = TimeEntry.generate!(:comments => '*time entry comments*')
121
      value = column.value_object(item)
122
      assert_select_in column_value(column, item, value), 'div.wiki>p>strong', :text => 'time entry comments'
123
    end
124
  end
108 125
end
(10-10/10)