cirandas.net

ref: master

app/views/content_viewer/_article_toolbar.html.erb


>
  
<%= fullscreen_buttons('#article') %> <% if @page.allow_edit?(user) && !remove_content_button(:edit, @page) %> <% content = content_tag('span', label_for_edit_article(@page)) %> <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'edit', :id => @page.id }) %> <%= expirable_button @page, :edit, content, url %> <% end %> <% if @page != profile.home_page && !@page.has_posts? && @page.allow_delete?(user) && !remove_content_button(:delete, @page)%> <% content = content_tag( 'span', _('Delete') ) %> <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'destroy', :id => @page.id}) %> <% options = {:method => :post, 'data-confirm' => delete_article_message(@page)} %> <%= expirable_button @page, :delete, content, url, options %> <% end %> <% if @page.allow_spread?(user) && !remove_content_button(:spread, @page) %> <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'publish', :id => @page.id }) %> <%= expirable_button @page, :spread, content_tag( 'span', _('Spread this') ), url, {:modal => true} if url %> <% end %> <% if !@page.gallery? && (@page.allow_create?(user) || (@page.parent && @page.parent.allow_create?(user))) %> <% if @page.translatable? && !@page.native_translation.language.blank? && !remove_content_button(:locale, @page) %> <% content = _('Add translation') %> <% parent_id = (@page.folder? ? @page : (@page.parent.nil? ? nil : @page.parent)) %> <% url = profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => parent_id, :type => @page.type, :article => { :translation_of_id => @page.native_translation.id })%> <%= expirable_button @page, :locale, content, url_for(url).html_safe %> <% end %> <% if !@page.archived? %> <%= modal_button(:new, label_for_new_article(@page), profile.admin_url.merge(:controller => 'cms', :action => 'new', :parent_id => (@page.folder? ? @page : @page.parent))) unless remove_content_button(:new, @page) %> <% end %> <%# not really useful %> <%# content = content_tag('span', label_for_clone_article(@page)) %> <%# url = profile.admin_url.merge({ :controller => 'cms', :action => 'new', :id => @page.id, :clone => true, :parent_id => (@page.folder? ? @page : @page.parent), :type => @page.class}) %> <%#= expirable_button @page, :clone, content, url %> <% end %> <% if @page.accept_uploads? && @page.allow_create?(user) %> <%= button('upload-file', _('Upload files'), profile.admin_url.merge(:controller => 'cms', :action => 'upload_files', :parent_id => (@page.folder? ? @page : @page.parent))) unless remove_content_button(:upload, @page)%> <% end %> <% if !@page.allow_create?(user) && profile.organization? && (@page.blog? || @page.parent && @page.parent.blog?) && !remove_content_button(:suggest, @page) %> <% content = content_tag( 'span', _('Suggest an article') ) %> <% url = profile.admin_url.merge({ :controller => 'cms', :action => 'suggest_an_article'}) %> <% options = {:id => 'suggest-article-link'} %> <%= expirable_button @page, :suggest, content, url, options %> <% end %> <% if @page.display_versions? %> <%= button(:clock, _('All versions'), {:controller => 'content_viewer', :profile => profile.identifier, :action => 'article_versions'}, :id => 'article-versions-link') %> <% end %> <% plugins_toolbar_actions_for_article(@page).each do |plugin_button| %> <%= button plugin_button[:icon], plugin_button[:title], plugin_button[:url], plugin_button[:html_options] %> <% end %> <%= following_button @page, user %> <%= report_abuse(profile, :link, @page) %>
<% if @page.blog? and !@page.image.nil? %>
<%= image_tag(@page.image.public_filename())%>
<% end %> <%= button_without_text(:feed, _('RSS feed'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %> <%= safe_join(@plugins.dispatch(:article_header_extra_contents, @page).collect { |content| instance_exec(&content) }) %> <% if @page.archived? %> <%= render :partial => 'cms/archived_warning', :locals => {:article => @page} %> <% end %> <%= render :partial => 'article_title', :locals => {:no_link => true} %> <%= article_translations(@page) %>