mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
Init depp refactor
This commit is contained in:
parent
f3c9e0aecc
commit
3fe47973e6
156 changed files with 191 additions and 1662 deletions
29
app/helpers/depp/application_helper.rb
Normal file
29
app/helpers/depp/application_helper.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue