##// END OF EJS Templates
added a setting option to set the feeds content limit...
Jean-Philippe Lang -
r343:143be7ee0292
parent child
Show More
@@ -27,7 +27,7 class FeedsController < ApplicationController
27 # news feeds
27 # news feeds
28 def news
28 def news
29 News.with_scope(:find => @find_options) do
29 News.with_scope(:find => @find_options) do
30 @news = News.find :all, :order => "#{News.table_name}.created_on DESC", :limit => 10, :include => [ :author, :project ]
30 @news = News.find :all, :order => "#{News.table_name}.created_on DESC", :include => [ :author, :project ]
31 end
31 end
32 headers["Content-Type"] = "application/rss+xml"
32 headers["Content-Type"] = "application/rss+xml"
33 render :action => 'news_atom' if 'atom' == params[:format]
33 render :action => 'news_atom' if 'atom' == params[:format]
@@ -94,7 +94,7 private
94 # global feed
94 # global feed
95 scope = ["#{Project.table_name}.is_public=?", true]
95 scope = ["#{Project.table_name}.is_public=?", true]
96 end
96 end
97 @find_options = {:conditions => scope, :limit => 10}
97 @find_options = {:conditions => scope, :limit => Setting.feeds_limit}
98 return true
98 return true
99 end
99 end
100 end
100 end
@@ -1,5 +1,6
1 <h2><%= l(:label_settings) %></h2>
1 <h2><%= l(:label_settings) %></h2>
2
2
3 <div id="settings">
3 <% form_tag({:action => 'edit'}, :class => "tabular") do %>
4 <% form_tag({:action => 'edit'}, :class => "tabular") do %>
4 <div class="box">
5 <div class="box">
5 <p><label><%= l(:setting_app_title) %></label>
6 <p><label><%= l(:setting_app_title) %></label>
@@ -41,6 +42,10
41 <p><label><%= l(:setting_wiki_compression) %></label>
42 <p><label><%= l(:setting_wiki_compression) %></label>
42 <%= select_tag 'settings[wiki_compression]', options_for_select( [[l(:label_none), 0], ["gzip", "gzip"]], Setting.wiki_compression) %></p>
43 <%= select_tag 'settings[wiki_compression]', options_for_select( [[l(:label_none), 0], ["gzip", "gzip"]], Setting.wiki_compression) %></p>
43
44
45 <p><label><%= l(:setting_feeds_limit) %></label>
46 <%= text_field_tag 'settings[feeds_limit]', Setting.feeds_limit, :size => 6 %></p>
47
44 </div>
48 </div>
45 <%= submit_tag l(:button_save) %>
49 <%= submit_tag l(:button_save) %>
50 </div>
46 <% end %> No newline at end of file
51 <% end %>
@@ -46,4 +46,7 wiki_compression:
46 default_language:
46 default_language:
47 default: en
47 default: en
48 host_name:
48 host_name:
49 default: localhost:3000 No newline at end of file
49 default: localhost:3000
50 feeds_limit:
51 format: int
52 default: 15
@@ -156,6 +156,7 setting_mail_from: Emission address
156 setting_host_name: Host Name
156 setting_host_name: Host Name
157 setting_text_formatting: Textformatierung
157 setting_text_formatting: Textformatierung
158 setting_wiki_compression: Wiki Geschichte Kompression
158 setting_wiki_compression: Wiki Geschichte Kompression
159 setting_feeds_limit: Feed content limit
159
160
160 label_user: Benutzer
161 label_user: Benutzer
161 label_user_plural: Benutzer
162 label_user_plural: Benutzer
@@ -156,6 +156,7 setting_mail_from: Emission mail address
156 setting_host_name: Host name
156 setting_host_name: Host name
157 setting_text_formatting: Text formatting
157 setting_text_formatting: Text formatting
158 setting_wiki_compression: Wiki history compression
158 setting_wiki_compression: Wiki history compression
159 setting_feeds_limit: Feed content limit
159
160
160 label_user: User
161 label_user: User
161 label_user_plural: Users
162 label_user_plural: Users
@@ -156,6 +156,7 setting_mail_from: Email de la emisión
156 setting_host_name: Nombre de anfitrión
156 setting_host_name: Nombre de anfitrión
157 setting_text_formatting: Formato de texto
157 setting_text_formatting: Formato de texto
158 setting_wiki_compression: Compresión de la historia de Wiki
158 setting_wiki_compression: Compresión de la historia de Wiki
159 setting_feeds_limit: Feed content limit
159
160
160 label_user: Usuario
161 label_user: Usuario
161 label_user_plural: Usuarios
162 label_user_plural: Usuarios
@@ -156,6 +156,7 setting_mail_from: Adresse d'émission
156 setting_host_name: Nom d'hôte
156 setting_host_name: Nom d'hôte
157 setting_text_formatting: Formatage du texte
157 setting_text_formatting: Formatage du texte
158 setting_wiki_compression: Compression historique wiki
158 setting_wiki_compression: Compression historique wiki
159 setting_feeds_limit: Limite du contenu des flux RSS
159
160
160 label_user: Utilisateur
161 label_user: Utilisateur
161 label_user_plural: Utilisateurs
162 label_user_plural: Utilisateurs
@@ -156,6 +156,7 setting_mail_from: Indirizzo sorgente e-mail
156 setting_host_name: Nome host
156 setting_host_name: Nome host
157 setting_text_formatting: Formattazione testo
157 setting_text_formatting: Formattazione testo
158 setting_wiki_compression: Compressione di storia di Wiki
158 setting_wiki_compression: Compressione di storia di Wiki
159 setting_feeds_limit: Feed content limit
159
160
160 label_user: Utente
161 label_user: Utente
161 label_user_plural: Utenti
162 label_user_plural: Utenti
@@ -157,6 +157,7 setting_mail_from: Emission メールアドレス
157 setting_host_name: ホスト名
157 setting_host_name: ホスト名
158 setting_text_formatting: テキストの書式
158 setting_text_formatting: テキストの書式
159 setting_wiki_compression: Wiki history compression
159 setting_wiki_compression: Wiki history compression
160 setting_feeds_limit: Feed content limit
160
161
161 label_user: ユーザ
162 label_user: ユーザ
162 label_user_plural: ユーザ
163 label_user_plural: ユーザ
@@ -575,6 +575,8 margin*/
575 color: #cc0000;
575 color: #cc0000;
576 }
576 }
577
577
578 #settings .tabular p{ padding-left: 250px; }
579 #settings .tabular label{ margin-left: -250px; width: 245px; }
578
580
579 /*.threepxfix class below:
581 /*.threepxfix class below:
580 Targets IE6- ONLY. Adds 3 pixel indent for multi-line form contents.
582 Targets IE6- ONLY. Adds 3 pixel indent for multi-line form contents.
General Comments 0
You need to be logged in to leave comments. Login now