Feature #202 » textilization_for_spent_time_comments_with_test.patch
| app/helpers/queries_helper.rb | ||
|---|---|---|
|
link_to value, issue_path(item)
|
||
|
when :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
|
||
| app/views/timelog/_form.html.erb | ||
|---|---|---|
|
<% end %>
|
||
|
<p><%= f.date_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
|
||
|
<p><%= f.hours_field :hours, :size => 6, :required => true %></p>
|
||
|
<p><%= f.text_field :comments, :size => 100, :maxlength => 1024, :required => Setting.timelog_required_fields.include?('comments') %></p>
|
||
|
<p><%= f.select :activity_id, activity_collection_for_select_options(@time_entry), :required => true %></p>
|
||
|
<p><%= f.text_area :comments,
|
||
|
:class => 'wiki-edit',
|
||
|
:cols => 60,
|
||
|
:rows => [[5, @time_entry.comments.to_s.length / 50].max, 10].min,
|
||
|
:maxlength => 1024 %></p>
|
||
|
<% @time_entry.editable_custom_field_values.each do |value| %>
|
||
|
<p><%= custom_field_tag_with_label :time_entry, value %></p>
|
||
|
<% if value.custom_field.full_text_formatting? %>
|
||
| ... | ... | |
|
<%= call_hook(:view_timelog_edit_form_bottom, { :time_entry => @time_entry, :form => f }) %>
|
||
|
</div>
|
||
|
<%= wikitoolbar_for 'time_entry_comments' %>
|
||
|
<%= javascript_tag do %>
|
||
|
$(document).ready(function(){
|
||
|
$('#time_entry_project_id').change(function(){
|
||
| test/helpers/queries_helper_test.rb | ||
|---|---|---|
|
class QueriesHelperTest < Redmine::HelperTest
|
||
|
include QueriesHelper
|
||
|
include ERB::Util
|
||
|
fixtures :projects, :enabled_modules, :users, :members,
|
||
|
:member_roles, :roles, :trackers, :issue_statuses,
|
||
| ... | ... | |
|
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
|
||