Commit 00947a33fc0e1cd1002573821187306b3a0387c8

Authored by Gabriela Navarro
Committed by Fabio Teixeira
1 parent e701524f
Exists in master and in 79 other branches add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev_env_minimal, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, prezento, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

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