@@ -111,6 +111,25 module SettingsHelper | |||||
111 | content_tag(:label, tag + text, options) |
|
111 | content_tag(:label, tag + text, options) | |
112 | end |
|
112 | end | |
113 |
|
113 | |||
|
114 | def session_lifetime_options | |||
|
115 | options = [[l(:label_disabled), 0]] | |||
|
116 | options += [4, 8, 12].map {|hours| | |||
|
117 | [l('datetime.distance_in_words.x_hours', :count => hours), (hours * 60).to_s] | |||
|
118 | } | |||
|
119 | options += [1, 7, 30, 60, 365].map {|days| | |||
|
120 | [l('datetime.distance_in_words.x_days', :count => days), (days * 24 * 60).to_s] | |||
|
121 | } | |||
|
122 | options | |||
|
123 | end | |||
|
124 | ||||
|
125 | def session_timeout_options | |||
|
126 | options = [[l(:label_disabled), 0]] | |||
|
127 | options += [1, 2, 4, 8, 12, 24, 48].map {|hours| | |||
|
128 | [l('datetime.distance_in_words.x_hours', :count => hours), (hours * 60).to_s] | |||
|
129 | } | |||
|
130 | options | |||
|
131 | end | |||
|
132 | ||||
114 | def link_copied_issue_options |
|
133 | def link_copied_issue_options | |
115 | options = [ |
|
134 | options = [ | |
116 | [:general_text_Yes, 'yes'], |
|
135 | [:general_text_Yes, 'yes'], |
@@ -29,8 +29,8 | |||||
29 | <legend><%= l(:label_session_expiration) %></legend> |
|
29 | <legend><%= l(:label_session_expiration) %></legend> | |
30 |
|
30 | |||
31 | <div class="tabular settings"> |
|
31 | <div class="tabular settings"> | |
32 | <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> |
|
32 | <p><%= setting_select :session_lifetime, session_lifetime_options %></p> | |
33 | <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> |
|
33 | <p><%= setting_select :session_timeout, session_timeout_options %></p> | |
34 | </div> |
|
34 | </div> | |
35 |
|
35 | |||
36 | <p><em class="info"><%= l(:text_session_expiration_settings) %></em></p> |
|
36 | <p><em class="info"><%= l(:text_session_expiration_settings) %></em></p> |
General Comments 0
You need to be logged in to leave comments.
Login now