Commit bc8b33840bb2dc4ede4090bebd35e1a75e265929
Committed by
João M. M. da Silva
1 parent
57341341
Exists in
master
and in
29 other branches
[Mezuro] Refactored Project Controller
Showing
1 changed file
with
9 additions
and
10 deletions
Show diff stats
plugins/mezuro/controllers/profile/mezuro_plugin_project_controller.rb
@@ -2,35 +2,34 @@ class MezuroPluginProjectController < MezuroPluginProfileController | @@ -2,35 +2,34 @@ class MezuroPluginProjectController < MezuroPluginProfileController | ||
2 | 2 | ||
3 | append_view_path File.join(File.dirname(__FILE__) + '/../../views') | 3 | append_view_path File.join(File.dirname(__FILE__) + '/../../views') |
4 | 4 | ||
5 | - def project_state | 5 | + def processing_state |
6 | @content = profile.articles.find(params[:id]) | 6 | @content = profile.articles.find(params[:id]) |
7 | - project = @content.project | 7 | + processing = @content.processing |
8 | if project_content_has_errors? | 8 | if project_content_has_errors? |
9 | redirect_to_error_page(@content.errors[:base]) | 9 | redirect_to_error_page(@content.errors[:base]) |
10 | else | 10 | else |
11 | - state = project.kalibro_error.nil? ? project.state : "ERROR" | ||
12 | - render :text => state | 11 | + render :text => processing.state |
13 | end | 12 | end |
14 | end | 13 | end |
15 | 14 | ||
16 | - def project_error | 15 | + def processing_error |
17 | @content = profile.articles.find(params[:id]) | 16 | @content = profile.articles.find(params[:id]) |
18 | - @project = @content.project | 17 | + @processing = @content.processing |
19 | if project_content_has_errors? | 18 | if project_content_has_errors? |
20 | redirect_to_error_page(@content.errors[:base]) | 19 | redirect_to_error_page(@content.errors[:base]) |
21 | else | 20 | else |
22 | - render :partial => 'project_error' | 21 | + render :partial => 'processing_error' |
23 | end | 22 | end |
24 | end | 23 | end |
25 | 24 | ||
26 | - def project_result | 25 | + def processing |
27 | @content = profile.articles.find(params[:id]) | 26 | @content = profile.articles.find(params[:id]) |
28 | date = params[:date] | 27 | date = params[:date] |
29 | - @project_result = date.nil? ? @content.project_result : @content.project_result_with_date(date) | 28 | + @processing = date.nil? ? @content.processing : @content.processing_with_date(date) |
30 | if project_content_has_errors? | 29 | if project_content_has_errors? |
31 | redirect_to_error_page(@content.errors[:base]) | 30 | redirect_to_error_page(@content.errors[:base]) |
32 | else | 31 | else |
33 | - render :partial => 'project_result' | 32 | + render :partial => 'processing' |
34 | end | 33 | end |
35 | end | 34 | end |
36 | 35 |