Commit 3c3c7e568e9ddca8a5ae08c0bb21409b5d0b1fa0

Authored by Gabriela Navarro
Committed by Fabio Teixeira
1 parent 09975d55

Initial version of Public Software Edit page

Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Signed-off-by: Parley Martins <parley@outlook.com>
views/_main_software_editor_extras.html.erb
@@ -25,4 +25,8 @@ @@ -25,4 +25,8 @@
25 <a id = "version_link" href="<%= context.profile.software_info.license_info.link %>" target="BLANK"> <%= context.profile.software_info.license_info.link %> </a> 25 <a id = "version_link" href="<%= context.profile.software_info.license_info.link %>" target="BLANK"> <%= context.profile.software_info.license_info.link %> </a>
26 </div> 26 </div>
27 27
  28 +<div class="formfieldline formfield type-text">
  29 + <%= label_tag "repository_url", _("Link to Repository: ") %>
  30 + <%= text_field_tag(:reository_url) %>
  31 +</div>
28 32
views/_public_software_info.html.erb
1 -<%= javascript_include_tag "mpog-validations" %>  
2 -  
3 <h1><%= _('Edit software') %></h1> 1 <h1><%= _('Edit software') %></h1>
4 2
5 -<% unless @errors.blank? %>  
6 -<div class="errorExplanation" id="errorExplanation">  
7 - <h2> <%= _("Can`t edit software: #{@errors.length} errors") %> </h2>  
8 - <ul>  
9 - <% @errors.each do |error| %>  
10 - <li> <%= error %> </li>  
11 - <% end %>  
12 - </ul>  
13 -</div>  
14 -<% end %>  
15 -  
16 <div> 3 <div>
17 - <%= labelled_form_for :community, :html => { :multipart => true } do |f| %>  
18 -  
19 - <%= required_fields_message %>  
20 -  
21 - <%= required f.text_field(:name) %>  
22 -  
23 - <%= fields_for @software_info do |swf| %>  
24 - <div class="formfield type-text">  
25 - <%= swf.label("acronym" ,_("Acronym"), :class=>"formlabel") %>  
26 - <%= swf.text_field(:acronym) %> 4 + <div class="formfield type-text">
  5 + <%= label_tag("acronym" ,_("Acronym"), :class=>"formlabel") %>
  6 + <%= text_field_tag(:acronym) %>
27 </div> 7 </div>
28 8
29 <div class="formfieldline"> 9 <div class="formfieldline">
30 - <%= swf.label _("Adherent to e-PING ?") %> 10 + <%= label_tag _("Adherent to e-PING ?") %>
31 11
32 - <%= swf.label "e_ping_true", "Yes" %>  
33 - <%= swf.radio_button(:e_ping,true)%>  
34 - <%= swf.label "e_ping_false", "No"%>  
35 - <%= swf.radio_button(:e_ping,false)%> 12 + <%= label_tag "e_ping_true", "Yes" %>
  13 + <%= radio_button_tag(:e_ping,true)%>
  14 + <%= label_tag "e_ping_false", "No"%>
  15 + <%= radio_button_tag(:e_ping,false)%>
36 </div> 16 </div>
37 17
38 <div class="formfieldline"> 18 <div class="formfieldline">
39 - <%= swf.label _("Adherent to e-MAG ?") %> 19 + <%= label_tag _("Adherent to e-MAG ?") %>
40 20
41 - <%= swf.label "e_mag_true", "Yes"%>  
42 - <%= swf.radio_button(:e_mag,true)%>  
43 - <%= swf.label "e_mag_false", "No"%>  
44 - <%= swf.radio_button(:e_mag,false)%> 21 + <%= label_tag "e_mag_true", "Yes"%>
  22 + <%= radio_button_tag(:e_mag,true)%>
  23 + <%= label_tag "e_mag_false", "No"%>
  24 + <%= radio_button_tag(:e_mag,false)%>
45 </div> 25 </div>
46 26
47 <div class="formfieldline"> 27 <div class="formfieldline">
48 - <%= swf.label _("Adherent to ICP-Brasil ?") %> 28 + <%= label_tag _("Adherent to ICP-Brasil ?") %>
49 29
50 - <%= swf.label "icp_brasil_true", "Yes"%>  
51 - <%= swf.radio_button(:icp_brasil,true)%>  
52 - <%= swf.label "icp_brasil_false", "No"%>  
53 - <%= swf.radio_button(:icp_brasil,false)%> 30 + <%= label_tag "icp_brasil_true", "Yes"%>
  31 + <%= radio_button_tag(:icp_brasil,true)%>
  32 + <%= label_tag "icp_brasil_false", "No"%>
  33 + <%= radio_button_tag(:icp_brasil,false)%>
54 </div> 34 </div>
55 35
56 <div class="formfieldline"> 36 <div class="formfieldline">
57 - <%= swf.label _("Adherent to e-ARQ ?") %> 37 + <%= label_tag _("Adherent to e-ARQ ?") %>
58 38
59 - <%= swf.label "e_arq_true", "Yes"%>  
60 - <%= swf.radio_button(:e_arq,true)%>  
61 - <%= swf.label "e_arq_false", "No"%>  
62 - <%= swf.radio_button(:e_arq,false)%> 39 + <%= label_tag "e_arq_true", "Yes"%>
  40 + <%= radio_button_tag(:e_arq,true)%>
  41 + <%= label_tag "e_arq_false", "No"%>
  42 + <%= radio_button_tag(:e_arq,false)%>
63 </div> 43 </div>
64 44
65 <div class="formfieldline"> 45 <div class="formfieldline">
66 - <%= swf.label _("Internacionalizable ?") %> 46 + <%= label_tag _("Internacionalizable ?") %>
67 47
68 - <%= swf.label "intern_true", "Yes" %>  
69 - <%= swf.radio_button(:intern,true)%>  
70 - <%= swf.label "intern_false", "No"%>  
71 - <%= swf.radio_button(:intern,false)%> 48 + <%= label_tag "intern_true", "Yes" %>
  49 + <%= radio_button_tag(:intern,true)%>
  50 + <%= label_tag "intern_false", "No"%>
  51 + <%= radio_button_tag(:intern,false)%>
72 <div class="formfieldline"> 52 <div class="formfieldline">
73 - <%= swf.label "operating_platform", _("Operating Platform: ") %> <br />  
74 - <%= swf.text_area(:operating_platform, :class=>"expand-field") %> 53 + <%= label_tag "operating_platform", _("Operating Platform: ") %> <br />
  54 + <%= text_area_tag :operating_platform %>
75 </div> 55 </div>
76 56
77 <div class="formfieldline"> 57 <div class="formfieldline">
78 - <%= swf.label "objectives", _("Objectives: ")%><br />  
79 - <%= required swf.text_area(:objectives, :class=>"expand-field") %> 58 + <%= label_tag "objectives", _("Objectives: ")%><br />
  59 + <%= text_area_tag :objectives %>
80 </div> 60 </div>
81 61
82 <div class="formfieldline"> 62 <div class="formfieldline">
83 - <%= swf.label "features", _("Features: ")%><br />  
84 - <%= required swf.text_area(:features, :class=>"expand-field") %> 63 + <%= label_tag "features", _("Features: ")%><br />
  64 + <%= text_area_tag :features %>
85 </div> 65 </div>
86 66
87 - <div class="formfieldline formfield type-text">  
88 - <%= swf.label "demonstration_url", _("Demonstration URL: ") %>  
89 - <%= swf.text_field(:demonstration_url) %>  
90 - </div>  
91 - <% end %>  
92 -  
93 - <div class="formfieldline">  
94 - <%= content_tag('label', _('Fill in the search field to add offerers for this Software'), :id => "text-input-search-offerers") %>  
95 - <%= token_input_field_tag(:q, 'search-offerers', {:action => 'search_offerers'}, { :focus => true, :hint_text => _('Type in a search term for a person to be added as  
96 -offerers'), :pre_populate => @tokenized_children}) %>  
97 - </div>  
98 -  
99 - <div id='libraries_fields'>  
100 - <h4> <%= _("Libraries") %> </h4>  
101 - <%= render :partial => 'library_fields', :locals => { :f => f, :object_name => 'community', :profile => @community, :libraries => @list_libraries } %>  
102 - </div>  
103 - <br />  
104 -  
105 - <div id='operating_system_fields'>  
106 - <h4> <%= _("Operating Systems") %> </h4>  
107 - <% if @list_operating_systems.blank? %>  
108 - <%= OperatingSystemHelper.operating_system_as_tables(nil, false).call %>  
109 - <% end %>  
110 - <%= render :partial => 'operating_system_fields', :locals => { :f => f, :object_name => 'community', :profile => @community, :operating_systems_fields => @list_operating_systems} %>  
111 - </div>  
112 - <br />  
113 -  
114 - <%= fields_for @license_info do |lcv| %>  
115 - <div class="formfieldline">  
116 - <h4> <%= lcv.label _("License Version: ") %> </h4>  
117 - <%= lcv.select(:version, LicenseInfo.all.map {|l| [l.version, l.version]}, {:selected=>1}, :onchange => "get_license_link('license_info_version')") %>  
118 -  
119 - <h4> <%= _("License link") %> </h4>  
120 - <% LicenseHelper.getListLicenses.each do | license | %>  
121 - <input type="hidden" id = "version_<%=license.id %>" value = "<%=license.link%>">  
122 - <% end %>  
123 - <a id = "version_link" href="<%= LicenseInfo.first.link %>" target="_BLANK"> <%=LicenseInfo.first.link %> </a>  
124 -  
125 - </div>  
126 - <% end %>  
127 -  
128 - <br />  
129 - <div id='programming_languages_fields'>  
130 - <h4> <%= _("Programming languages") %> </h4>  
131 - <% if @list_languages.blank? %>  
132 - <%= SoftwareLanguageHelper.language_as_tables(nil, false).call %>  
133 - <% end %>  
134 -  
135 - <%= render :partial => 'language_fields', :locals => { :f => f, :object_name => 'community', :profile => @community, :languages => @list_languages } %>  
136 - </div>  
137 -  
138 - <br />  
139 - <div id='database_fields'>  
140 - <h4> <%= _("Databases") %> </h4>  
141 - <% if @list_databases.blank? %>  
142 - <%= DatabaseHelper.database_as_tables(nil, true).call %>  
143 - <% end %>  
144 -  
145 - <%= render :partial => 'database_fields', :locals => { :f => f, :object_name => 'community', :profile => @community, :database => @list_databases } %>  
146 - </div>  
147 67
148 - <%= fields_for @software_categories do |cv| %>  
149 <div id="software_categories_fields"> 68 <div id="software_categories_fields">
150 <h4> <%= _("Software Categories:") %> </h4> 69 <h4> <%= _("Software Categories:") %> </h4>
151 70
152 - <%= cv.check_box :administration %>  
153 - <%= cv.label :administration, _("Administration") %><br /> 71 + <%= check_box_tag :administration %>
  72 + <%= label_tag :administration, _("Administration") %><br />
154 73
155 - <%= cv.check_box :agriculture %>  
156 - <%= cv.label :agriculture, _("Agriculture") %><br /> 74 + <%= check_box_tag :agriculture %>
  75 + <%= label_tag :agriculture, _("Agriculture") %><br />
157 76
158 - <%= cv.check_box :business_and_services %>  
159 - <%= cv.label :business_and_services, _("Business_and Services") %><br /> 77 + <%= check_box_tag :business_and_services %>
  78 + <%= label_tag :business_and_services, _("Business_and Services") %><br />
160 79
161 - <%= cv.check_box :communication %>  
162 - <%= cv.label :communication, _("Communication") %><br /> 80 + <%= check_box_tag :communication %>
  81 + <%= label_tag :communication, _("Communication") %><br />
163 82
164 - <%= cv.check_box :culture %>  
165 - <%= cv.label :culture, _("Culture") %><br /> 83 + <%= check_box_tag :culture %>
  84 + <%= label_tag :culture, _("Culture") %><br />
166 85
167 - <%= cv.check_box :national_defense %>  
168 - <%= cv.label :national_defense, _("National Defense") %><br /> 86 + <%= check_box_tag :national_defense %>
  87 + <%= label_tag :national_defense, _("National Defense") %><br />
169 88
170 - <%= cv.check_box :economy_and_finances %>  
171 - <%= cv.label :economy_and_finances, _("Economy and Finances") %><br /> 89 + <%= check_box_tag :economy_and_finances %>
  90 + <%= label_tag :economy_and_finances, _("Economy and Finances") %><br />
172 91
173 - <%= cv.check_box :education %>  
174 - <%= cv.label :education, _("Education") %><br /> 92 + <%= check_box_tag :education %>
  93 + <%= label_tag :education, _("Education") %><br />
175 94
176 - <%= cv.check_box :energy %>  
177 - <%= cv.label :energy, _("Energy") %><br /> 95 + <%= check_box_tag :energy %>
  96 + <%= label_tag :energy, _("Energy") %><br />
178 97
179 - <%= cv.check_box :sports %>  
180 - <%= cv.label :sports, _("Sports") %><br /> 98 + <%= check_box_tag :sports %>
  99 + <%= label_tag :sports, _("Sports") %><br />
181 100
182 - <%= cv.check_box :habitation %>  
183 - <%= cv.label :habitation, _("Habitation") %><br /> 101 + <%= check_box_tag :habitation %>
  102 + <%= label_tag :habitation, _("Habitation") %><br />
184 103
185 - <%= cv.check_box :industry %>  
186 - <%= cv.label :industry, _("Industry") %><br /> 104 + <%= check_box_tag :industry %>
  105 + <%= label_tag :industry, _("Industry") %><br />
187 106
188 - <%= cv.check_box :environment %>  
189 - <%= cv.label :environment, _("Environment") %><br /> 107 + <%= check_box_tag :environment %>
  108 + <%= label_tag :environment, _("Environment") %><br />
190 109
191 - <%= cv.check_box :research_and_development %>  
192 - <%= cv.label :research_and_development, _("Research and Development") %><br /> 110 + <%= check_box_tag :research_and_development %>
  111 + <%= label_tag :research_and_development, _("Research and Development") %><br />
193 112
194 - <%= cv.check_box :social_security %>  
195 - <%= cv.label :social_security, _("Social Security") %><br /> 113 + <%= check_box_tag :social_security %>
  114 + <%= label_tag :social_security, _("Social Security") %><br />
196 115
197 - <%= cv.check_box :social_protection %>  
198 - <%= cv.label :social_protection, _("Social Protection") %><br /> 116 + <%= check_box_tag :social_protection %>
  117 + <%= label_tag :social_protection, _("Social Protection") %><br />
199 118
200 - <%= cv.check_box :sanitation %>  
201 - <%= cv.label :sanitation, _("Sanitation") %><br /> 119 + <%= check_box_tag :sanitation %>
  120 + <%= label_tag :sanitation, _("Sanitation") %><br />
202 121
203 - <%= cv.check_box :health %>  
204 - <%= cv.label :health, _("Health") %><br /> 122 + <%= check_box_tag :health %>
  123 + <%= label_tag :health, _("Health") %><br />
205 124
206 - <%= cv.check_box :security_public_order %>  
207 - <%= cv.label :security_public_order, _("Security and Public Order") %><br /> 125 + <%= check_box_tag :security_public_order %>
  126 + <%= label_tag :security_public_order, _("Security and Public Order") %><br />
208 127
209 - <%= cv.check_box :work %>  
210 - <%= cv.label :work, _("Work") %><br /> 128 + <%= check_box_tag :work %>
  129 + <%= label_tag :work, _("Work") %><br />
211 130
212 - <%= cv.check_box :transportation %>  
213 - <%= cv.label :transportation, _("Transportation") %><br /> 131 + <%= check_box_tag :transportation %>
  132 + <%= label_tag :transportation, _("Transportation") %><br />
214 133
215 - <%= cv.check_box :urbanism %>  
216 - <%= cv.label :urbanism, _("Urbanism") %><br /> 134 + <%= check_box_tag :urbanism %>
  135 + <%= label_tag :urbanism, _("Urbanism") %><br />
217 </div> 136 </div>
218 - <% end %>  
219 - <%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => 'community', :profile => @community } %>  
220 -  
221 - <%= f.fields_for :image_builder, @community.image do |i| %>  
222 - <%= file_field_or_thumbnail(_('Image:'), @community.image, i) %>  
223 - <% end %>  
224 -  
225 - <div style='margin-bottom: 1em; margin-top: 1em;'>  
226 - <%= _('New members must be approved:')%>  
227 - </div>  
228 - <div style='margin-bottom: 0.5em' id='community-join-before'>  
229 - <%= radio_button 'community', 'closed', 'true', :style => 'float: left' %>  
230 - <div style='margin-left: 30px'>  
231 - <%= _('<strong>Before</strong> joining this group (a moderator has to accept the member in pending request before member can access the intranet and/or the website).') %>  
232 - </div>  
233 - </div>  
234 - <div id='community-join-after'>  
235 - <%= radio_button 'community', 'closed', 'false', :style => 'float: left' %>  
236 - <div style='margin-left: 30px'>  
237 - <%= _('<strong>After</strong> joining this group (a moderator can always desactivate access for users later).') %>  
238 - </div>  
239 - </div>  
240 -  
241 - <%= template_options(:communities, 'community')%>  
242 -  
243 - <%= hidden_field_tag('back_to', @back_to) %>  
244 -  
245 - <% button_bar do %>  
246 - <%= submit_button(:save, _('Create')) %>  
247 - <%= button(:cancel, _('Cancel'), @back_to ) %>  
248 - <% end %>  
249 -  
250 - <% end %>  
251 -  
252 </div> 137 </div>