diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index dfd649d..5164a14 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1296,8 +1296,19 @@ module ApplicationHelper
end
end
+ def content_remove_spread(content)
+ not (profile != user || user.communities.present? || @portal_enabled)
+ end
+
def remove_content_button(action)
- @plugins.dispatch("content_remove_#{action.to_s}", @page).include?(true)
+ method_name = "content_remove_#{action.to_s}"
+ plugin_condition = @plugins.dispatch(method_name, @page).include?(true)
+ begin
+ core_condition = self.send(method_name, @page)
+ rescue NoMethodError
+ core_condition = false
+ end
+ core_condition || plugin_condition
end
def template_options(kind, field_name)
diff --git a/app/views/cms/publish.html.erb b/app/views/cms/publish.html.erb
index 2c4e476..82ad473 100644
--- a/app/views/cms/publish.html.erb
+++ b/app/views/cms/publish.html.erb
@@ -30,56 +30,60 @@
<% end %>
- -
- <%= _("Publish this article on your profile") %>
-
<%= _('You can publish this article on your profile where your friends and followers will see.') %>
- <%= form_tag do %>
- <%= hidden_field_tag :back_to, @back_to %>
-
- <%= labelled_text_field _('Title'), 'name', @article.name %>
-
+ <% if profile != user %>
+ -
+ <%= _("Publish this article on your profile") %>
+
<%= _('You can publish this article on your profile where your friends and followers will see.') %>
+ <%= form_tag do %>
+ <%= hidden_field_tag :back_to, @back_to %>
+
+ <%= labelled_text_field _('Title'), 'name', @article.name %>
+
- <% button_bar do %>
- <%= submit_button 'spread', _('Spread this') %>
+ <% button_bar do %>
+ <%= submit_button 'spread', _('Spread this') %>
+ <% end %>
<% end %>
- <% end %>
-
+
+ <% end %>
- -
- <%= _("Publish this article on communities you are part of") %>
-
<%= _('You can submit this article to one or more communities you are a member of, just search for the community below.') %>
- <%= form_tag :action => 'publish_on_communities', :id => @article.id do %>
- <%= hidden_field_tag :back_to, @back_to %>
- <% search_action = url_for(:action => 'search_communities_to_publish') %>
- <%= token_input_field_tag(:q, 'search-communities-to-publish', search_action, { :hint_text => _('Type in a search for your community'), :zindex => 10000, :focus => false }) %>
+ <% if user.communities.present? %>
+ -
+ <%= _("Publish this article on communities you are part of") %>
+
<%= _('You can submit this article to one or more communities you are a member of, just search for the community below.') %>
+ <%= form_tag :action => 'publish_on_communities', :id => @article.id do %>
+ <%= hidden_field_tag :back_to, @back_to %>
+ <% search_action = url_for(:action => 'search_communities_to_publish') %>
+ <%= token_input_field_tag(:q, 'search-communities-to-publish', search_action, { :hint_text => _('Type in a search for your community'), :zindex => 10000, :focus => false }) %>
-
- <%= labelled_text_field _('Title'), 'name', @article.name %>
-
- <% button_bar do %>
- <%= submit_button 'spread', _('Spread this') %>
+
+ <%= labelled_text_field _('Title'), 'name', @article.name %>
+
+ <% button_bar do %>
+ <%= submit_button 'spread', _('Spread this') %>
+ <% end %>
<% end %>
- <% end %>
-
+
+ <% end %>
-<% if @portal_enabled %>
- -
- <%= _("Publish your article on portal community") %>
-
<%= _('You can suggest this article to the portal community, where it can show up on the homepage.') %>
+ <% if @portal_enabled %>
+ -
+ <%= _("Publish your article on portal community") %>
+
<%= _('You can suggest this article to the portal community, where it can show up on the homepage.') %>
- <%= form_tag :action => 'publish_on_portal_community', :id => @article.id do %>
- <%= hidden_field_tag :back_to, @back_to %>
-
- <%= labelled_text_field _('Title'), :name, @article.name %>
-
+ <%= form_tag :action => 'publish_on_portal_community', :id => @article.id do %>
+ <%= hidden_field_tag :back_to, @back_to %>
+
+ <%= labelled_text_field _('Title'), :name, @article.name %>
+
- <% button_bar do %>
- <%= submit_button 'spread', _('Spread this') %>
- <% end %>
+ <% button_bar do %>
+ <%= submit_button 'spread', _('Spread this') %>
+ <% end %>
+ <% end %>
+
<% end %>
-
-<% end %>
--
libgit2 0.21.2