summaryrefslogtreecommitdiff
path: root/app/helpers/users_helper.rb
blob: 985f750995df5ec57548b1e8ae5a878fdf09b52e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module UsersHelper

  def user_form_class(*classes)
    (classes + ['user', 'hidden', 'js-show', (@user.new_record? ? 'new' : 'edit')]).compact.join(' ')
  end

  def wrapped(item, options = {})
    options[:as] ||= :div
    content_tag options[:as], :class => dom_class(item), :id => dom_id(item) do
      yield
    end
  end


  def destroy_account_text
    if @user == current_user
      t(:destroy_my_account)
    else
      t(:admin_destroy_account, :username => @user.login)
    end
  end
end