Module: Admin::CommentsHelper

Defined in:
app/helpers/admin/comments_helper.rb

Instance Method Summary collapse

Instance Method Details

#comment_expiration_optionsObject



3
4
5
6
7
8
9
10
11
12
# File 'app/helpers/admin/comments_helper.rb', line 3

def comment_expiration_options
  I18n.with_options :scope => :'adva.comments.options.expiration' do |i18n|
    [ [i18n.t(:not_allowed),                           -1 ],
      [i18n.t(:never_expire),                           0 ],
      [i18n.t(:x_hours_after_publishing, :count => 24), 1 ],
      [i18n.t(:x_weeks_after_publishing, :count => 1),  7 ],
      [i18n.t(:x_months_after_publishing, :count => 1), 30],
      [i18n.t(:x_months_after_publishing, :count => 3), 90] ]
  end
end

#comments_state_optionsObject



14
15
16
17
18
19
# File 'app/helpers/admin/comments_helper.rb', line 14

def comments_state_options
  options = I18n.t(:'adva.comments.state.options')

  [[options[:approved],   'approved'],
 [options[:unapproved], 'unapproved']]
end