|
|
@ -36,19 +36,13 @@ module Report::Controller |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def table_without_progress_info |
|
|
|
def table_without_progress_info |
|
|
|
stream do |
|
|
|
render :text => render_widget(Widget::Table, @query), :layout => !request.xhr? |
|
|
|
render_widget Widget::Table, @query |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def table_with_progress_info |
|
|
|
def table_with_progress_info |
|
|
|
render :text => render_widget(Widget::Table::Progressbar, @query), :layout => !request.xhr? |
|
|
|
render :text => render_widget(Widget::Table::Progressbar, @query), :layout => !request.xhr? |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def stream(&block) |
|
|
|
|
|
|
|
self.response_body = block |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## |
|
|
|
## |
|
|
|
# Create a new saved query. Returns the redirect url to an XHR or redirects directly |
|
|
|
# Create a new saved query. Returns the redirect url to an XHR or redirects directly |
|
|
|
def create |
|
|
|
def create |
|
|
@ -56,9 +50,9 @@ module Report::Controller |
|
|
|
@query.public! if make_query_public? |
|
|
|
@query.public! if make_query_public? |
|
|
|
@query.send("#{user_key}=", current_user.id) |
|
|
|
@query.send("#{user_key}=", current_user.id) |
|
|
|
@query.save! |
|
|
|
@query.save! |
|
|
|
if request.xhr? # Update via AJAX - return url for redirect |
|
|
|
if request.xhr? |
|
|
|
render :text => url_for(:action => "show", :id => @query.id) |
|
|
|
table |
|
|
|
else # Redirect to the new record |
|
|
|
else |
|
|
|
redirect_to :action => "show", :id => @query.id |
|
|
|
redirect_to :action => "show", :id => @query.id |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|