diff --git a/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb b/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb new file mode 100644 index 0000000..5201afe --- /dev/null +++ b/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb @@ -0,0 +1,43 @@ + def processing(repository_id) + begin + if Kalibro::Processing.has_ready_processing(repository_id) + @processing ||= Kalibro::Processing.last_ready_processing_of(repository_id) + else + @processing = Kalibro::Processing.last_processing_of(repository_id) + end + rescue Exception => error + errors.add_to_base(error.message) + end + @processing + end + + def processing_with_date(repository_id, date) + begin + if Kalibro::Processing.has_processing_after(repository_id, date) + @processing ||= Kalibro::Processing.first_processing_after(repository_id, date) + elsif Kalibro::Processing.has_processing_before(repository_id, date) + @processing ||= Kalibro::Processing.last_processing_before(repository_id, date) + end + rescue Exception => error + errors.add_to_base(error.message) + end + @processing + end + + def module_result(repository_id, date = nil) + @processing ||= date.nil? ? processing(repository_id) : processing_with_date(repository_id, date) + begin + @module_result ||= Kalibro::ModuleResult.find(@processing.results_root_id) + rescue Exception => error + errors.add_to_base(error.message) + end + @module_result + end + + def result_history(module_result_id) + begin + @result_history ||= Kalibro::MetricResult.history_of(module_result_id) + rescue Exception => error + errors.add_to_base(error.message) + end + end diff --git a/plugins/mezuro/views/mezuro_plugin_repository/show_repository.html.erb b/plugins/mezuro/views/mezuro_plugin_repository/show_repository.html.erb new file mode 100644 index 0000000..3fcbd82 --- /dev/null +++ b/plugins/mezuro/views/mezuro_plugin_repository/show_repository.html.erb @@ -0,0 +1,124 @@ +
This project doesn't exist on the Web Service. Do you want to <%= link_to 'delete', :action => 'destroy', :controller => 'cms', :profile => @page.profile.identifier, :id => @page.id %> or <%= link_to 'save it again', :action => 'edit', :controller => 'cms', :profile => @page.profile.identifier, :id => @page.id %>?
+ <% else %> + <%= @page.errors[:base] %> + <% end %> +<% else %> + +<%= _('Name') %> | +<%= @project.name %> | +
<%= _('License') %> | +<%= @project.license %> | +
<%= _('Description') %> | +<%= @project.description %> | +
<%= _('Repository type') %> | +<%= @project.repository.type %> | +
<%= _('Repository address') %> | +<%= @project.repository.address %> | +
<%= _('Configuration') %> | +<%= @project.configuration_name %> | +
<%= _('Periodicity') %> | +<%= MezuroPlugin::Helpers::ContentViewerHelper.get_periodicity_option(@page.periodicity_in_days) %> | +
<%= _('Status')%> | +
+ <%= @project.state %>
+
+ |
+