content_tag(:label, tag + text, options)
end
+ def session_lifetime_options
+ options = [[l(:label_disabled), 0]]
+ options += [4, 8, 12].map {|hours|
+ [l('datetime.distance_in_words.x_hours', :count => hours), (hours * 60).to_s]
+ }
+ options += [1, 7, 30, 60, 365].map {|days|
+ [l('datetime.distance_in_words.x_days', :count => days), (days * 24 * 60).to_s]
+ }
+ options
+ end
+
+ def session_timeout_options
+ options = [[l(:label_disabled), 0]]
+ options += [1, 2, 4, 8, 12, 24, 48].map {|hours|
+ [l('datetime.distance_in_words.x_hours', :count => hours), (hours * 60).to_s]
+ }
+ options
+ end
+
def link_copied_issue_options
options = [
[:general_text_Yes, 'yes'],
<legend><%= l(:label_session_expiration) %></legend>
<div class="tabular settings">
- <p><%= setting_select :session_lifetime, [[l(:label_disabled), 0]] + [1, 7, 30, 60, 365].collect{|days| [l('datetime.distance_in_words.x_days', :count => days), (days * 60 * 24).to_s]} %></p>
- <p><%= setting_select :session_timeout, [[l(:label_disabled), 0]] + [1, 2, 4, 8, 12, 24, 48].collect{|hours| [l('datetime.distance_in_words.x_hours', :count => hours), (hours * 60).to_s]} %></p>
+ <p><%= setting_select :session_lifetime, session_lifetime_options %></p>
+ <p><%= setting_select :session_timeout, session_timeout_options %></p>
</div>
<p><em class="info"><%= l(:text_session_expiration_settings) %></em></p>