Commit 6a3d8d37aea48c72b6031492e536f2b224b671e8

Authored by Fabio Teixeira
1 parent d38eca1b
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

reformulacao_software: Fix dynamic tables initial display

Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
Signed-off-by: Luiz Matos <luizff.matos@gmail.com>
views/mpog_software_plugin_myprofile/_database_fields.html.erb
1 1 <%= fields_for :database_description, @database_description do |db| %>
2 2  
3 3 <div id='databases'>
  4 + <% database = [] if database.nil? %>
4 5 <% DatabaseHelper.database_as_tables(database).each do |tab| %>
5 6 <%= tab.call %>
6 7 <%end%>
... ...
views/mpog_software_plugin_myprofile/_language_fields.html.erb
1 1 <%= fields_for :software_language, @software_language do |lng| %>
2 2  
3 3 <div id='languages'>
  4 + <% languages = [] if languages.nil? %>
4 5 <% SoftwareLanguageHelper.language_as_tables(languages).each do |tab| %>
5 6 <%= tab.call %>
6 7 <%end%>
... ...
views/mpog_software_plugin_myprofile/_library_fields.html.erb
1 1 <%= fields_for :library ,@library do |lib| %>
2 2  
3 3 <div id='libraries'>
  4 + <% libraries = [] if libraries.nil? %>
4 5 <% LibraryHelper.library_as_tables(libraries).each do |tab| %>
5 6 <%= tab.call %>
6 7 <% end %>
... ...
views/mpog_software_plugin_myprofile/_operating_system_fields.html.erb
1 1 <%= fields_for :operating_systems ,@operating_systems do |lib| %>
2 2  
3 3 <div id='operating_systems'>
  4 + <% operating_systems_fields = [] if operating_systems_fields.nil? %>
4 5 <% OperatingSystemHelper.operating_system_as_tables(operating_systems_fields).each do |tab| %>
5 6 <%= tab.call %>
6 7 <% end %>
... ...
views/mpog_software_plugin_myprofile/_public_software_info.html.erb
... ... @@ -65,42 +65,30 @@
65 65  
66 66 <div id='libraries_fields'>
67 67 <h4> <%= _("Libraries") %> </h4>
68   - <% if @list_libraries.blank? %>
69   - <%= LibraryHelper.library_as_tables(nil).call %>
70   - <% else %>
71   - <%= render :partial => 'library_fields', :locals => { :f => f, :object_name => 'community', :profile => @community, :libraries => @list_libraries } %>
72   - <% end %>
  68 +
  69 + <%= render :partial => 'library_fields', :locals => {:object_name => 'community', :profile => @community, :libraries => @list_libraries } %>
73 70 </div>
74 71 <br />
75 72  
76 73 <div id='operating_system_fields'>
77 74 <h4> <%= _("Operating Systems") %> </h4>
78   - <% if @list_operating_systems.blank? %>
79   - <%= OperatingSystemHelper.operating_system_as_tables(nil, false).call %>
80   - <% else %>
  75 +
81 76 <%= render :partial => 'operating_system_fields', :locals => {:object_name => 'community', :profile => @community, :operating_systems_fields => @list_operating_systems} %>
82   - <% end %>
83 77 </div>
84 78 <br />
85 79  
86 80 <br />
87 81 <div id='programming_languages_fields'>
88 82 <h4> <%= _("Programming languages") %> </h4>
89   - <% if @list_languages.blank? %>
90   - <%= SoftwareLanguageHelper.language_as_tables(nil, false).call %>
91   - <% else %>
  83 +
92 84 <%= render :partial => 'language_fields', :locals => { :object_name => 'community', :profile => @community, :languages => @list_languages } %>
93   - <% end %>
94 85 </div>
95 86  
96 87 <br />
97 88 <div id='database_fields'>
98 89 <h4> <%= _("Databases") %> </h4>
99   - <% if @list_databases.blank? %>
100   - <%= DatabaseHelper.database_as_tables(nil, true).call %>
101   - <% else %>
  90 +
102 91 <%= render :partial => 'database_fields', :locals => {:object_name => 'community', :profile => @community, :database => @list_databases } %>
103   - <% end %>
104 92 </div>
105 93  
106 94 <div id="software_categories_fields">
... ...