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
This commit is contained in:
parent
d967bb4a54
commit
143be7ee02
|
@ -27,7 +27,7 @@ class FeedsController < ApplicationController
|
||||||
# news feeds
|
# news feeds
|
||||||
def news
|
def news
|
||||||
News.with_scope(:find => @find_options) do
|
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
|
end
|
||||||
headers["Content-Type"] = "application/rss+xml"
|
headers["Content-Type"] = "application/rss+xml"
|
||||||
render :action => 'news_atom' if 'atom' == params[:format]
|
render :action => 'news_atom' if 'atom' == params[:format]
|
||||||
|
@ -94,7 +94,7 @@ private
|
||||||
# global feed
|
# global feed
|
||||||
scope = ["#{Project.table_name}.is_public=?", true]
|
scope = ["#{Project.table_name}.is_public=?", true]
|
||||||
end
|
end
|
||||||
@find_options = {:conditions => scope, :limit => 10}
|
@find_options = {:conditions => scope, :limit => Setting.feeds_limit}
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<h2><%= l(:label_settings) %></h2>
|
<h2><%= l(:label_settings) %></h2>
|
||||||
|
|
||||||
|
<div id="settings">
|
||||||
<% form_tag({:action => 'edit'}, :class => "tabular") do %>
|
<% form_tag({:action => 'edit'}, :class => "tabular") do %>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<p><label><%= l(:setting_app_title) %></label>
|
<p><label><%= l(:setting_app_title) %></label>
|
||||||
|
@ -41,6 +42,10 @@
|
||||||
<p><label><%= l(:setting_wiki_compression) %></label>
|
<p><label><%= l(:setting_wiki_compression) %></label>
|
||||||
<%= select_tag 'settings[wiki_compression]', options_for_select( [[l(:label_none), 0], ["gzip", "gzip"]], Setting.wiki_compression) %></p>
|
<%= select_tag 'settings[wiki_compression]', options_for_select( [[l(:label_none), 0], ["gzip", "gzip"]], Setting.wiki_compression) %></p>
|
||||||
|
|
||||||
|
<p><label><%= l(:setting_feeds_limit) %></label>
|
||||||
|
<%= text_field_tag 'settings[feeds_limit]', Setting.feeds_limit, :size => 6 %></p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<%= submit_tag l(:button_save) %>
|
<%= submit_tag l(:button_save) %>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
|
@ -46,4 +46,7 @@ wiki_compression:
|
||||||
default_language:
|
default_language:
|
||||||
default: en
|
default: en
|
||||||
host_name:
|
host_name:
|
||||||
default: localhost:3000
|
default: localhost:3000
|
||||||
|
feeds_limit:
|
||||||
|
format: int
|
||||||
|
default: 15
|
||||||
|
|
|
@ -156,6 +156,7 @@ setting_mail_from: Emission address
|
||||||
setting_host_name: Host Name
|
setting_host_name: Host Name
|
||||||
setting_text_formatting: Textformatierung
|
setting_text_formatting: Textformatierung
|
||||||
setting_wiki_compression: Wiki Geschichte Kompression
|
setting_wiki_compression: Wiki Geschichte Kompression
|
||||||
|
setting_feeds_limit: Feed content limit
|
||||||
|
|
||||||
label_user: Benutzer
|
label_user: Benutzer
|
||||||
label_user_plural: Benutzer
|
label_user_plural: Benutzer
|
||||||
|
|
|
@ -156,6 +156,7 @@ setting_mail_from: Emission mail address
|
||||||
setting_host_name: Host name
|
setting_host_name: Host name
|
||||||
setting_text_formatting: Text formatting
|
setting_text_formatting: Text formatting
|
||||||
setting_wiki_compression: Wiki history compression
|
setting_wiki_compression: Wiki history compression
|
||||||
|
setting_feeds_limit: Feed content limit
|
||||||
|
|
||||||
label_user: User
|
label_user: User
|
||||||
label_user_plural: Users
|
label_user_plural: Users
|
||||||
|
|
|
@ -156,6 +156,7 @@ setting_mail_from: Email de la emisión
|
||||||
setting_host_name: Nombre de anfitrión
|
setting_host_name: Nombre de anfitrión
|
||||||
setting_text_formatting: Formato de texto
|
setting_text_formatting: Formato de texto
|
||||||
setting_wiki_compression: Compresión de la historia de Wiki
|
setting_wiki_compression: Compresión de la historia de Wiki
|
||||||
|
setting_feeds_limit: Feed content limit
|
||||||
|
|
||||||
label_user: Usuario
|
label_user: Usuario
|
||||||
label_user_plural: Usuarios
|
label_user_plural: Usuarios
|
||||||
|
|
|
@ -156,6 +156,7 @@ setting_mail_from: Adresse d'émission
|
||||||
setting_host_name: Nom d'hôte
|
setting_host_name: Nom d'hôte
|
||||||
setting_text_formatting: Formatage du texte
|
setting_text_formatting: Formatage du texte
|
||||||
setting_wiki_compression: Compression historique wiki
|
setting_wiki_compression: Compression historique wiki
|
||||||
|
setting_feeds_limit: Limite du contenu des flux RSS
|
||||||
|
|
||||||
label_user: Utilisateur
|
label_user: Utilisateur
|
||||||
label_user_plural: Utilisateurs
|
label_user_plural: Utilisateurs
|
||||||
|
|
|
@ -156,6 +156,7 @@ setting_mail_from: Indirizzo sorgente e-mail
|
||||||
setting_host_name: Nome host
|
setting_host_name: Nome host
|
||||||
setting_text_formatting: Formattazione testo
|
setting_text_formatting: Formattazione testo
|
||||||
setting_wiki_compression: Compressione di storia di Wiki
|
setting_wiki_compression: Compressione di storia di Wiki
|
||||||
|
setting_feeds_limit: Feed content limit
|
||||||
|
|
||||||
label_user: Utente
|
label_user: Utente
|
||||||
label_user_plural: Utenti
|
label_user_plural: Utenti
|
||||||
|
|
|
@ -157,6 +157,7 @@ setting_mail_from: Emission メールアドレス
|
||||||
setting_host_name: ホスト名
|
setting_host_name: ホスト名
|
||||||
setting_text_formatting: テキストの書式
|
setting_text_formatting: テキストの書式
|
||||||
setting_wiki_compression: Wiki history compression
|
setting_wiki_compression: Wiki history compression
|
||||||
|
setting_feeds_limit: Feed content limit
|
||||||
|
|
||||||
label_user: ユーザ
|
label_user: ユーザ
|
||||||
label_user_plural: ユーザ
|
label_user_plural: ユーザ
|
||||||
|
|
|
@ -575,6 +575,8 @@ margin*/
|
||||||
color: #cc0000;
|
color: #cc0000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#settings .tabular p{ padding-left: 250px; }
|
||||||
|
#settings .tabular label{ margin-left: -250px; width: 245px; }
|
||||||
|
|
||||||
/*.threepxfix class below:
|
/*.threepxfix class below:
|
||||||
Targets IE6- ONLY. Adds 3 pixel indent for multi-line form contents.
|
Targets IE6- ONLY. Adds 3 pixel indent for multi-line form contents.
|
||||||
|
|
Loading…
Reference in New Issue