From ac8f7163a133f8076f41ca2aec0711cc5167c846 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Thu, 21 May 2015 15:02:57 -0300 Subject: [PATCH] Limit pending tasks --- app/views/content_viewer/_article_toolbar.html.erb.orig | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/views/profile_editor/_pending_tasks.html.erb | 2 +- 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 app/views/content_viewer/_article_toolbar.html.erb.orig diff --git a/app/views/content_viewer/_article_toolbar.html.erb.orig b/app/views/content_viewer/_article_toolbar.html.erb.orig new file mode 100644 index 0000000..ba97b29 --- /dev/null +++ b/app/views/content_viewer/_article_toolbar.html.erb.orig @@ -0,0 +1,69 @@ +> +
+<<<<<<< HEAD + <%= fullscreen_buttons('#article') %> +======= + + <%= fullscreen_buttons('#article') %> + +>>>>>>> master + <% 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, :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, {:class => 'colorbox'} 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 %> + <% end %> + + <%= modal_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)))) unless remove_content_button(:new, @page) %> + <% 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 %> + + <%= report_abuse(profile, :link, @page) %> +
+
+ <% if @page.blog? and !@page.image.nil? %> +
<%= image_tag(@page.image.public_filename())%>
+ <% end %> + <%= link_to(image_tag('icons-mime/rss-feed.png'), @page.feed.url, :class => 'blog-feed-link') if @page.has_posts? && @page.feed %> + <%= @plugins.dispatch(:article_header_extra_contents, @page).collect { |content| instance_exec(&content) }.join("") %> + <%= article_title(@page, :no_link => true) %> + <%= article_translations(@page) %> +
+ diff --git a/app/views/profile_editor/_pending_tasks.html.erb b/app/views/profile_editor/_pending_tasks.html.erb index e266f8f..4b4addb 100644 --- a/app/views/profile_editor/_pending_tasks.html.erb +++ b/app/views/profile_editor/_pending_tasks.html.erb @@ -4,7 +4,7 @@

<%= _('You have pending requests') %>

    - <%= @pending_tasks.map {|task| content_tag('li', task_information(task))}.join %> + <%= @pending_tasks.take(10).map {|task| content_tag('li', task_information(task))}.join %>
<%= button(:todo, _('Process requests'), :controller => 'tasks', :action => 'index') %>
-- libgit2 0.21.2