diff --git a/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb index 1e7f1c0..f78429a 100644 --- a/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb +++ b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb @@ -20,12 +20,6 @@ class MezuroPluginProfileController < ProfileController render :partial => 'content_viewer/project_error', :locals => { :project => project } end - def project_processing - content = profile.articles.find(params[:id]) - project = content.project - render :partial => 'content_viewer/project_processing', :locals => { :project => project } - end - def project_state content = profile.articles.find(params[:id]) project = content.project diff --git a/plugins/mezuro/public/javascripts/dynamic.js b/plugins/mezuro/public/javascripts/dynamic.js index 7a90e48..10fbba6 100644 --- a/plugins/mezuro/public/javascripts/dynamic.js +++ b/plugins/mezuro/public/javascripts/dynamic.js @@ -9,16 +9,30 @@ function endpoint(action){ } function select_project_partial(state){ - var action; + var action, callback = show_project_content; if (state == 'ERROR') action = 'project_error'; else if (state == 'READY') action = 'project_result'; - else - action = 'project_processing'; - jQuery.get(endpoint(action), {}, show_project_content); + else { +// wait(10); + action = 'project_state'; + callback = select_project_partial; + } + jQuery.get(endpoint(action), {}, callback); } +//function wait(seconds){ +// var remaining = seconds; +// while(remaining > 0){ +// setTimeout(function() { +// jQuery('#project-content').html("Processing. Trying again in " + remaining + " seconds"); +// }, 1000); +// remaining--; +// } +// jQuery('#project-content').html("Trying now..."); +//} + function show_project_content(content){ jQuery('#project-content').html(content); jQuery('.module-result-link').click(show_module_result); diff --git a/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb b/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb index da4b5e9..33e2d2d 100644 --- a/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb +++ b/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb @@ -56,14 +56,6 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase assert_select('h3', 'ERROR') end - should 'get project processing' do - create_project_content - Kalibro::Client::ProjectClient.expects(:project).with(@name).returns(@project) - get :project_processing, :profile => @profile.identifier, :id => @content.id - assert_response 200 - assert_select('h3', 'Service is processing Qt-Calculator...') - end - should 'get error state if project has error' do create_project_content Kalibro::Client::ProjectClient.expects(:project).with(@name).returns(@project) diff --git a/plugins/mezuro/views/content_viewer/_project_processing.rhtml b/plugins/mezuro/views/content_viewer/_project_processing.rhtml deleted file mode 100644 index 66d8231..0000000 --- a/plugins/mezuro/views/content_viewer/_project_processing.rhtml +++ /dev/null @@ -1 +0,0 @@ -