Commit bc8b33840bb2dc4ede4090bebd35e1a75e265929
Committed by
João M. M. da Silva
1 parent
57341341
Exists in
master
and in
28 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 | 2 | |
3 | 3 | append_view_path File.join(File.dirname(__FILE__) + '/../../views') |
4 | 4 | |
5 | - def project_state | |
5 | + def processing_state | |
6 | 6 | @content = profile.articles.find(params[:id]) |
7 | - project = @content.project | |
7 | + processing = @content.processing | |
8 | 8 | if project_content_has_errors? |
9 | 9 | redirect_to_error_page(@content.errors[:base]) |
10 | 10 | else |
11 | - state = project.kalibro_error.nil? ? project.state : "ERROR" | |
12 | - render :text => state | |
11 | + render :text => processing.state | |
13 | 12 | end |
14 | 13 | end |
15 | 14 | |
16 | - def project_error | |
15 | + def processing_error | |
17 | 16 | @content = profile.articles.find(params[:id]) |
18 | - @project = @content.project | |
17 | + @processing = @content.processing | |
19 | 18 | if project_content_has_errors? |
20 | 19 | redirect_to_error_page(@content.errors[:base]) |
21 | 20 | else |
22 | - render :partial => 'project_error' | |
21 | + render :partial => 'processing_error' | |
23 | 22 | end |
24 | 23 | end |
25 | 24 | |
26 | - def project_result | |
25 | + def processing | |
27 | 26 | @content = profile.articles.find(params[:id]) |
28 | 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 | 29 | if project_content_has_errors? |
31 | 30 | redirect_to_error_page(@content.errors[:base]) |
32 | 31 | else |
33 | - render :partial => 'project_result' | |
32 | + render :partial => 'processing' | |
34 | 33 | end |
35 | 34 | end |
36 | 35 | ... | ... |