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,8 +78,8 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin | ||
| 78 | 78 | ||
| 79 | def profile_tabs | 79 | def profile_tabs |
| 80 | if context.profile.community? | 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 | end | 83 | end |
| 84 | end | 84 | end |
| 85 | 85 | ||
| @@ -126,6 +126,7 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin | @@ -126,6 +126,7 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin | ||
| 126 | views/create-institution.js | 126 | views/create-institution.js |
| 127 | views/complete-registration.js | 127 | views/complete-registration.js |
| 128 | views/search-software-catalog.js | 128 | views/search-software-catalog.js |
| 129 | + views/profile-tabs-software.js | ||
| 129 | blocks/software-download.js | 130 | blocks/software-download.js |
| 130 | initializer.js | 131 | initializer.js |
| 131 | app.js | 132 | app.js |
| @@ -341,15 +342,15 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin | @@ -341,15 +342,15 @@ class SoftwareCommunitiesPlugin < Noosfero::Plugin | ||
| 341 | 342 | ||
| 342 | def profile_tabs_software | 343 | def profile_tabs_software |
| 343 | { :title => _('Software'), | 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 | :start => true } | 347 | :start => true } |
| 347 | end | 348 | end |
| 348 | 349 | ||
| 349 | def profile_tabs_institution | 350 | def profile_tabs_institution |
| 350 | { :title => _('Institution'), | 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 | :start => true | 354 | :start => true |
| 354 | } | 355 | } |
| 355 | end | 356 | end |
public/initializer.js
public/views/control-panel.js
| 1 | modulejs.define('ControlPanel', ['jquery'], function($) { | 1 | modulejs.define('ControlPanel', ['jquery'], function($) { |
| 2 | 'use strict'; | 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 | function add_software_on_control_panel(control_panel) { | 4 | function add_software_on_control_panel(control_panel) { |
| 17 | var software_link = $(".control-panel-software-link").remove(); | 5 | var software_link = $(".control-panel-software-link").remove(); |
| 18 | 6 | ||
| @@ -49,7 +37,6 @@ modulejs.define('ControlPanel', ['jquery'], function($) { | @@ -49,7 +37,6 @@ modulejs.define('ControlPanel', ['jquery'], function($) { | ||
| 49 | 37 | ||
| 50 | init: function() { | 38 | init: function() { |
| 51 | add_itens_on_controla_panel(); | 39 | add_itens_on_controla_panel(); |
| 52 | - hide_infos(); | ||
| 53 | } | 40 | } |
| 54 | } | 41 | } |
| 55 | }); | 42 | }); |
| @@ -0,0 +1,28 @@ | @@ -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 | +}); |