diff --git a/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb b/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb
index dccfb66..d3c9723 100644
--- a/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb
+++ b/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb
@@ -18,4 +18,8 @@ class MezuroPlugin::Helpers::ContentViewerHelper
:data => values,
:axis_with_labels => 'y')
end
+
+ def self.get_periodicity_option(index)
+ [["Not Periodically", 0], ["1 day", 1], ["2 days", 2], ["Weekly", 7], ["Biweeky", 15], ["Monthly", 30]][index.to_i][0]
+ end
end
diff --git a/plugins/mezuro/views/cms/mezuro_plugin/_project_content.html.erb b/plugins/mezuro/views/cms/mezuro_plugin/_project_content.html.erb
index dcd7d19..961dcc2 100644
--- a/plugins/mezuro/views/cms/mezuro_plugin/_project_content.html.erb
+++ b/plugins/mezuro/views/cms/mezuro_plugin/_project_content.html.erb
@@ -3,6 +3,7 @@
<%
begin
@project = @article.title.nil? ? nil : Kalibro::Client::ProjectClient.project(@article.title)
+ @kalibro_client = Kalibro::Client::KalibroClient.new
rescue
@project = nil
end
@@ -21,7 +22,7 @@
<%= f.text_field :description %>
-<% @repository_types = Kalibro::Client::KalibroClient.new.supported_repository_types.sort %>
+<% @repository_types = @kalibro_client.supported_repository_types.sort %>
<% @selected = (@project.nil? ? @repository_types : @project.repository.type) %>
<%= required labelled_form_field _('Repository type'),
f.select(:repository_type, @repository_types, {:selected => @selected}) %>
@@ -33,5 +34,6 @@
<%= required labelled_form_field _('Configuration'),
f.select(:configuration_name, @configuration_names.sort, {:selected => @selected}) %>
+<% @periodicity = (@project.nil? ? 0 : @kalibro_client.process_period(@project.name)) %>
<%= required labelled_form_field _('Periodic Avaliation'),
- f.select(:periodicity_in_days, MezuroPlugin::Helpers::ContentViewerHelper.create_periodicity_options ,{:selected => 0}) %>
+ f.select(:periodicity_in_days, MezuroPlugin::Helpers::ContentViewerHelper.create_periodicity_options ,{:selected => @periodicity}) %>
diff --git a/plugins/mezuro/views/content_viewer/show_project.rhtml b/plugins/mezuro/views/content_viewer/show_project.rhtml
index c080ab7..ed7df36 100644
--- a/plugins/mezuro/views/content_viewer/show_project.rhtml
+++ b/plugins/mezuro/views/content_viewer/show_project.rhtml
@@ -34,7 +34,7 @@