Commit 00947a33fc0e1cd1002573821187306b3a0387c8

Authored by Gabriela Navarro
Committed by Fabio Teixeira
1 parent e701524f

Remove name of edition page and finality as mandatory field

Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com>
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com>
lib/software_info.rb
@@ -14,19 +14,6 @@ class SoftwareInfo &lt; ActiveRecord::Base @@ -14,19 +14,6 @@ class SoftwareInfo &lt; ActiveRecord::Base
14 14
15 has_one :software_categories 15 has_one :software_categories
16 16
17 - #validates :features, :objectives,  
18 - # :presence=>true,  
19 - # :length => {  
20 - # :maximum => 4000,  
21 - # :too_long => _("Software features is too long (maximum is 4000 characters)")  
22 - # }  
23 -  
24 - #validate :validate_operating_platform, :validate_acronym, :valid_software_info, :valid_databases, :valid_operating_systems  
25 -  
26 - #validate :finality, :presence => {:message => "Finality cannot be blank"}  
27 - validate :validate_finality  
28 -  
29 -  
30 # used on find_by_contents 17 # used on find_by_contents
31 scope :like_search, lambda{ |name| 18 scope :like_search, lambda{ |name|
32 joins(:community).where("name ilike ?", "%#{name}%") 19 joins(:community).where("name ilike ?", "%#{name}%")
@@ -119,11 +106,6 @@ class SoftwareInfo &lt; ActiveRecord::Base @@ -119,11 +106,6 @@ class SoftwareInfo &lt; ActiveRecord::Base
119 end 106 end
120 end 107 end
121 108
122 - def validate_finality  
123 - self.errors.add(:finality, _("can't be blank")) if self.finality.blank? && self.errors.messages[:finality].nil?  
124 - end  
125 -  
126 -  
127 def valid_operating_systems 109 def valid_operating_systems
128 self.errors.add(:operating_system, _(": at least one must be filled")) if self.operating_systems.empty? 110 self.errors.add(:operating_system, _(": at least one must be filled")) if self.operating_systems.empty?
129 end 111 end
views/mpog_software_plugin_myprofile/_main_software_editor_extras.html.erb
1 <h2><%= _('Software Information') %></h2> 1 <h2><%= _('Software Information') %></h2>
2 2
3 -<%= label_tag("name", _('Name'), {:class => 'formlabel'}) %>  
4 -  
5 -<div id='software-name-field' class='formfield'>  
6 - <span id='software-hostname'><%= @profile.environment.default_hostname %>/</span>  
7 - <%= text_field_tag(:name, @profile.software_info.community.name) %>  
8 -</div>  
9 -  
10 <h3> <%= _("Finality") %> </h3> 3 <h3> <%= _("Finality") %> </h3>
11 <div id="finality"> 4 <div id="finality">
12 <%= text_field_tag("software[finality]", @profile.software_info.finality) %> 5 <%= text_field_tag("software[finality]", @profile.software_info.finality) %>
views/mpog_software_plugin_myprofile/_public_software_info.html.erb
@@ -98,7 +98,6 @@ @@ -98,7 +98,6 @@
98 <% if not k == "id" and not k == "software_info_id" %> 98 <% if not k == "id" and not k == "software_info_id" %>
99 <%= check_box_tag "software_categories[#{k}]", "true", !v.blank? %> 99 <%= check_box_tag "software_categories[#{k}]", "true", !v.blank? %>
100 <%= label_tag k.to_sym, _("#{k.gsub("_", " ").capitalize}") %><br /> 100 <%= label_tag k.to_sym, _("#{k.gsub("_", " ").capitalize}") %><br />
101 - <% puts "="*80, v%>  
102 <% end %> 101 <% end %>
103 <% end %> 102 <% end %>
104 103