Commit 58e8d6c27ebd62689c0856a4a10c6beb4114abd9

Authored by Fabio Teixeira
Committed by Luciano Prestes
1 parent 3a7aa686
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

Place software wall js code into its correct module

public/views/edit-software.js
... ... @@ -98,61 +98,7 @@ modulejs.define('EditSoftware', ['jquery', 'NoosferoRoot', 'AutoComplete', 'NewS
98 98 });
99 99  
100 100  
101   - $(".language-button-hide").click(function(event){
102   - event.preventDefault();
103   - $(".language-info").hide();
104   - $(".language-button-show").show();
105   - $(".language-button-hide").hide();
106   - });
107   -
108   - $(".language-button-show").click(function(event){
109   - event.preventDefault();
110   - $(".language-info").show();
111   - $(".language-button-show").hide();
112   - $(".language-button-hide").show();
113   - });
114   -
115   - $(".operating-system-button-hide").click(function(event){
116   - event.preventDefault();
117   - $(".operating-system-info").hide();
118   - $(".operating-system-button-show").show();
119   - $(".operating-system-button-hide").hide();
120   - });
121   -
122   - $(".operating-system-button-show").click(function(event){
123   - event.preventDefault();
124   - $(".operating-system-info").show();
125   - $(".operating-system-button-show").hide();
126   - $(".operating-system-button-hide").show();
127   - });
128 101  
129   - $(".database-button-hide").click(function(event){
130   - event.preventDefault();
131   - $(".database-info").hide();
132   - $(".database-button-show").show();
133   - $(".database-button-hide").hide();
134   - });
135   -
136   - $(".database-button-show").click(function(event){
137   - event.preventDefault();
138   - $(".database-info").show();
139   - $(".database-button-show").hide();
140   - $(".database-button-hide").show();
141   - });
142   -
143   - $(".libraries-button-hide").click(function(event){
144   - event.preventDefault();
145   - $(".libraries-info").hide();
146   - $(".libraries-button-show").show();
147   - $(".libraries-button-hide").hide();
148   - });
149   -
150   - $(".libraries-button-show").click(function(event){
151   - event.preventDefault();
152   - $(".libraries-info").show();
153   - $(".libraries-button-show").hide();
154   - $(".libraries-button-hide").show();
155   - });
156 102  
157 103 hide_show_public_software_fields();
158 104 $("#software_public_software").click(hide_show_public_software_fields);
... ...
public/views/profile-tabs-software.js
1   -modulejs.define("ProfileTabsSoftware", ["jquery", "EditSoftware"], function($, EditSoftware) {
  1 +modulejs.define("ProfileTabsSoftware", ["jquery"], function($) {
2 2 "use strict";
3 3  
4 4 function hide_infos(){
... ... @@ -13,6 +13,65 @@ modulejs.define("ProfileTabsSoftware", ["jquery", "EditSoftware"], function($, E
13 13 }
14 14  
15 15  
  16 + function set_show_hide_dynamic_table_events() {
  17 + $(".language-button-hide").click(function(event){
  18 + event.preventDefault();
  19 + $(".language-info").hide();
  20 + $(".language-button-show").show();
  21 + $(".language-button-hide").hide();
  22 + });
  23 +
  24 + $(".language-button-show").click(function(event){
  25 + event.preventDefault();
  26 + $(".language-info").show();
  27 + $(".language-button-show").hide();
  28 + $(".language-button-hide").show();
  29 + });
  30 +
  31 + $(".operating-system-button-hide").click(function(event){
  32 + event.preventDefault();
  33 + $(".operating-system-info").hide();
  34 + $(".operating-system-button-show").show();
  35 + $(".operating-system-button-hide").hide();
  36 + });
  37 +
  38 + $(".operating-system-button-show").click(function(event){
  39 + event.preventDefault();
  40 + $(".operating-system-info").show();
  41 + $(".operating-system-button-show").hide();
  42 + $(".operating-system-button-hide").show();
  43 + });
  44 +
  45 + $(".database-button-hide").click(function(event){
  46 + event.preventDefault();
  47 + $(".database-info").hide();
  48 + $(".database-button-show").show();
  49 + $(".database-button-hide").hide();
  50 + });
  51 +
  52 + $(".database-button-show").click(function(event){
  53 + event.preventDefault();
  54 + $(".database-info").show();
  55 + $(".database-button-show").hide();
  56 + $(".database-button-hide").show();
  57 + });
  58 +
  59 + $(".libraries-button-hide").click(function(event){
  60 + event.preventDefault();
  61 + $(".libraries-info").hide();
  62 + $(".libraries-button-show").show();
  63 + $(".libraries-button-hide").hide();
  64 + });
  65 +
  66 + $(".libraries-button-show").click(function(event){
  67 + event.preventDefault();
  68 + $(".libraries-info").show();
  69 + $(".libraries-button-show").hide();
  70 + $(".libraries-button-hide").show();
  71 + });
  72 + }
  73 +
  74 +
16 75 return {
17 76 isCurrentPage: function() {
18 77 return $("#software-fields").length === 1;
... ... @@ -21,8 +80,7 @@ modulejs.define("ProfileTabsSoftware", ["jquery", "EditSoftware"], function($, E
21 80  
22 81 init: function() {
23 82 hide_infos();
24   -
25   - EditSoftware.init();
  83 + set_show_hide_dynamic_table_events();
26 84 }
27 85 }
28 86 });
... ...
views/profile/_software_tab.html.erb
1   -<%= javascript_include_tag "mpog-validations" %>
2 1 <table>
3 2 <tr>
4 3 <th colspan='2'><%= _('Software Information')%></th>
... ...