mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
Registrar refactor fixes
This commit is contained in:
parent
d09855bc6d
commit
9bb20365c9
15 changed files with 46 additions and 57 deletions
|
@ -1,2 +0,0 @@
|
|||
module CurrentUserHelper
|
||||
end
|
|
@ -1,29 +0,0 @@
|
|||
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
|
15
app/helpers/registrar/application_helper.rb
Normal file
15
app/helpers/registrar/application_helper.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
module Registrar
|
||||
module ApplicationHelper
|
||||
def env_style
|
||||
return '' if unstable_env.nil?
|
||||
"background-image: url(#{image_path("registrar/bg-#{unstable_env}.png")});"
|
||||
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