Merge branch 'feature/progress_report' of https://dev.finn.de/git/reporting-engine into feature/progress_report

Conflicts:
	lib/widget/table/progressbar.rb
pull/6827/head
jwollert 14 years ago
commit 6ff5267382
  1. 2
      lib/report/controller.rb
  2. 1
      lib/widget/base.rb
  3. 2
      lib/widget/filters/date.rb
  4. 5
      lib/widget/table/progressbar.rb

@ -38,7 +38,7 @@ module Report::Controller
end end
def table_with_progress_info def table_with_progress_info
render_widget Widget::Table::Progressbar, @query render :text => render_widget(Widget::Table::Progressbar, @query), :layout => false
end end
if Rails.version.start_with? "3" if Rails.version.start_with? "3"

@ -18,6 +18,7 @@ class Widget::Base < Widget
# Write a string to the canvas. The string is marked as html_safe. # Write a string to the canvas. The string is marked as html_safe.
# This will write twice, if @cache_output is set. # This will write twice, if @cache_output is set.
def write(str) def write(str)
str ||= ""
@output ||= "".html_safe @output ||= "".html_safe
@output.write str.html_safe @output.write str.html_safe
@cache_output.write(str.html_safe) if @cache_output @cache_output.write(str.html_safe) if @cache_output

@ -1,6 +1,6 @@
class Widget::Filters::Date < Widget::Filters::Base class Widget::Filters::Date < Widget::Filters::Base
def calendar_for(field_id) 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"}) + 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' });") javascript_tag("Calendar.setup({inputField : '#{field_id}', ifFormat : '%Y-%m-%d', button : '#{field_id}_trigger' });")
end end

@ -1,10 +1,9 @@
class Widget::Table::Progressbar < Widget::Base class Widget::Table::Progressbar < Widget::Base
attr_accessor :threshhold THRESHHOLD = 500
def render def render
@threshhold ||= 500
size = @query.size size = @query.size
if size >= @threshhold || cached? if size >= THRESHHOLD || cached?
write(content_tag :div, :id => "progressbar", :class => "form_controls", write(content_tag :div, :id => "progressbar", :class => "form_controls",
:"data-query-size" => size do :"data-query-size" => size do
content_tag :div, :id => "progressbar-load-table-question", :class => "form_controls" do content_tag :div, :id => "progressbar-load-table-question", :class => "form_controls" do

Loading…
Cancel
Save