Init depp refactor

This commit is contained in:
Priit Tark 2015-04-08 14:05:05 +03:00
parent f3c9e0aecc
commit 3fe47973e6
156 changed files with 191 additions and 1662 deletions

View file

@ -0,0 +1,29 @@
module Depp
module ApplicationHelper
def unstable_env
return nil if Rails.env.production?
Rails.env
end
def env_style
return '' if unstable_env.nil?
"background-image: url(#{image_path("depp/bg-#{unstable_env}.png")});"
end
def ident_for(contact)
case contact.ident_type
when 'birthday'
"#{contact.ident} [#{contact.ident_type}]"
else
"#{contact.ident} [#{contact.ident_country_code} #{contact.ident_type}]"
end
end
def pagination_details
params[:page] ||= 1
limit = ENV['depp_records_on_page'] || 20
offset = ((params[:page].to_i - 1) * limit.to_i)
[limit, offset]
end
end
end