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

pull/6827/head
jwollert 14 years ago
commit 460633ee47
  1. 1
      assets/javascripts/reporting/progressbar.js
  2. 1
      config/locales/de.yml
  3. 1
      config/locales/en.yml
  4. 2
      lib/widget.rb
  5. 22
      lib/widget/table/progressbar.rb

@ -28,6 +28,7 @@ Reporting.Progress = {
var question = bar.getAttribute('data-translation');
if (confirm(question)) {
var target = bar.getAttribute("data-target");
bar.up().show();
Reporting.Progress.replace_with_bar(bar);
Reporting.Controls.send_settings_data(target, Reporting.Controls.update_result_table);
} else {

@ -28,3 +28,4 @@ de:
validation_failure_integer: "ist keine ganze Zahl"
load_query_question: "Der Report wird %{size} Tabellen-Zellen haben, was sehr rechenintensiv sein kann. Wollen Sie dennoch versuchen, den Report durch zu führen?"
label_progress_bar_explanation: "Report wird erstellt ..."

@ -28,3 +28,4 @@ en:
validation_failure_integer: "is not a valid integer"
load_query_question: "Report will have %{size} table cells and may take some time to render. Do you still want to try rendering it?"
label_progress_bar_explanation: "Generating report..."

@ -31,7 +31,7 @@ class Widget < ActionView::Base
begin
controller.send(name, *args, &block)
rescue NoMethodError
throw NoMethodError, "undefined method `#{name}' for #<#{self.class}:0x#{self.object_id}>"
raise NoMethodError, "undefined method `#{name}' for #<#{self.class}:0x#{self.object_id}>"
end
end

@ -2,16 +2,22 @@ class Widget::Table::Progressbar < Widget::Base
dont_cache!
def render
if Widget::Table::ReportTable.new(@query).cached? || (size = @query.size) <= THRESHHOLD
if Widget::Table::ReportTable.new(@query).cached? || @query.size <= THRESHHOLD
render_widget Widget::Table::ReportTable, @query, :to => (@output ||= "".html_safe)
else
write(content_tag :div,
:id => "progressbar",
:class => "form_controls",
:"data-query-size" => size,
:"data-translation" => ::I18n.translate(:label_load_query_question, :size => size),
:"data-target" => url_for(:action => 'index', :set_filter => '1', :immediately => true) do
end)
write(content_tag :div, :style => "display:none" do
content_tag(:div, l(:label_progress_bar_explanation).html_safe) +
render_progress_bar
end)
end
end
def render_progress_bar
content_tag(:div, "",
:id => "progressbar",
:class => "form_controls",
:"data-query-size" => @query.size,
:"data-translation" => ::I18n.translate(:label_load_query_question, :size => @query.size),
:"data-target" => url_for(:action => 'index', :set_filter => '1', :immediately => true))
end
end

Loading…
Cancel
Save