poll options

This commit is contained in:
Holly 2024-01-31 00:17:01 +00:00
parent ca19b7d00c
commit 32ff30f11c
2 changed files with 2 additions and 1 deletions

View File

@ -164,6 +164,7 @@ class PollForm extends ImmutablePureComponent {
<option value={43200}>{intl.formatMessage(messages.hours, { number: 12 })}</option> <option value={43200}>{intl.formatMessage(messages.hours, { number: 12 })}</option>
<option value={86400}>{intl.formatMessage(messages.days, { number: 1 })}</option> <option value={86400}>{intl.formatMessage(messages.days, { number: 1 })}</option>
<option value={259200}>{intl.formatMessage(messages.days, { number: 3 })}</option> <option value={259200}>{intl.formatMessage(messages.days, { number: 3 })}</option>
<option value={601200}>{intl.formatMessage(messages.days, { number: 6.9583333})}</option>
<option value={604800}>{intl.formatMessage(messages.days, { number: 7 })}</option> <option value={604800}>{intl.formatMessage(messages.days, { number: 7 })}</option>
</select> </select>
</div> </div>

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
class PollValidator < ActiveModel::Validator class PollValidator < ActiveModel::Validator
MAX_OPTIONS = (ENV['MAX_POLL_OPTIONS'] || 5).to_i MAX_OPTIONS = (ENV['MAX_POLL_OPTIONS'] || 30).to_i
MAX_OPTION_CHARS = (ENV['MAX_POLL_OPTION_CHARS'] || 100).to_i MAX_OPTION_CHARS = (ENV['MAX_POLL_OPTION_CHARS'] || 100).to_i
MAX_EXPIRATION = 1.month.freeze MAX_EXPIRATION = 1.month.freeze
MIN_EXPIRATION = 5.minutes.freeze MIN_EXPIRATION = 5.minutes.freeze