Commit 4b8a522c1a6494ee921d6ae25d14bf4c7d0027d8
1 parent
e11597d0
Exists in
master
and in
5 other branches
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>
Showing
5 changed files
with
38 additions
and
21 deletions
Show diff stats
lib/software_communities_plugin.rb
| ... | ... | @@ -78,8 +78,8 @@ class SoftwareCommunitiesPlugin < 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 < 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 < 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
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('ControlPanel', ['jquery'], function($) { |
| 49 | 37 | |
| 50 | 38 | init: function() { |
| 51 | 39 | add_itens_on_controla_panel(); |
| 52 | - hide_infos(); | |
| 53 | 40 | } |
| 54 | 41 | } |
| 55 | 42 | }); | ... | ... |
| ... | ... | @@ -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 | +}); | ... | ... |