magic_addresses 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c017aed86d4158847822bd107b29a2f18f75274
|
4
|
+
data.tar.gz: 5b95f14b10e854200172bd3f6e12d3f1767d6ace
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4a858f596f9f146ef71cb83e1940ff9df5bb1ef7eaf4e91e8433897e9d452767b9333e1e3e66a155b41d50d47bad574ee891598563ff843af2e022434c11c06
|
7
|
+
data.tar.gz: e3eb9a9531fdb02039125bc5e169abc04506c591aed459aa37c848f166b7e7cfebdab2e53fda3daf1527dbb57b3fbe48be55c31cdbb8d38f5b49fdc64d163452
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<% idkey = "locations_attributes_#{rand(999999)}_" %>
|
4
4
|
<div class="map_form">
|
5
5
|
|
6
|
-
<input type="text" id="<%= idkey %>map_data" class="mgca_map_data <%= style %>" placeholder="<%= placeholder %>" />
|
6
|
+
<input type="text" id="<%= idkey %>map_data" class="mgca_map_data <%= style %>" placeholder="<%= placeholder %>" value="<%= f.object.presentation %>" />
|
7
7
|
|
8
8
|
<div class="hidden_mgca_form">
|
9
9
|
<div class="row">
|
@@ -29,19 +29,12 @@
|
|
29
29
|
</div>
|
30
30
|
</div>
|
31
31
|
|
32
|
-
|
33
|
-
<%#= f.hidden_field :street, class: "mgca_txt street", id: "#{idkey}street" %>
|
34
|
-
<%#= f.hidden_field :street_number, class: "mgca_txt street_number", id: "#{idkey}street_number" %>
|
35
32
|
<%= f.hidden_field :latitude, id: "#{idkey}latitude", class: "mgca_latitude" %>
|
36
33
|
<%= f.hidden_field :longitude, id: "#{idkey}longitude", class: "mgca_longitude" %>
|
37
|
-
<%#= f.hidden_field :zip, class: "mgca_txt zip", id: "#{idkey}zip" %>
|
38
|
-
<%#= f.hidden_field :country, class: "mgca_txt country", id: "#{idkey}country" %>
|
39
34
|
<%= f.hidden_field :country_code, class: "mgca_txt country_code", id: "#{idkey}country_code" %>
|
40
35
|
<%= f.hidden_field :state, class: "mgca_txt state", id: "#{idkey}state" %>
|
41
|
-
<%#= f.hidden_field :city, class: "mgca_txt city", id: "#{idkey}city" %>
|
42
36
|
<%= f.hidden_field :district, class: "mgca_txt district", id: "#{idkey}district" %>
|
43
37
|
|
44
|
-
|
45
38
|
<div class="clearfix"></div>
|
46
39
|
<div id="<%= idkey %>preview_map" class="address_preview_map"></div>
|
47
40
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
</div>
|
9
9
|
|
10
10
|
<div class="fields">
|
11
|
-
<input type="text" id="<%= idkey %>map_data" class="mgca_short_data <%= style %>" placeholder="<%= placeholder %>"/>
|
11
|
+
<input type="text" id="<%= idkey %>map_data" class="mgca_short_data <%= style %>" placeholder="<%= placeholder %>" value="<%= f.object.presentation %>"/>
|
12
12
|
<%= f.hidden_field :street, class: "mgca_txt street", id: "#{idkey}street" %>
|
13
13
|
<%= f.hidden_field :street_number, class: "mgca_txt street_number", id: "#{idkey}street_number" %>
|
14
14
|
<%= f.hidden_field :latitude, id: "#{idkey}latitude", class: "mgca_latitude" %>
|
@@ -94,7 +94,7 @@ class MagicAddresses::Address < ActiveRecord::Base
|
|
94
94
|
|
95
95
|
def presentation( type = "inline" )
|
96
96
|
adr = []
|
97
|
-
adr << "#{street} #{
|
97
|
+
adr << "#{street} #{number}".strip if street.present?
|
98
98
|
adr << "#{postalcode} #{city}" if zipcode.present? || city.present?
|
99
99
|
adr << "(#{country})" if country.present?
|
100
100
|
if adr.count == 0
|
@@ -167,7 +167,7 @@ private
|
|
167
167
|
# build street parameters
|
168
168
|
street_params = []
|
169
169
|
geo_data.each do |key, stuff|
|
170
|
-
street_params << { locale: key.to_s, street_name: stuff.street } if stuff.street && ((stuff.street != geo_data[default_locale].street) || (default_locale == key.to_s))
|
170
|
+
street_params << { locale: key.to_s, street_name: stuff.street } if stuff.street # && ((stuff.street != geo_data[default_locale].street) || (default_locale == key.to_s))
|
171
171
|
end
|
172
172
|
# set street parameters if present
|
173
173
|
if street_params.any?
|
@@ -234,7 +234,7 @@ private
|
|
234
234
|
lng_params = []
|
235
235
|
geo_data.each do |key, stuff|
|
236
236
|
dev_log "#{that.to_s.titleize}-Params (#{key}) ... #{stuff.send(that)}"
|
237
|
-
lng_params << { locale: key.to_s, name: stuff.send(that) } if stuff.send(that) && ((stuff.send(that) != geo_data[default_locale].send(that)) || (key.to_s == default_locale))
|
237
|
+
lng_params << { locale: key.to_s, name: stuff.send(that) } if stuff.send(that) # && ((stuff.send(that) != geo_data[default_locale].send(that)) || (key.to_s == default_locale))
|
238
238
|
end
|
239
239
|
lng_params
|
240
240
|
end
|