Commit 9e718e4ba66850be479dd572f6d8c38677f92aa4

Authored by Paulo Meireles
1 parent e620fe76

[Mezuro] Mezuro content types according to control panel buttons

plugins/mezuro/lib/mezuro_plugin.rb
@@ -15,14 +15,18 @@ class MezuroPlugin < Noosfero::Plugin @@ -15,14 +15,18 @@ class MezuroPlugin < Noosfero::Plugin
15 end 15 end
16 16
17 def content_types 17 def content_types
18 - [MezuroPlugin::ConfigurationContent, MezuroPlugin::ProjectContent] 18 + if context.profile.is_a?(Community)
  19 + MezuroPlugin::ProjectContent
  20 + else
  21 + MezuroPlugin::ConfigurationContent
  22 + end
19 end 23 end
20 24
21 def control_panel_buttons 25 def control_panel_buttons
22 if context.profile.is_a?(Community) 26 if context.profile.is_a?(Community)
23 {:title => _('Mezuro Project'), :url => {:controller => 'cms', :action => 'new', :profile => context.profile.identifier, :type => 'MezuroPlugin::ProjectContent'} } 27 {:title => _('Mezuro Project'), :url => {:controller => 'cms', :action => 'new', :profile => context.profile.identifier, :type => 'MezuroPlugin::ProjectContent'} }
24 else 28 else
25 - {:title => _('Mezuro Configuration'), :url => {:controller => 'cms', :action => 'new', :profile => context.profile.identifier, :type => 'MezuroPlugin::ConfigurationContent'} } 29 + {:title => _('Mezuro Configuration'), :url => {:controller => 'cms', :action => 'new', :profile => context.profile.identifier, :type => 'MezuroPlugin::ConfigurationContent'} }
26 end 30 end
27 end 31 end
28 32
plugins/mezuro/lib/mezuro_plugin/configuration_content.rb
@@ -7,7 +7,7 @@ class MezuroPlugin::ConfigurationContent < Article @@ -7,7 +7,7 @@ class MezuroPlugin::ConfigurationContent < Article
7 after_destroy :remove_kalibro_configuration_from_service 7 after_destroy :remove_kalibro_configuration_from_service
8 8
9 def self.short_description 9 def self.short_description
10 - 'Kalibro configuration' 10 + 'Mezuro configuration'
11 end 11 end
12 12
13 def self.description 13 def self.description
plugins/mezuro/lib/mezuro_plugin/project_content.rb
@@ -7,7 +7,7 @@ class MezuroPlugin::ProjectContent < Article @@ -7,7 +7,7 @@ class MezuroPlugin::ProjectContent < Article
7 validate_on_create :validate_repository_url 7 validate_on_create :validate_repository_url
8 8
9 def self.short_description 9 def self.short_description
10 - 'Kalibro project' 10 + 'Mezuro project'
11 end 11 end
12 12
13 def self.description 13 def self.description