Fixed merge conflicts
This commit is contained in:
@@ -431,6 +431,14 @@ module ApplicationHelper
|
||||
_(*a)
|
||||
end
|
||||
|
||||
def lookup_ip
|
||||
if request.remote_ip == '127.0.0.1'
|
||||
session['remote_ip'] || (session['remote_ip'] = open("http://checkip.dyndns.org").first.gsub(/^.*\s([\d\.]+).*$/s, '\1').gsub(/[^\.\d]/, ''))
|
||||
else
|
||||
request.remote_ip
|
||||
end
|
||||
end
|
||||
|
||||
def lookup_ip_location
|
||||
if request.remote_ip == '127.0.0.1'
|
||||
Geocoder.search(session['remote_ip'] || (session['remote_ip'] = open("http://checkip.dyndns.org").first.gsub(/^.*\s([\d\.]+).*$/s, '\1').gsub(/[^\.\d]/, ''))).first
|
||||
@@ -492,6 +500,11 @@ module ApplicationHelper
|
||||
subdomain == 'test'
|
||||
end
|
||||
|
||||
def location(location)
|
||||
territory = Carmen::Country.coded(location.country).subregions.coded(location.territory)
|
||||
location.city + (territory ? ' ' + territory.name : '') + ', ' + Carmen::Country.coded(location.country).name
|
||||
end
|
||||
|
||||
private
|
||||
def _form_field(type, name, value, options)
|
||||
if type == 'check_box'
|
||||
|
||||
Reference in New Issue
Block a user