Commit 9e718e4ba66850be479dd572f6d8c38677f92aa4
1 parent
e620fe76
Exists in
master
and in
28 other branches
[Mezuro] Mezuro content types according to control panel buttons
Showing
3 changed files
with
8 additions
and
4 deletions
Show diff stats
plugins/mezuro/lib/mezuro_plugin.rb
... | ... | @@ -15,14 +15,18 @@ class MezuroPlugin < Noosfero::Plugin |
15 | 15 | end |
16 | 16 | |
17 | 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 | 23 | end |
20 | 24 | |
21 | 25 | def control_panel_buttons |
22 | 26 | if context.profile.is_a?(Community) |
23 | 27 | {:title => _('Mezuro Project'), :url => {:controller => 'cms', :action => 'new', :profile => context.profile.identifier, :type => 'MezuroPlugin::ProjectContent'} } |
24 | 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 | 30 | end |
27 | 31 | end |
28 | 32 | ... | ... |
plugins/mezuro/lib/mezuro_plugin/configuration_content.rb
plugins/mezuro/lib/mezuro_plugin/project_content.rb