From 143be7ee029273ca882d3cfb807a9952eaab6539 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 18 Mar 2007 18:32:59 +0000 Subject: [PATCH] added a setting option to set the feeds content limit git-svn-id: http://redmine.rubyforge.org/svn/trunk@346 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/feeds_controller.rb | 4 ++-- app/views/settings/edit.rhtml | 5 +++++ config/settings.yml | 5 ++++- lang/de.yml | 1 + lang/en.yml | 1 + lang/es.yml | 1 + lang/fr.yml | 1 + lang/it.yml | 1 + lang/ja.yml | 1 + public/stylesheets/application.css | 2 ++ 10 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/controllers/feeds_controller.rb b/app/controllers/feeds_controller.rb index 46e8ae05c..20ae6f254 100644 --- a/app/controllers/feeds_controller.rb +++ b/app/controllers/feeds_controller.rb @@ -27,7 +27,7 @@ class FeedsController < ApplicationController # news feeds def news News.with_scope(:find => @find_options) do - @news = News.find :all, :order => "#{News.table_name}.created_on DESC", :limit => 10, :include => [ :author, :project ] + @news = News.find :all, :order => "#{News.table_name}.created_on DESC", :include => [ :author, :project ] end headers["Content-Type"] = "application/rss+xml" render :action => 'news_atom' if 'atom' == params[:format] @@ -94,7 +94,7 @@ private # global feed scope = ["#{Project.table_name}.is_public=?", true] end - @find_options = {:conditions => scope, :limit => 10} + @find_options = {:conditions => scope, :limit => Setting.feeds_limit} return true end end diff --git a/app/views/settings/edit.rhtml b/app/views/settings/edit.rhtml index aac4ab686..4bdea07b9 100644 --- a/app/views/settings/edit.rhtml +++ b/app/views/settings/edit.rhtml @@ -1,5 +1,6 @@

<%= l(:label_settings) %>

+
<% form_tag({:action => 'edit'}, :class => "tabular") do %>

@@ -41,6 +42,10 @@

<%= select_tag 'settings[wiki_compression]', options_for_select( [[l(:label_none), 0], ["gzip", "gzip"]], Setting.wiki_compression) %>

+

+<%= text_field_tag 'settings[feeds_limit]', Setting.feeds_limit, :size => 6 %>

+
<%= submit_tag l(:button_save) %> +
<% end %> \ No newline at end of file diff --git a/config/settings.yml b/config/settings.yml index 8961d34a0..c3292e516 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -46,4 +46,7 @@ wiki_compression: default_language: default: en host_name: - default: localhost:3000 \ No newline at end of file + default: localhost:3000 +feeds_limit: + format: int + default: 15 diff --git a/lang/de.yml b/lang/de.yml index 05ea437b6..8c5bbf170 100644 --- a/lang/de.yml +++ b/lang/de.yml @@ -156,6 +156,7 @@ setting_mail_from: Emission address setting_host_name: Host Name setting_text_formatting: Textformatierung setting_wiki_compression: Wiki Geschichte Kompression +setting_feeds_limit: Feed content limit label_user: Benutzer label_user_plural: Benutzer diff --git a/lang/en.yml b/lang/en.yml index 683c0ee7b..b6ada109b 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -156,6 +156,7 @@ setting_mail_from: Emission mail address setting_host_name: Host name setting_text_formatting: Text formatting setting_wiki_compression: Wiki history compression +setting_feeds_limit: Feed content limit label_user: User label_user_plural: Users diff --git a/lang/es.yml b/lang/es.yml index d455bcf72..337e5c753 100644 --- a/lang/es.yml +++ b/lang/es.yml @@ -156,6 +156,7 @@ setting_mail_from: Email de la emisión setting_host_name: Nombre de anfitrión setting_text_formatting: Formato de texto setting_wiki_compression: Compresión de la historia de Wiki +setting_feeds_limit: Feed content limit label_user: Usuario label_user_plural: Usuarios diff --git a/lang/fr.yml b/lang/fr.yml index 83800e0a3..84995c83d 100644 --- a/lang/fr.yml +++ b/lang/fr.yml @@ -156,6 +156,7 @@ setting_mail_from: Adresse d'émission setting_host_name: Nom d'hôte setting_text_formatting: Formatage du texte setting_wiki_compression: Compression historique wiki +setting_feeds_limit: Limite du contenu des flux RSS label_user: Utilisateur label_user_plural: Utilisateurs diff --git a/lang/it.yml b/lang/it.yml index 5bc88fb0a..47c623bcc 100644 --- a/lang/it.yml +++ b/lang/it.yml @@ -156,6 +156,7 @@ setting_mail_from: Indirizzo sorgente e-mail setting_host_name: Nome host setting_text_formatting: Formattazione testo setting_wiki_compression: Compressione di storia di Wiki +setting_feeds_limit: Feed content limit label_user: Utente label_user_plural: Utenti diff --git a/lang/ja.yml b/lang/ja.yml index 36272bcc7..8466cf62f 100644 --- a/lang/ja.yml +++ b/lang/ja.yml @@ -157,6 +157,7 @@ setting_mail_from: Emission メールアドレス setting_host_name: ホスト名 setting_text_formatting: テキストの書式 setting_wiki_compression: Wiki history compression +setting_feeds_limit: Feed content limit label_user: ユーザ label_user_plural: ユーザ diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 7fda16cd3..20395a7a2 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -575,6 +575,8 @@ margin*/ color: #cc0000; } +#settings .tabular p{ padding-left: 250px; } +#settings .tabular label{ margin-left: -250px; width: 245px; } /*.threepxfix class below: Targets IE6- ONLY. Adds 3 pixel indent for multi-line form contents. -- 2.39.5