diff --git a/lib/report/controller.rb b/lib/report/controller.rb index 48f32616c4..8407798596 100644 --- a/lib/report/controller.rb +++ b/lib/report/controller.rb @@ -38,7 +38,7 @@ module Report::Controller end def table_with_progress_info - render_widget Widget::Table::Progressbar, @query + render :text => render_widget(Widget::Table::Progressbar, @query), :layout => false end if Rails.version.start_with? "3" diff --git a/lib/widget/base.rb b/lib/widget/base.rb index 5eb5205936..94d063d2f3 100644 --- a/lib/widget/base.rb +++ b/lib/widget/base.rb @@ -18,6 +18,7 @@ class Widget::Base < Widget # Write a string to the canvas. The string is marked as html_safe. # This will write twice, if @cache_output is set. def write(str) + str ||= "" @output ||= "".html_safe @output.write str.html_safe @cache_output.write(str.html_safe) if @cache_output diff --git a/lib/widget/filters/date.rb b/lib/widget/filters/date.rb index 8ea167e5f0..afec956496 100644 --- a/lib/widget/filters/date.rb +++ b/lib/widget/filters/date.rb @@ -1,6 +1,6 @@ class Widget::Filters::Date < Widget::Filters::Base def calendar_for(field_id) - include_calendar_headers_tags + write include_calendar_headers_tags image_tag("calendar.png", {:id => "#{field_id}_trigger",:class => "calendar-trigger"}) + javascript_tag("Calendar.setup({inputField : '#{field_id}', ifFormat : '%Y-%m-%d', button : '#{field_id}_trigger' });") end diff --git a/lib/widget/table/progressbar.rb b/lib/widget/table/progressbar.rb index 4ebf132c1f..8011add85e 100644 --- a/lib/widget/table/progressbar.rb +++ b/lib/widget/table/progressbar.rb @@ -1,10 +1,9 @@ class Widget::Table::Progressbar < Widget::Base - attr_accessor :threshhold + THRESHHOLD = 500 def render - @threshhold ||= 500 size = @query.size - if size >= @threshhold || cached? + if size >= THRESHHOLD || cached? write(content_tag :div, :id => "progressbar", :class => "form_controls", :"data-query-size" => size do content_tag :div, :id => "progressbar-load-table-question", :class => "form_controls" do