Commit 4b8a522c1a6494ee921d6ae25d14bf4c7d0027d8

Authored by Gabriela Navarro
1 parent e11597d0
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

Fix software profile tab javascript to show information from the software.

Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com>
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed_off_by: Gabriela Navarro <navarro1703@gmail.com>
lib/software_communities_plugin.rb
... ... @@ -78,8 +78,8 @@ class SoftwareCommunitiesPlugin &lt; Noosfero::Plugin
78 78  
79 79 def profile_tabs
80 80 if context.profile.community?
81   - profile_tabs_software if context.profile.software?
82   - profile_tabs_institution if context.profile.institution?
  81 + return profile_tabs_software if context.profile.software?
  82 + return profile_tabs_institution if context.profile.institution?
83 83 end
84 84 end
85 85  
... ... @@ -126,6 +126,7 @@ class SoftwareCommunitiesPlugin &lt; Noosfero::Plugin
126 126 views/create-institution.js
127 127 views/complete-registration.js
128 128 views/search-software-catalog.js
  129 + views/profile-tabs-software.js
129 130 blocks/software-download.js
130 131 initializer.js
131 132 app.js
... ... @@ -341,15 +342,15 @@ class SoftwareCommunitiesPlugin &lt; Noosfero::Plugin
341 342  
342 343 def profile_tabs_software
343 344 { :title => _('Software'),
344   - :id => 'mpog-fields',
345   - :content => proc do render :partial => 'software_tab' end,
  345 + :id => 'software-fields',
  346 + :content => Proc::new do render :partial => 'profile/software_tab' end,
346 347 :start => true }
347 348 end
348 349  
349 350 def profile_tabs_institution
350 351 { :title => _('Institution'),
351   - :id => 'mpog-fields',
352   - :content => Proc::new do render :partial => 'institution_tab' end,
  352 + :id => 'intitution-fields',
  353 + :content => Proc::new do render :partial => 'profile/institution_tab' end,
353 354 :start => true
354 355 }
355 356 end
... ...
public/initializer.js
... ... @@ -9,7 +9,8 @@
9 9 'CreateInstitution',
10 10 'CompleteRegistration',
11 11 'SearchSoftwareCatalog',
12   - 'SoftwareDownload'
  12 + 'SoftwareDownload',
  13 + "ProfileTabsSoftware"
13 14 ];
14 15  
15 16  
... ...
public/views/control-panel.js
1 1 modulejs.define('ControlPanel', ['jquery'], function($) {
2 2 'use strict';
3 3  
4   - function hide_infos(){
5   - $(".language-info").hide();
6   - $(".database-info").hide();
7   - $(".libraries-info").hide();
8   - $(".operating-system-info").hide();
9   - $(".language-button-hide").hide();
10   - $(".database-button-hide").hide();
11   - $(".libraries-button-hide").hide();
12   - $(".operating-system-button-hide").hide();
13   - }
14   -
15   -
16 4 function add_software_on_control_panel(control_panel) {
17 5 var software_link = $(".control-panel-software-link").remove();
18 6  
... ... @@ -49,7 +37,6 @@ modulejs.define(&#39;ControlPanel&#39;, [&#39;jquery&#39;], function($) {
49 37  
50 38 init: function() {
51 39 add_itens_on_controla_panel();
52   - hide_infos();
53 40 }
54 41 }
55 42 });
... ...
public/views/profile-tabs-software.js 0 → 100644
... ... @@ -0,0 +1,28 @@
  1 +modulejs.define("ProfileTabsSoftware", ["jquery", "EditSoftware"], function($, EditSoftware) {
  2 + "use strict";
  3 +
  4 + function hide_infos(){
  5 + $(".language-info").hide();
  6 + $(".database-info").hide();
  7 + $(".libraries-info").hide();
  8 + $(".operating-system-info").hide();
  9 + $(".language-button-hide").hide();
  10 + $(".database-button-hide").hide();
  11 + $(".libraries-button-hide").hide();
  12 + $(".operating-system-button-hide").hide();
  13 + }
  14 +
  15 +
  16 + return {
  17 + isCurrentPage: function() {
  18 + return $("#software-fields").length === 1;
  19 + },
  20 +
  21 +
  22 + init: function() {
  23 + hide_infos();
  24 +
  25 + EditSoftware.init();
  26 + }
  27 + }
  28 +});
... ...
views/profile/_software_tab.html.erb
... ... @@ -136,4 +136,4 @@
136 136 </tr>
137 137  
138 138 </tr>
139   -</table>
140 139 \ No newline at end of file
  140 +</table>
... ...