Commit cda90bda83d9737417f1777f8d005cadce29af89

Authored by Fabio Teixeira
Committed by Gabriela Navarro
1 parent 35138b91
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_institution: Put Institution Info link at the top on its control panel

Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com>
lib/mpog_software_plugin.rb
@@ -229,12 +229,12 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin @@ -229,12 +229,12 @@ class MpogSoftwarePlugin &lt; Noosfero::Plugin
229 229
230 def control_panel_buttons 230 def control_panel_buttons
231 if context.profile.software? 231 if context.profile.software?
232 - return { :title => _("Software Info"), :icon => "edit-profile-group", :url => {:controller => "mpog_software_plugin_myprofile", :action => "edit_software"} } 232 + return { :title => _("Software Info"), :icon => "edit-profile-group control-panel-software-link", :url => {:controller => "mpog_software_plugin_myprofile", :action => "edit_software"} }
233 elsif context.profile.person? 233 elsif context.profile.person?
234 return { :title => _("Create a new software"), :icon => "design-editor", :url => {:controller => "mpog_software_plugin_myprofile", :action => "new_software"} } 234 return { :title => _("Create a new software"), :icon => "design-editor", :url => {:controller => "mpog_software_plugin_myprofile", :action => "new_software"} }
235 return nil 235 return nil
236 elsif context.profile.institution? 236 elsif context.profile.institution?
237 - return { :title => _("Institution Info"), :icon => "edit-profile-group", :url => {:controller => "mpog_software_plugin_myprofile", :action => "edit_institution"} } 237 + return { :title => _("Institution Info"), :icon => "edit-profile-group control-panel-instituton-link", :url => {:controller => "mpog_software_plugin_myprofile", :action => "edit_institution"} }
238 end 238 end
239 end 239 end
240 240
public/mpog-institution-validations.js
@@ -184,7 +184,6 @@ @@ -184,7 +184,6 @@
184 } 184 }
185 185
186 function show_hide_cnpj_city(country) { 186 function show_hide_cnpj_city(country) {
187 - console.log(country)  
188 var cnpj = jQuery("#institutions_cnpj").parent().parent(); 187 var cnpj = jQuery("#institutions_cnpj").parent().parent();
189 var city = jQuery("#community_city").parent().parent(); 188 var city = jQuery("#community_city").parent().parent();
190 var state = jQuery("#community_state").parent().parent(); 189 var state = jQuery("#community_state").parent().parent();
public/mpog-software.js
@@ -10,15 +10,33 @@ @@ -10,15 +10,33 @@
10 jQuery(".operating-system-button-hide").hide(); 10 jQuery(".operating-system-button-hide").hide();
11 } 11 }
12 12
13 - function add_software_on_control_panel() {  
14 - if(jQuery(".control-panel").size() > 0 && jQuery(".control-panel-edit-profile-group:contains('Software')").size() > 0 ) {  
15 - jQuery(".control-panel")[0].innerHTML = jQuery(".control-panel-edit-profile-group:contains('Software')")[0].outerHTML + jQuery(".control-panel")[0].innerHTML  
16 - jQuery(".control-panel-edit-profile-group:contains('Software')")[1].remove(); 13 + function add_software_on_control_panel(control_panel) {
  14 + var software_link = jQuery(".control-panel-software-link").remove();
  15 +
  16 + if( software_link.size() > 0 ) {
  17 + control_panel.prepend(software_link);
  18 + }
  19 + }
  20 +
  21 + function add_institution_on_control_panel(control_panel) {
  22 + var institution_link = jQuery(".control-panel-instituton-link").remove();
  23 +
  24 + if( institution_link.size() > 0 ) {
  25 + control_panel.prepend(institution_link);
  26 + }
  27 + }
  28 +
  29 + function add_itens_on_controla_panel() {
  30 + var control_panel = jQuery(".control-panel");
  31 +
  32 + if( control_panel.size() > 0 ) {
  33 + add_software_on_control_panel(control_panel);
  34 + add_institution_on_control_panel(control_panel);
17 } 35 }
18 } 36 }
19 37
20 jQuery(document).ready(function(){ 38 jQuery(document).ready(function(){
21 - add_software_on_control_panel(); 39 + add_itens_on_controla_panel();
22 hide_infos(); 40 hide_infos();
23 }); 41 });
24 })(); 42 })();
25 \ No newline at end of file 43 \ No newline at end of file