<%
# AddThis Button
if block_given? and File.exists?( RAILS_ROOT + '/config/web2.0.yml')
opts = YAML.load_file( RAILS_ROOT + '/config/web2.0.yml' )
if opts['addthis']
opts = opts['addthis']
%>
<% end; end %>
<%= article_title(@page, :no_link => true) %>
<% if @page.allow_post_content?(user) %>
<% unless @page.blog? %>
<%= link_to content_tag( 'span', label_for_edit_article(@page) ),
profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }),
:class => 'button with-text icon-edit' %>
<% end %>
<% if !(profile.kind_of?(Enterprise) && environment.enabled?('disable_cms')) %>
<% if @page != profile.home_page && !@page.blog? %>
<%= link_to content_tag( 'span', _('Delete') ),
profile.admin_url.merge({ :controller => 'cms', :action => 'destroy', :id => @page }),
:class => 'button with-text icon-delete' %>
<% end %>
<% if profile.kind_of?(Person) && !environment.enabled?('disable_cms') && !@page.folder? %>
<%= link_to content_tag( 'span', _('Spread this') ),
profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page }),
:class => 'button with-text icon-spread' %>
<% end %>
<% if !@page.display_as_gallery? %>
<%= lightbox_button(:new, label_for_new_article(@page), profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)))) %>
<% end %>
<% if (@page.folder? && !@page.blog?) || (@page.parent && @page.parent.folder? && !@page.parent.blog?) %>
<%= button('upload-file', _('Upload files'), profile.admin_url.merge(:controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent))) %>
<% end %>
<% end %>
<% if profile.kind_of?(Enterprise) && @page.display_as_gallery? %>
<%= button('upload-file', _('Upload files'), :controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent)) %>
<% end %>
<% end %>
<% if !@page.tags.empty? %>
<%= _("This article's tags:") %>
<%= @page.tags.map { |t| link_to(t, :controller => 'profile', :profile => @profile.identifier, :action => 'tag', :id => t.name ) }.join("\n") %>
<% end %>
<% if @page.display_hits? %>
<%= n_('Viewed one time', 'Viewed %{num} times', @page.hits) % { :num => @page.hits } %>
<% end %>
<% if @page.parent && !@page.parent.path.blank? %>
<%= link_to _('Go back'), @page.parent.url %>
<% end %>
<% if profile.enterprise? and !profile.enabled? and !profile.blocks.select {|b| b.class == DisabledEnterpriseMessageBlock}.any? %>
<%= environment.message_for_disabled_enterprise %>
<% end %>
<% cache(@page.cache_key(params, user)) do %>
">
<%= article_to_html(@page) %>
<% end %>
<% if ! @page.categories.empty? %>
<%= _('Categories') %>
<%= @page.categories.map {|item| link_to_category(item, false) }.join(", ") %>
<% end %>
<% if ! @page.source.nil? and ! @page.source.empty?%>
<%= _('Source: %s') % link_to(@page.source, @page.source) %>
<% end %>
> <%= number_of_comments(@page) %>
<%= render :partial => 'comment', :collection => @comments %> <%= render :partial => 'comment_form' %> <% end %>