new_software.html.erb
3.63 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<span id="new-software-page"></span>
<%= render :partial => 'profile_editor/first_edit_software_community_extras', :locals => {:class_step_one => "current-step", :class_step_two => "another-step"} %>
<h1><%= _('Creating new software') %></h1>
<div class='step-explanation'>
<spam>
<%= _('Enter the basic information about the software.<br>
You can add the details after you create it.') %>
</spam>
</div>
<% if environment.enabled?('admin_must_approve_new_communities') %>
<div class='explanation'>
<%= _("Note that the creation of communities in this environment is restricted. Your request to create this new community will be sent to %{environment} administrators and will be approved or rejected according to their methods and criteria.") % { :environment => environment.name }%>
</div>
<%end %>
<% unless @errors.blank? %>
<div class="errorExplanation" id="errorExplanation">
<h2> <%= _("Can`t create new software: #{@errors.length} errors") %> </h2>
<ul>
<% @errors.each do |error| %>
<li> <%= error %> </li>
<% end %>
</ul>
</div>
<% end %>
<div>
<%= labelled_form_for :community, :html => { :multipart => true } do |f| %>
<%= required_fields_message %>
<div class= <%= @error_community_name %> >
<%= label("name", _('Name'), {:class => 'formlabel mandatory'}) %>
<%= required text_field(:community, :name, :size => 30, :maxlength => 100, :id => 'community_name_id') %>
</div>
<br>
<br>
<div class= <%= @error_software_domain %> >
<%= label("domain", _('Domain'), {:class => "formlabel mandatory"}) %>
<div id='software-name-field' class='formfield'>
<span id='software-hostname'><%= environment.default_hostname %>/</span>
<%= required text_field(:community, :identifier, :size => 30, :maxlength => 100, :id => 'community-identifier') %>
</div>
</div>
<div class= <%= @error_software_finality %> >
<%= fields_for @software_info do |swf| %>
<div id="finality" class="formfield type-text">
<%= swf.label("finality" ,_("Finality"), :class=>"formlabel mandatory") %>
<%= required swf.text_area(:finality, :placeholder => _("What is the software for?"), :maxlength => 120) %>
</div>
<% end %>
</div>
<div id="profile_change_picture_title" class="formlabel">
<label>
<%= _('Software Logo') %>
</label>
</div>
<div id="profile_change_picture">
<%= f.fields_for :image_builder, @community.image do |i| %>
<%= file_field_or_thumbnail(_('Image:'), @community.image, i) %><%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %>
<% end %>
</div>
<div class= <%= @error_software_license %> >
<div id="profile_change_picture_title" class="formlabel formfieldline">
<label class="formlabel mandatory">
<%= _("License Version: ") %>
</label>
<%= render :partial => "license_info_fields", :locals => {
:license_version => "",
:license_id => "",
:another_version=>"",
:another_link=>""
} %>
</div>
</div>
<%= fields_for @software_info do |swf| %>
<div class="formfieldline formfield type-text">
<%= swf.label "repository_url", _("Link to Repository: "), :class => "formlabel"%>
<%= swf.text_field :repository_link, :class => "improve_input_size", :id => "software-info-repository-link" %>
</div>
<% end %>
<%= hidden_field_tag('back_to', @back_to) %>
<% button_bar do %>
<%= submit_button(:save, _('Create')) %>
<%= button(:cancel, _('Cancel'), @back_to ) %>
<% end %>
<% end %>
</div>