introduce progressbar widget

pull/6827/head
jwollert 14 years ago
parent 0a3253ee7e
commit 8687541d9f
  1. 3
      assets/javascripts/reporting.js
  2. 1
      assets/javascripts/reporting/controls.js
  3. 23
      assets/javascripts/reporting/progressbar.js
  4. 7
      assets/stylesheets/reporting.css
  5. 15
      lib/report/controller.rb

@ -62,3 +62,6 @@ Reporting.require("filters");
Reporting.require("group_bys");
Reporting.require("restore_query");
Reporting.require("controls");
Reporting.require("progressbar");

@ -115,6 +115,7 @@ Reporting.Controls = {
update_result_table: function (response) {
$('result-table').update(response.responseText);
Reporting.Progress.attach_listeners();
},
default_failure_callback: function (response) {

@ -0,0 +1,23 @@
/*jslint white: false, nomen: true, devel: true, on: true, debug: false, evil: true, onevar: false, browser: true, white: false, indent: 2 */
/*global window, $, $$, Reporting, Effect, Ajax */
Reporting.Progress = {
attach_listeners: function () {
if ($('progressbar') !== null && $('progressbar') !== undefined) {
$('progressbar').select('span[data-load]').each(function (element) {
element.observe("click", function (e) {
if (this.getAttribute("data-load") === "true") {
Reporting.Controls.send_settings_data(this.getAttribute("data-target"), Reporting.Controls.update_result_table);
} else {
$('progressbar').toggle();
}
});
});
}
}
};
Reporting.onload(function () {
Reporting.Progress.attach_listeners();
});

@ -472,6 +472,13 @@ div.button_form p * {
z-index: 999;
}
#progressbar {
border: 2px solid #ddd;
padding: 2px;
width: 45%;
background-color: #ededed;
}
/***** Ajax indicator ******/
#ajax-indicator {
font-family: Verdana, sans-serif;

@ -14,19 +14,22 @@ module Report::Controller
end
end
##
# Render the report. Renders either the complete index or the table only
def index
table
end
##
# Render the table partial, if we are setting filters/groups
# Render the report. Renders either the complete index or the table only
def table
if set_filter?
render :partial => 'table'
session[report_engine.name.underscore.to_sym].delete(:name)
if params[:immediately]
table_without_progress_info
else
render :partial => "table", :locals => { :query => @query } if set_filter?
end
end
def table_without_progress_info
render :partial => 'table_without_progress_info' if set_filter?
end
##

Loading…
Cancel
Save