From 3a92026daf9daf5dfa5965aa40518bf3306a9f49 Mon Sep 17 00:00:00 2001
From: Alessandro Palmeira + Carlos Morais
Date: Fri, 17 Feb 2012 11:46:37 -0200
Subject: [PATCH] [Mezuro] Added project states partials
---
plugins/mezuro/views/content_viewer/_project_error.rhtml | 12 ++++++++++++
plugins/mezuro/views/content_viewer/_project_processing.rhtml | 1 +
plugins/mezuro/views/content_viewer/show_project.rhtml | 17 +++--------------
3 files changed, 16 insertions(+), 14 deletions(-)
create mode 100644 plugins/mezuro/views/content_viewer/_project_error.rhtml
create mode 100644 plugins/mezuro/views/content_viewer/_project_processing.rhtml
diff --git a/plugins/mezuro/views/content_viewer/_project_error.rhtml b/plugins/mezuro/views/content_viewer/_project_error.rhtml
new file mode 100644
index 0000000..5256e2c
--- /dev/null
+++ b/plugins/mezuro/views/content_viewer/_project_error.rhtml
@@ -0,0 +1,12 @@
+<%= _('ERROR') %>
+
+ <%= "State when error ocurred: #{project.state}" %>
+
+ <% error = project.error %>
+ <%= error.message %>
+
+ <% error.stack_trace.each do |trace| %>
+ - <%= "#{trace.declaring_class}.#{trace.method_name}(#{trace.file_name}:#{trace.line_number})" %>
+ <% end %>
+
+
diff --git a/plugins/mezuro/views/content_viewer/_project_processing.rhtml b/plugins/mezuro/views/content_viewer/_project_processing.rhtml
new file mode 100644
index 0000000..9abb77a
--- /dev/null
+++ b/plugins/mezuro/views/content_viewer/_project_processing.rhtml
@@ -0,0 +1 @@
+<%= _('Service is ') + project.state.downcase + ' ' + project.name + '...' %>
\ No newline at end of file
diff --git a/plugins/mezuro/views/content_viewer/show_project.rhtml b/plugins/mezuro/views/content_viewer/show_project.rhtml
index d7060f4..612d6a8 100644
--- a/plugins/mezuro/views/content_viewer/show_project.rhtml
+++ b/plugins/mezuro/views/content_viewer/show_project.rhtml
@@ -30,20 +30,9 @@
<% if ! @project.error.nil? %>
- <%= _('ERROR') %>
-
- <%= "State when error ocurred: #{@project.state}" %>
-
- <% error = @project.error %>
- <%= error.message %>
-
- <% error.stack_trace.each do |trace| %>
- - <%= "#{trace.declaring_class}.#{trace.method_name}(#{trace.file_name}:#{trace.line_number})" %>
- <% end %>
-
-
-<% elsif @project.state.end_with?('ING') %>
- <%= _('Service is ') + @project.state.downcase + ' ' + @project.name + '...' %>
+ <%= render :partial => 'content_viewer/project_error', :locals => { :project => @project } %>
+<% elsif @project.state.end_with?('ING') #Loading or analyzing%>
+ <%= render :partial => 'content_viewer/project_processing', :locals => { :project => @project } %>
<% elsif @project.state == 'READY' %>
<%= render :partial => 'content_viewer/project_result', :locals => { :project_result => @page.project_result } %>
<% end %>
--
libgit2 0.21.2