_project_content.html.erb
1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<h1> <%= _(MezuroPlugin::ProjectContent.short_description) %> </h1>
<%
@project = @article.title.nil? ? nil : @article.project
begin
@repository_types = Kalibro::Repository.repository_types.sort
@configuration_names = Kalibro::Configuration.all_names.sort
rescue Exception => exception
@article.errors.add_to_base(exception.message)
@repository_types = []
@configuration_names = []
end
%>
<%= error_messages_for 'project_content' %>
<%= hidden_field_tag 'project_content[profile_id]', profile.id %>
<%= hidden_field_tag 'id', @article.id %>
<%= required_fields_message %>
<% if !@project.nil? && !@article.id.nil? %>
<%= required f.text_field(:name, :disabled => 'true') %>
<% else %>
<%= required f.text_field(:name) %>
<% end %>
<%= f.text_field :project_license %><br/>
<%= f.text_field :description %><br/>
<% @selected = (@project.nil? ? @repository_types : @project.repository.type) %>
<%= required labelled_form_field _('Repository type'),
f.select(:repository_type, @repository_types, {:selected => @selected}) %><br/>
<%= required f.text_field(:repository_url) %><br/>
<% @selected = (@project.nil? ? @configuration_names[0] : @project.configuration_name) %>
<% if !@project.nil? && !@article.id.nil? %>
<%= required labelled_form_field _('Configuration'),
f.select(:configuration_name, @configuration_names, {:selected => @selected}, :disabled => 'true') %>
<% else %>
<%= required labelled_form_field _('Configuration'),
f.select(:configuration_name, @configuration_names, {:selected => @selected}) %><br/>
<% end %>
<% selected = (@project.nil? ? 0 : @project.process_period.to_i) %>
<%= required labelled_form_field _('Periodic Avaliation'),
f.select(:periodicity_in_days, MezuroPlugin::Helpers::ContentViewerHelper.create_periodicity_options ,{:selected => selected}) %><br/>