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 e9d532f..0a0af0c 100644
--- a/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb
+++ b/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb
@@ -9,6 +9,14 @@ class MezuroPlugin::Helpers::ContentViewerHelper
[["Not Periodically", 0], ["1 day", 1], ["2 days", 2], ["Weekly", 7], ["Biweeky", 15], ["Monthly", 30]]
end
+ def self.create_license_options
+ options = YAML.load_file("#{RAILS_ROOT}/plugins/mezuro/licenses.yaml")
+ options = options.split(";")
+ formated_options = []
+ options.each { |option| formated_options << [option, option] }
+ formated_options
+ end
+
def self.generate_chart(values)
Gchart.line(
:title_color => 'FF0000',
@@ -31,4 +39,10 @@ class MezuroPlugin::Helpers::ContentViewerHelper
def self.format_name(metric_result)
metric_result.metric.name.delete("() ")
end
+
+ def self.get_license_option(selected)
+ options = YAML.load_file("#{RAILS_ROOT}/plugins/mezuro/licenses.yaml")
+ options.split(";")
+ selected_option = options.find { |license| license == selected }
+ 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 656cb7f..46cd961 100644
--- a/plugins/mezuro/views/cms/mezuro_plugin/_project_content.html.erb
+++ b/plugins/mezuro/views/cms/mezuro_plugin/_project_content.html.erb
@@ -24,7 +24,9 @@
<%= required f.text_field(:name) %>
<% end %>
-<%= f.text_field :project_license %>
+<% selected = (@project.nil? ? "" : @project.license) %>
+<%= required labelled_form_field _('License'),
+ f.select(:project_license, MezuroPlugin::Helpers::ContentViewerHelper.create_license_options ,{:selected => selected}) %>
<%= f.text_field :description %>
--
libgit2 0.21.2